| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/class-fields/init-err-evaluation.case |
| 3 |
// - src/class-fields/default/cls-expr.template |
| 4 |
/*--- |
| 5 |
description: Return abrupt completion evaluating the field initializer (field definitions in a class expression) |
| 6 |
esid: prod-FieldDefinition |
| 7 |
features: [class, class-fields-public] |
| 8 |
flags: [generated] |
| 9 |
info: | |
| 10 |
[[Construct]] ( argumentsList, newTarget) |
| 11 |
|
| 12 |
8. If kind is "base", then |
| 13 |
a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). |
| 14 |
b. Let result be InitializeInstanceFields(thisArgument, F). |
| 15 |
... |
| 16 |
... |
| 17 |
11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). |
| 18 |
... |
| 19 |
|
| 20 |
---*/ |
| 21 |
var x = 0; |
| 22 |
function fn1() { x += 1; } |
| 23 |
function fn2() { throw new Test262Error(); } |
| 24 |
|
| 25 |
|
| 26 |
var C = class { |
| 27 |
x = fn1(); |
| 28 |
y = fn2(); |
| 29 |
z = fn1(); |
| 30 |
} |
| 31 |
|
| 32 |
assert.throws(Test262Error, function() { |
| 33 |
new C(); |
| 34 |
}); |
| 35 |
|
| 36 |
assert.sameValue(x, 1); |