MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / hideBodyScopeParams

Function hideBodyScopeParams

src/compute-engine/function-utils.ts:337–351  ·  view source on GitHub ↗

* Temporarily remove param bindings from bodyScope so they don't shadow * the freshScope values during scope chain lookup. Returns the removed * entries for restoration.

(
  bodyScope: Scope,
  paramNames: string[]
)

Source from the content-addressed store, hash-verified

335 * (e.g. `["Function", ["Block", ["Add", "_", 1]], "_"]`).
336 *
337 *
338 * #### DURING CANONICALIZATION (in canonicalFunctionLiteralArguments())
339 *
340 * 1/ If not a `["Function"]` expression, the expression is rewritten
341 * to a `["Function"]` expression with anonymous parameters
342 * 2/ A `Block` scope is created
343 * 3/ The function parameters are declared in the Block's scope
344 * 4/ The function body is canonicalized in the context of the scope.
345 * The Block's localScope captures the defining scope as its parent.
346 *
347 *
348 * #### DURING EVALUATION (executing the result of makeLambda())
349 *
350 * 1/ The arguments are evaluated in the **calling** scope
351 * 2/ A call frame is created per call, with parent = the **defining**
352 * scope (`definingScopeOf()`: the activation that the function value
353 * keeps, or the scope the literal was boxed in), giving true lexical
354 * scoping

Callers 1

invokeFunction · 0.85

Calls 2

getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected