| // Copyright (C) 2017 Valerie Young. 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/direct- | |
| name: direct eval | |
| features: [class, class-fields-public] | |
| ---*/ | |
| var executed = false; | |
| class C { | |
| x = eval('executed = true; /*{ initializer }*/;'); | |
| } | |
| assert.throws(/*{ earlyerror }*/, function() { | |
| new C(); | |
| }); | |
| assert.sameValue(executed, false); |