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-reflect | 5 // Flags: --harmony-reflect |
6 | 6 |
7 // TODO(neis): Test with proxies. | 7 // TODO(neis): Test with proxies. |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 (function testReflectIsExtensibleOnObject() { | 249 (function testReflectIsExtensibleOnObject() { |
250 // This should be the last test as it modifies the objects irreversibly. | 250 // This should be the last test as it modifies the objects irreversibly. |
251 for (let tgt of objects) { | 251 for (let tgt of objects) { |
252 prepare(tgt); | 252 prepare(tgt); |
253 if (tgt instanceof Int32Array) continue; // issue v8:4460 | 253 if (tgt instanceof Int32Array) continue; // issue v8:4460 |
254 assertTrue(Reflect.isExtensible(tgt)); | 254 assertTrue(Reflect.isExtensible(tgt)); |
255 Object.preventExtensions(tgt); | 255 Object.preventExtensions(tgt); |
256 assertFalse(Reflect.isExtensible(tgt)); | 256 assertFalse(Reflect.isExtensible(tgt)); |
257 } | 257 } |
258 })(); | 258 })(); |
| 259 |
| 260 |
| 261 |
| 262 //////////////////////////////////////////////////////////////////////////////// |
| 263 // Reflect.preventExtensions |
| 264 |
| 265 |
| 266 (function testReflectPreventExtensionsArity() { |
| 267 assertEquals(1, Reflect.preventExtensions.length); |
| 268 })(); |
| 269 |
| 270 |
| 271 (function testReflectPreventExtensionsOnNonObject() { |
| 272 assertThrows(function() { Reflect.preventExtensions(); }, TypeError); |
| 273 assertThrows(function() { Reflect.preventExtensions(42); }, TypeError); |
| 274 assertThrows(function() { Reflect.preventExtensions(null); }, TypeError); |
| 275 })(); |
| 276 |
| 277 |
| 278 // See reflect-prevent-extensions.js for further tests. |
| 279 |
| 280 // TODO(neis): Need proxies to test the situation where |
| 281 // [[preventExtensions]] returns false. |
OLD | NEW |