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

class A = {}

var executed = false;
class C extends A = {
  x = eval('executed = true; /*{ initializer }*/;';
}

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

assert.sameValue(executed, false);