refactor: drop redundant tag write-path blocking

Write blocking on assign/capture/increment/decrement duplicated read-side
protection in readJSProperty; null-proto scopes from push already prevent
prototype pollution on managed writes.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-07-21 20:31:38 +08:00
co-authored by Cursor
parent 90ab891c29
commit bc207a66b7
7 changed files with 2 additions and 28 deletions
+1 -5
View File
@@ -9,7 +9,7 @@ export type Scope = ScopeObject | Drop
const BLOCKED_SCOPE_KEYS = new Set(['__proto__', 'constructor', 'prototype'])
export function isBlockedScopeKey (key: PropertyKey): boolean {
function isBlockedScopeKey (key: PropertyKey): boolean {
return typeof key === 'string' && BLOCKED_SCOPE_KEYS.has(key)
}
@@ -19,10 +19,6 @@ export function shouldBlockScopeKeyRead (obj: Scope, key: PropertyKey, ownProper
return !hasOwnProperty.call(obj, key)
}
export function shouldBlockScopeKeyWrite (key: PropertyKey, ownPropertyOnly: boolean): boolean {
return ownPropertyOnly && isBlockedScopeKey(key)
}
export function createScope (from?: ScopeObject): ScopeObject {
return Object.assign(Object.create(null), from)
}