Skip to content

Commit

Permalink
fix(reactivity): ios10.x TypeError "arguments","callee" and "caller" …
Browse files Browse the repository at this point in the history
…cannot be accessed in strict mode
  • Loading branch information
haien.dqy committed Nov 4, 2021
1 parent 090df08 commit 8dd04b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/reactivity/src/baseHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`)

const builtInSymbols = new Set(
Object.getOwnPropertyNames(Symbol)
.filter(key => {
// ios10.x Object.getOwnPropertyNames(Symbol) can enumerate 'arguments' and 'caller'
// fix TypeError "arguments","callee" and "caller" cannot be accessed in strict mode vue
const excludes = ['arguments', 'caller'];
return !excludes.includes(key);
})
.map(key => (Symbol as any)[key])
.filter(isSymbol)
)
Expand Down

0 comments on commit 8dd04b3

Please sign in to comment.