accessor-name-computed-err-evaluation.js (1114B)
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 flags: [generated] 8 info: | 9 ObjectLiteral : 10 { PropertyDefinitionList } 11 { PropertyDefinitionList , } 12 13 1. Let obj be ObjectCreate(%ObjectPrototype%). 14 2. Let status be the result of performing PropertyDefinitionEvaluation of 15 PropertyDefinitionList with arguments obj and true. 16 17 12.2.6.7 Runtime Semantics: Evaluation 18 19 ComputedPropertyName : [ AssignmentExpression ] 20 21 1. Let exprValue be the result of evaluating AssignmentExpression. 22 2. Let propName be ? GetValue(exprValue). 23 ---*/ 24 var thrower = function() { 25 throw new Test262Error(); 26 }; 27 28 29 assert.throws(Test262Error, function() { 30 ({ 31 get [thrower()]() {} 32 }); 33 }, '`get` accessor'); 34 35 assert.throws(Test262Error, function() { 36 ({ 37 set [thrower()](_) {} 38 }); 39 }, '`set` accessor'); 40 41 reportCompare(0, 0);