MCPcopy Create free account
hub / github.com/arktypeio/arktype / isNonExtensibleCall

Method isNonExtensibleCall

ark/aot/precompile.ts:2436–2449  ·  view source on GitHub ↗
(node: Node, module: SourceModule)

Source from the content-addressed store, hash-verified

2434 }
2435
2436 private isNonExtensibleCall(node: Node, module: SourceModule): boolean {
2437 const unwrapped = unwrapChain(node)
2438 if (unwrapped.type !== "CallExpression") return false
2439 const callee = unwrapChain(unwrapped.callee)
2440 if (callee.type !== "MemberExpression") return false
2441 const obj = unwrapChain(callee.object)
2442 if (obj.type !== "Identifier" || module.scopes.byId.get(obj)?.binding)
2443 return false
2444 const name = memberNameOf(callee)
2445 return (
2446 obj.name === "Object" &&
2447 (name === "freeze" || name === "seal" || name === "preventExtensions")
2448 )
2449 }
2450
2451 private isBindingNonExtensible(
2452 binding: Binding,

Callers 3

isNodeNonExtensibleMethod · 0.95
isSiteNonExtensibleMethod · 0.95

Calls 3

unwrapChainFunction · 0.90
memberNameOfFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected