accessor-name-computed-err-unresolvable.js (1096B)
1 // This file was procedurally generated from the following sources: 2 // - src/accessor-names/computed-err-unresolvable.case 3 // - src/accessor-names/error/obj.template 4 /*--- 5 description: Abrupt completion when resolving reference value (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 [...] 20 21 ComputedPropertyName : [ AssignmentExpression ] 22 23 1. Let exprValue be the result of evaluating AssignmentExpression. 24 2. Let propName be ? GetValue(exprValue). 25 ---*/ 26 27 assert.throws(ReferenceError, function() { 28 ({ 29 get [test262unresolvable]() {} 30 }); 31 }, '`get` accessor'); 32 33 assert.throws(ReferenceError, function() { 34 ({ 35 set [test262unresolvable](_) {} 36 }); 37 }, '`set` accessor'); 38 39 reportCompare(0, 0);