summaryrefslogtreecommitdiff
path: root/src/class-fields/initializer-eval-arguments/cls-decl-fields-indirect-eval.template
blob: 0b795b6e7f783f258119fa4b92fe08cd6d5c546e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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/fields-indirect-
name: indirect eval
---*/

var executed = false;
class C {
  x = (0, eval)('executed = true; /*{ initializer }*/;');
}

assert.throws(/*{ executionerror }*/, function() {
  new C();
});

assert.sameValue(executed, true);