Browse Source

fix(compiler-sfc): initialize scope with null prototype object (#11963)

山吹色御守 1 year ago
parent
commit
215e154072
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/compiler-sfc/src/script/definePropsDestructure.ts

+ 1 - 1
packages/compiler-sfc/src/script/definePropsDestructure.ts

@@ -102,7 +102,7 @@ export function transformDestructuredProps(
     return
     return
   }
   }
 
 
-  const rootScope: Scope = {}
+  const rootScope: Scope = Object.create(null)
   const scopeStack: Scope[] = [rootScope]
   const scopeStack: Scope[] = [rootScope]
   let currentScope: Scope = rootScope
   let currentScope: Scope = rootScope
   const excludedIds = new WeakSet<Identifier>()
   const excludedIds = new WeakSet<Identifier>()