Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/accessor-name-computed-err-evaluation.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/accessor-names/computed-err-evaluation.case
3 // - src/accessor-names/error/obj.template
4 /*---
5 description: Abrupt completion when evaluating expression (Object initializer)
6 esid: sec-object-initializer-runtime-semantics-evaluation
7 es6id: 12.2.6.8
8 flags: [generated]
9 info: |
10 ObjectLiteral :
11 { PropertyDefinitionList }
12 { PropertyDefinitionList , }
13
14 1. Let obj be ObjectCreate(%ObjectPrototype%).
15 2. Let status be the result of performing PropertyDefinitionEvaluation of
16 PropertyDefinitionList with arguments obj and true.
17
18 12.2.6.7 Runtime Semantics: Evaluation
19
20 ComputedPropertyName : [ AssignmentExpression ]
21
22 1. Let exprValue be the result of evaluating AssignmentExpression.
23 2. Let propName be ? GetValue(exprValue).
24 ---*/
25 var thrower = function() {
26 throw new Test262Error();
27 };
28
29
30 assert.throws(Test262Error, function() {
31 ({
32 get [thrower()]() {}
33 });
34 }, '`get` accessor');
35
36 assert.throws(Test262Error, function() {
37 ({
38 set [thrower()](_) {}
39 });
40 }, '`set` accessor');