OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 | 5 // Flags: --harmony-proxies --harmony-reflect |
6 | 6 |
7 var target = { | 7 var target = { |
8 "target_one": 1 | 8 "target_one": 1 |
9 }; | 9 }; |
10 target.__proto__ = { | 10 target.__proto__ = { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 assertThrows("Reflect.ownKeys(proxy)", TypeError); | 67 assertThrows("Reflect.ownKeys(proxy)", TypeError); |
68 | 68 |
69 // Step 17a: The trap result must include all non-configurable keys. | 69 // Step 17a: The trap result must include all non-configurable keys. |
70 Object.defineProperty(target, "nonconf", {value: 1, configurable: false}); | 70 Object.defineProperty(target, "nonconf", {value: 1, configurable: false}); |
71 keys = ["foo"]; | 71 keys = ["foo"]; |
72 assertThrows("Reflect.ownKeys(proxy)", TypeError); | 72 assertThrows("Reflect.ownKeys(proxy)", TypeError); |
73 keys = ["nonconf"]; | 73 keys = ["nonconf"]; |
74 assertEquals(keys, Reflect.ownKeys(proxy)); | 74 assertEquals(keys, Reflect.ownKeys(proxy)); |
75 | 75 |
76 // Step 19a: The trap result must all keys of a non-extensible target. | 76 // Step 19a: The trap result must all keys of a non-extensible target. |
77 Object.freeze(target); | 77 Object.preventExtensions(target); |
78 assertThrows("Reflect.ownKeys(proxy)", TypeError); | 78 assertThrows("Reflect.ownKeys(proxy)", TypeError); |
79 keys = ["nonconf", "target_one"]; | 79 keys = ["nonconf", "target_one"]; |
80 assertEquals(keys, Reflect.ownKeys(proxy)); | 80 assertEquals(keys, Reflect.ownKeys(proxy)); |
81 | 81 |
82 // Step 20: The trap result must not add keys to a non-extensible target. | 82 // Step 20: The trap result must not add keys to a non-extensible target. |
83 keys = ["nonconf", "target_one", "fantasy"]; | 83 keys = ["nonconf", "target_one", "fantasy"]; |
84 assertThrows("Reflect.ownKeys(proxy)", TypeError); | 84 assertThrows("Reflect.ownKeys(proxy)", TypeError); |
OLD | NEW |