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

Function inScope

src/compute-engine/engine-scope.ts:61–80  ·  view source on GitHub ↗
(
  ce: IComputeEngine,
  scope: Scope | undefined,
  f: () => T
)

Source from the content-addressed store, hash-verified

59 // `types-kernel-evaluation.ts` for why `any` alone is not enough).
60 _anyVersionAtPush: ce._anyVersion,
61 _semanticVersionAtPush: ce._semanticVersion,
62 _worldVersionAtPush: ce._worldVersion,
63 });
64}
65
66export function popEvalContext(ce: IComputeEngine): void {
67 discardEvalContext(ce, ce._evalContextStack.pop());
68}
69
70/**
71 * Remove one SPECIFIC evaluation context, wherever it currently sits.
72 *
73 * The asynchronous evaluation path holds its context across an `await`
74 * (`BoxedFunction._computeValueAsync`), so by the time it unwinds, its frame is
75 * not necessarily on top: another evaluation on the same engine may have pushed
76 * above it. Popping the top there would destroy a frame belonging to something
77 * still running — disposing its bindings out from under it. Removing by
78 * identity leaves every other frame intact.
79 *
80 * A no-op if the context is not on the stack (already removed).
81 */
82export function removeEvalContext(
83 ce: IComputeEngine,

Callers

nothing calls this directly

Calls 1

fFunction · 0.50

Tested by

no test coverage detected