blob: 588941001f8f5ca5220dba74fddbe7a23a3dc547 [file] [log] [blame] [edit]
// 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-direct-
name: direct eval
features: [class, class-fields-private]
---*/
var executed = false;
class C {
#x = () => {
var t = () => { eval('executed = true; /*{ initializer }*/;'); };
t();
}
constructor() {
this.#x();
}
}
assert.throws(/*{ earlyerror }*/, function() {
new C();
});
assert.sameValue(executed, false);