diff --git a/packages/codemode/src/interpreter/native.ts b/packages/codemode/src/interpreter/native.ts index 05b4ca85716..95eb67f281f 100644 --- a/packages/codemode/src/interpreter/native.ts +++ b/packages/codemode/src/interpreter/native.ts @@ -13,7 +13,7 @@ import { } from "./objects.js" import { describeValue } from "./references.js" -/** A native function body: a value, a thrown `PendingThrow`, or interpreter work producing a value. */ +/** A native function body: a value, a thrown `PendingThrow`, or what the machine carries out as the call. */ export type Impl = NativeCall export const native = (builtins: Builtins, options: NativeOptions): Native => new Native(builtins.Function, options) diff --git a/packages/codemode/src/machine/machine.ts b/packages/codemode/src/machine/machine.ts index 6c5133df7ef..f6af584040b 100644 --- a/packages/codemode/src/machine/machine.ts +++ b/packages/codemode/src/machine/machine.ts @@ -264,8 +264,8 @@ export class Machine { // --- Jobs --- // Starts a job on the root stack: parked frames resume with how their promise settled, an async-from-sync iterator - // closing its iterator runs as a frame, and a reaction or thenable that calls program code runs its work in a native - // frame. One that finishes at once leaves the stack empty. + // closing its iterator runs as a frame, and a reaction or thenable that calls program code runs as the frame its job + // kind makes. One that finishes at once leaves the stack empty. private begin(job: Job): void { if (job.kind === "thenable") return this.work(adoptThenable(this.ctx, job.promise, job.thenable, job.then)) const reaction = job.reaction diff --git a/packages/codemode/src/machine/scheduler.ts b/packages/codemode/src/machine/scheduler.ts index a243cdf5951..45eb6102dd0 100644 --- a/packages/codemode/src/machine/scheduler.ts +++ b/packages/codemode/src/machine/scheduler.ts @@ -25,7 +25,7 @@ export type Combination = { /** * A settled promise's reaction, as data. It runs as a job (see `react` in promises.ts) and either finishes at once or - * starts interpreter work. The kinds: + * starts a frame that calls program code. The kinds: * - `await`: resume the frames parked on the promise, cut off the stack at an `await`. * - `settle`: pass the outcome on to `target`. * - `handler`: `then`/`catch` handlers; the handler's result settles `derived`. diff --git a/packages/codemode/src/machine/task.ts b/packages/codemode/src/machine/task.ts index 6838fdc7e46..c88239b9159 100644 --- a/packages/codemode/src/machine/task.ts +++ b/packages/codemode/src/machine/task.ts @@ -92,7 +92,7 @@ export class MachineTask { return result } - /** Calls `callable`: a program function pushes a frame; a built-in answers at once or runs as a native frame. */ + /** Calls `callable`: a program function pushes a frame; a built-in answers at once or runs as frames. */ call( callable: Value, thisValue: Value,