]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/global-environment-does-not-trap-unscopables.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / global-environment-does-not-trap-unscopables.js
1 function test(actual, expected) {
2 if (actual !== expected)
3 throw new Error('bad value: ' + actual);
4 }
5
6 var global = new Function('return this')();
7 var Cocoa = 'Cocoa';
8
9 global[Symbol.unscopables] = {
10 Cocoa: true
11 };
12
13 test(Cocoa, "Cocoa");
14 (function () {
15 var Cocoa = 'local'
16 with (global) {
17 test(Cocoa, "local");
18 }
19 }());