test262/src/class-elements/initializer-eval-arguments/cls-decl-private-fields-indirect-eval-nested.template

21 lines
506 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/nested-private-indirect-
name: indirect eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = (0, eval)('executed = true; /*{ initializer }*/;');
}
assert.throws(/*{ executionerror }*/, function() {
new C();
});
assert.sameValue(executed, true);