diff --git a/src/context/context.ts b/src/context/context.ts index 2619be6b6..959a1d8f2 100644 --- a/src/context/context.ts +++ b/src/context/context.ts @@ -155,10 +155,10 @@ export class Context { } } -const BLOCKED_SCOPE_KEYS = new Set(['__proto__', 'constructor', 'prototype']) +const BLOCKED_SCOPE_KEYS: ReadonlySet = new Set(['__proto__', 'constructor', 'prototype']) export function readJSProperty (obj: Scope, key: PropertyKey, ownPropertyOnly: boolean) { - if (typeof key === 'string' && BLOCKED_SCOPE_KEYS.has(key)) { + if (BLOCKED_SCOPE_KEYS.has(key)) { if (ownPropertyOnly || !hasOwnProperty.call(obj, key)) return undefined } if (ownPropertyOnly && !hasOwnProperty.call(obj, key) && !(obj instanceof Drop)) return undefined