Merge commit '6e92d2345e8231a44556ce7d416451f5f3e6c398' as 'engine262'

This commit is contained in:
2026-03-27 10:07:29 +05:30
433 changed files with 90478 additions and 0 deletions
@@ -0,0 +1,22 @@
import {
Evaluate,
} from '../evaluator.mts';
import {
Q,
ThrowCompletion,
} from '../completion.mts';
import type { ParseNode } from '../parser/ParseNode.mts';
import {
GetValue,
} from '#self';
/** https://tc39.es/ecma262/#sec-throw-statement-runtime-semantics-evaluation */
// ThrowStatement : `throw` Expression `;`
export function* Evaluate_ThrowStatement({ Expression }: ParseNode.ThrowStatement) {
// 1. Let exprRef be the result of evaluating Expression.
const exprRef = Q(yield* Evaluate(Expression));
// 2. Let exprValue be ? GetValue(exprRef).
const exprValue = Q(yield* GetValue(exprRef));
// 3. Return ThrowCompletion(exprValue).
return ThrowCompletion(exprValue);
}