فهرست منبع

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

山吹色御守 1 سال پیش
والد
کامیت
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>()