computed-err-evaluation.js (1132B)
1 // This file was procedurally generated from the following sources: 2 // - src/accessor-names/computed-err-evaluation.case 3 // - src/accessor-names/error/cls-expr-inst.template 4 /*--- 5 description: Abrupt completion when evaluating expression (Class expression, instance method) 6 esid: sec-runtime-semantics-classdefinitionevaluation 7 features: [class] 8 flags: [generated] 9 info: | 10 [...] 11 21. For each ClassElement m in order from methods 12 a. If IsStatic of m is false, then 13 i. Let status be the result of performing PropertyDefinitionEvaluation 14 for m with arguments proto and false. 15 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 0, class { 31 get [thrower()]() {} 32 }; 33 }, '`get` accessor'); 34 35 assert.throws(Test262Error, function() { 36 0, class { 37 set [thrower()](_) {} 38 }; 39 }, '`set` accessor'); 40 41 reportCompare(0, 0);