Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Side by Side Diff: test/mjsunit/harmony/reflect.js

Issue 1397853005: [es6] Partially implement Reflect.preventExtensions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698