Debian Codegraph @

js/src/tests/test262/language/module-code/namespace/internals/enumerate-binding-uninit.js

raw
1 // |reftest| module
2 // Copyright (C) 2017 André Bargull. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-enumerate-object-properties
7 description: >
8 Test for-in enumeration with uninitialized binding.
9 info: |
10 13.7.5.15 EnumerateObjectProperties (O)
11 ...
12 EnumerateObjectProperties must obtain the own property keys of the
13 target object by calling its [[OwnPropertyKeys]] internal method.
14 Property attributes of the target object must be obtained by
15 calling its [[GetOwnProperty]] internal method.
16
17 9.4.6.4 [[GetOwnProperty]] (P)
18 ...
19 4. Let value be ? O.[[Get]](P, O).
20 ...
21
22 9.4.6.7 [[Get]] (P, Receiver)
23 ...
24 12. Let targetEnvRec be targetEnv's EnvironmentRecord.
25 13. Return ? targetEnvRec.GetBindingValue(binding.[[BindingName]], true).
26
27 8.1.1.1.6 GetBindingValue ( N, S )
28 ...
29 If the binding for N in envRec is an uninitialized binding, throw a ReferenceError exception.
30 ...
31
32 flags: [module]
33 ---*/
34
35 import* as self from "./enumerate-binding-uninit.js";
36
37 assert.throws(ReferenceError, function() {
38 for (var key in self) {
39 throw new Test262Error();
40 }
41 });
42
43 export default 0;
44
45 reportCompare(0, 0);