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

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

Issue 1397443013: [es6] Implement Reflect.enumerate. (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
« no previous file with comments | « src/js/harmony-reflect.js ('k') | test/mjsunit/harmony/reflect-enumerate.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.enumerate
264
265
266 (function testReflectEnumerateArity() {
267 assertEquals(1, Reflect.enumerate.length);
268 })();
269
270
271 (function testReflectEnumerateOnNonObject() {
272 assertThrows(function() { Reflect.enumerate(); }, TypeError);
273 assertThrows(function() { Reflect.enumerate(42); }, TypeError);
274 assertThrows(function() { Reflect.enumerate(null); }, TypeError);
275 })();
276
277
278 // See reflect-enumerate*.js for further tests.
OLDNEW
« no previous file with comments | « src/js/harmony-reflect.js ('k') | test/mjsunit/harmony/reflect-enumerate.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698