OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 --harmony-reflect --allow-natives-syntax | 5 // Flags: --allow-natives-syntax |
6 | 6 |
7 | 7 |
8 var symbol = %CreatePrivateSymbol("private"); | 8 var symbol = %CreatePrivateSymbol("private"); |
9 | 9 |
10 | 10 |
11 // Private symbols must never be listed. | 11 // Private symbols must never be listed. |
12 | 12 |
13 var object = {}; | 13 var object = {}; |
14 object[symbol] = 42; | 14 object[symbol] = 42; |
15 for (var key of Object.keys(object)) assertUnreachable(); | 15 for (var key of Object.keys(object)) assertUnreachable(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 assertFalse(symbol in object); | 67 assertFalse(symbol in object); |
68 assertFalse(Reflect.has(object, symbol)); | 68 assertFalse(Reflect.has(object, symbol)); |
69 | 69 |
70 // [[Get]] | 70 // [[Get]] |
71 assertEquals(undefined, proxy[symbol]); | 71 assertEquals(undefined, proxy[symbol]); |
72 assertEquals(undefined, Reflect.get(proxy, symbol)); | 72 assertEquals(undefined, Reflect.get(proxy, symbol)); |
73 assertEquals(undefined, Reflect.get(proxy, symbol, 42)); | 73 assertEquals(undefined, Reflect.get(proxy, symbol, 42)); |
74 assertEquals(undefined, object[symbol]); | 74 assertEquals(undefined, object[symbol]); |
75 assertEquals(undefined, Reflect.get(object, symbol)); | 75 assertEquals(undefined, Reflect.get(object, symbol)); |
76 assertEquals(undefined, Reflect.get(object, symbol, 42)); | 76 assertEquals(undefined, Reflect.get(object, symbol, 42)); |
OLD | NEW |