mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
16 lines
499 B
TypeScript
16 lines
499 B
TypeScript
import { Value } from '../value.mts';
|
|
import { NormalCompletion } from '../completion.mts';
|
|
import { Evaluate } from '../evaluator.mts';
|
|
import type { ParseNode } from '../parser/ParseNode.mts';
|
|
|
|
/** https://tc39.es/ecma262/#sec-script-semantics-runtime-semantics-evaluation */
|
|
// Script :
|
|
// [empty]
|
|
// ScriptBody
|
|
export function* Evaluate_Script({ ScriptBody }: ParseNode.Script) {
|
|
if (!ScriptBody) {
|
|
return NormalCompletion(Value.undefined);
|
|
}
|
|
return yield* Evaluate(ScriptBody);
|
|
}
|