Просмотр исходного кода

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

山吹色御守 1 год назад
Родитель
Сommit
215e154072
1 измененных файлов с 1 добавлено и 1 удалено
  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
   }
 
-  const rootScope: Scope = {}
+  const rootScope: Scope = Object.create(null)
   const scopeStack: Scope[] = [rootScope]
   let currentScope: Scope = rootScope
   const excludedIds = new WeakSet<Identifier>()