OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-proxies | |
6 | |
7 | 5 |
8 function TestBasics() { | 6 function TestBasics() { |
9 var log = []; | 7 var log = []; |
10 | 8 |
11 var proxy = new Proxy({}, { | 9 var proxy = new Proxy({}, { |
12 get: function(target, key) { | 10 get: function(target, key) { |
13 log.push("get " + String(key)); | 11 log.push("get " + String(key)); |
14 if (key === 'x') return 1; | 12 if (key === 'x') return 1; |
15 }, | 13 }, |
16 has: function(target, key) { | 14 has: function(target, key) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 137 |
140 global.x = 2; | 138 global.x = 2; |
141 assertEquals(2, global.x); | 139 assertEquals(2, global.x); |
142 assertEquals(2, x); | 140 assertEquals(2, x); |
143 | 141 |
144 x = 3; | 142 x = 3; |
145 assertEquals(3, global.x); | 143 assertEquals(3, global.x); |
146 assertEquals(3, x); | 144 assertEquals(3, x); |
147 } | 145 } |
148 TestGlobalShouldIgnoreUnscopables(); | 146 TestGlobalShouldIgnoreUnscopables(); |
OLD | NEW |