Debian Codegraph @

js/src/tests/test262/language/module-code/eval-gtbndng-local-bndng-cls.js

raw
1 // |reftest| module
2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: References to local `let` bindings resolve successfully
6 esid: sec-moduleevaluation
7 info: |
8 8.1.1.5.1 GetBindingValue (N, S)
9
10 [...]
11 3. If the binding for N is an indirect binding, then
12 [...]
13 5. Return the value currently bound to N in envRec.
14
15 14.5.16 Runtime Semantics: Evaluation
16
17 ClassDeclaration : class BindingIdentifier ClassTail
18
19 1. Let status be the result of BindingClassDeclarationEvaluation of this
20 ClassDeclaration.
21 2. ReturnIfAbrupt(status).
22 3. Return NormalCompletion(empty).
23
24 14.5.15 Runtime Semantics: BindingClassDeclarationEvaluation
25
26 [...]
27 7. Perform ? InitializeBoundName(className, value, env).
28 [...]
29 flags: [module]
30 ---*/
31
32 class classBinding { valueOf() { return 33; } }
33 assert.sameValue(new classBinding().valueOf(), 33);
34
35 classBinding = 44;
36 assert.sameValue(classBinding, 44);
37
38 reportCompare(0, 0);