mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 21:31:46 +00:00
Merge commit '6e92d2345e8231a44556ce7d416451f5f3e6c398' as 'engine262'
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { Evaluate } from '../evaluator.mts';
|
||||
import { Q } from '../completion.mts';
|
||||
import type { ParseNode } from '../parser/ParseNode.mts';
|
||||
import { GetValue } from '#self';
|
||||
import type { Value, ValueEvaluator } from '#self';
|
||||
|
||||
/** https://tc39.es/ecma262/#sec-comma-operator-runtime-semantics-evaluation */
|
||||
// Expression :
|
||||
// AssignmentExpression
|
||||
// Expression `,` AssignmentExpression
|
||||
export function* Evaluate_CommaOperator({ ExpressionList }: ParseNode.CommaOperator): ValueEvaluator {
|
||||
let result!: Value;
|
||||
for (const Expression of ExpressionList) {
|
||||
const lref = Q(yield* Evaluate(Expression));
|
||||
result = Q(yield* GetValue(lref));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user