Debian Codegraph @

js/src/tests/test262/language/statements/with/binding-not-blocked-by-unscopables-non-obj.js

raw
1 // Copyright 2015 Mike Pennisi. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es6id: 8.1.1.2.1
6 description: Non-object values of `Symbol.unscopables` property are ignored
7 info: |
8 [...]
9 6. If the withEnvironment flag of envRec is false, return true.
10 7. Let unscopables be Get(bindings, @@unscopables).
11 8. ReturnIfAbrupt(unscopables).
12 9. If Type(unscopables) is Object, then
13 a. Let blocked be ToBoolean(Get(unscopables, N)).
14 b. ReturnIfAbrupt(blocked).
15 c. If blocked is true, return false.
16 10. Return true.
17
18 ES6: 13.11.7 (The `with` Statement) Runtime Semantics: Evaluation
19 [...]
20 6. Set the withEnvironment flag of newEnv’s EnvironmentRecord to true.
21 [...]
22 flags: [noStrict]
23 features: [Symbol.unscopables]
24 ---*/
25
26 var test262ToString = {};
27 var env = { toString: test262ToString };
28 env[Symbol.unscopables] = '';
29
30 with (env) {
31 assert.sameValue(toString, test262ToString);
32 }
33
34 reportCompare(0, 0);