Explorar o código

fix(reactivity): ios10.x compatibility (#4900)

descire %!s(int64=4) %!d(string=hai) anos
pai
achega
b87dc06193
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      packages/reactivity/src/baseHandlers.ts

+ 4 - 0
packages/reactivity/src/baseHandlers.ts

@@ -37,6 +37,10 @@ const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`)
 const builtInSymbols = new Set(
   /*#__PURE__*/
   Object.getOwnPropertyNames(Symbol)
+    // ios10.x Object.getOwnPropertyNames(Symbol) can enumerate 'arguments' and 'caller'
+    // but accessing them on Symbol leads to TypeError because Symbol is a strict mode
+    // function
+    .filter(key => key !== 'arguments' && key !== 'caller')
     .map(key => (Symbol as any)[key])
     .filter(isSymbol)
 )