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,26 @@
import { surroundingAgent } from '../host-defined/engine.mts';
import { Value } from '../value.mts';
import { Q } from '../completion.mts';
import type { ParseNode } from '../parser/ParseNode.mts';
import type { ValueEvaluator } from '../evaluator.mts';
import {
PropertyDefinitionEvaluation_PropertyDefinitionList,
} from './all.mts';
import { OrdinaryObjectCreate } from '#self';
/** https://tc39.es/ecma262/#sec-object-initializer-runtime-semantics-evaluation */
// ObjectLiteral :
// `{` `}`
// `{` PropertyDefinitionList `}`
// `{` PropertyDefinitionList `,` `}`
export function* Evaluate_ObjectLiteral({ PropertyDefinitionList }: ParseNode.ObjectLiteral): ValueEvaluator {
// 1. Let obj be OrdinaryObjectCreate(%Object.prototype%).
const obj = OrdinaryObjectCreate(surroundingAgent.intrinsic('%Object.prototype%'));
if (PropertyDefinitionList.length === 0) {
return obj;
}
// 2. Perform ? PropertyDefinitionEvaluation of PropertyDefinitionList with arguments obj and true.
Q(yield* PropertyDefinitionEvaluation_PropertyDefinitionList(PropertyDefinitionList, obj, Value.true));
// 3. Return obj.
return obj;
}