Debian Codegraph @

js/src/tests/test262/language/statements/class/static-init-expr-new-target.js

raw
1 // Copyright (C) 2021 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-operations-on-objects
5 description: The "new.target" value within a static initialization block is undefined
6 info: |
7 2.1.1 EvaluateStaticBlock ( receiver , blockRecord )
8
9 1. Assert: Type(receiver) is Object.
10 2. Assert: blockRecord is a ClassStaticBlockDefinition Record.
11 3. Perform ? Call(blockRecord.[[Body]], receiver).
12 features: [class-static-block]
13 ---*/
14
15 var value = null;
16
17 class C {
18 static {
19 value = new.target;
20 }
21 }
22
23 assert.sameValue(value, undefined);
24
25 reportCompare(0, 0);