test262/src/class-elements/initializer-eval-arguments/cls-decl-private-fields-eval-arrow-body.template

24 lines
534 B
Plaintext

// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performeval-rules-in-initializer
path: language/statements/class/elements/arrow-body-private-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = eval('executed = true; /*{ arrow-body }*/;');
constructor() {
this.#x();
}
}
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);