summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/static-init-expr-this.js
blob: b71a935c139a9a0e3940bff2439dbd36293a98c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-operations-on-objects
description: The "this" value within a static initialization block is the class
info: |
  2.1.1 EvaluateStaticBlock ( receiver , blockRecord )

    1. Assert: Type(receiver) is Object.
    2. Assert: blockRecord is a ClassStaticBlockDefinition Record.
    3. Perform ? Call(blockRecord.[[Body]], receiver).
features: [class-static-block]
---*/

var value;

class C {
  static {
    value = this;
  }
}

assert.sameValue(value, C);

reportCompare(0, 0);