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

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

Issue 1995263002: [keys] Simplify KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix handle dereferencing Created 4 years, 7 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 | « test/cctest/test-api-interceptors.cc ('k') | no next file » | 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 // TODO(neis): Test with proxies. 5 // TODO(neis): Test with proxies.
6 6
7 7
8 8
9 //////////////////////////////////////////////////////////////////////////////// 9 ////////////////////////////////////////////////////////////////////////////////
10 // (Auxiliaries) 10 // (Auxiliaries)
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 (function testReflectOwnKeysOnObject(){ 534 (function testReflectOwnKeysOnObject(){
535 assertEquals(["z", "y", "x"], Reflect.ownKeys({z: 3, y: 2, x: 1})); 535 assertEquals(["z", "y", "x"], Reflect.ownKeys({z: 3, y: 2, x: 1}));
536 assertEquals(["length"], Reflect.ownKeys([])); 536 assertEquals(["length"], Reflect.ownKeys([]));
537 537
538 var s1 = Symbol("foo"); 538 var s1 = Symbol("foo");
539 var s2 = Symbol("bar"); 539 var s2 = Symbol("bar");
540 var obj = { [s1]: 0, "bla": 0, 42: 0, "0": 0, 540 var obj = { [s1]: 0, "bla": 0, 42: 0, "0": 0,
541 [s2]: 0, "-1": 0, "88": 0, "aaa": 0 }; 541 [s2]: 0, "-1": 0, "88": 0, "aaa": 0 };
542 assertEquals(["0", "42", "88", "bla", "-1", "aaa", s1, s2], 542 assertEquals(["0", "42", "88", "bla", "-1", "aaa", s1, s2],
543 Reflect.ownKeys(obj)); 543 Reflect.ownKeys(obj));
544 // Force dict-mode elements.
545 delete obj[0];
546 assertEquals(["42", "88", "bla", "-1", "aaa", s1, s2],
547 Reflect.ownKeys(obj));
548 // Force dict-mode properties.
549 delete obj["bla"];
550 assertEquals(["42", "88", "-1", "aaa", s1, s2], Reflect.ownKeys(obj));
544 })(); 551 })();
545 552
546 553
547 // See reflect-own-keys.js for further tests. 554 // See reflect-own-keys.js for further tests.
548 555
549 556
550 557
551 //////////////////////////////////////////////////////////////////////////////// 558 ////////////////////////////////////////////////////////////////////////////////
552 // Reflect.preventExtensions 559 // Reflect.preventExtensions
553 560
554 561
555 (function testReflectPreventExtensionsArity() { 562 (function testReflectPreventExtensionsArity() {
556 assertEquals(1, Reflect.preventExtensions.length); 563 assertEquals(1, Reflect.preventExtensions.length);
557 })(); 564 })();
558 565
559 566
560 (function testReflectPreventExtensionsOnNonObject() { 567 (function testReflectPreventExtensionsOnNonObject() {
561 assertThrows(function() { Reflect.preventExtensions(); }, TypeError); 568 assertThrows(function() { Reflect.preventExtensions(); }, TypeError);
562 assertThrows(function() { Reflect.preventExtensions(42); }, TypeError); 569 assertThrows(function() { Reflect.preventExtensions(42); }, TypeError);
563 assertThrows(function() { Reflect.preventExtensions(null); }, TypeError); 570 assertThrows(function() { Reflect.preventExtensions(null); }, TypeError);
564 })(); 571 })();
565 572
566 573
567 // See reflect-prevent-extensions.js for further tests. 574 // See reflect-prevent-extensions.js for further tests.
568 575
569 // TODO(neis): Need proxies to test the situation where 576 // TODO(neis): Need proxies to test the situation where
570 // [[preventExtensions]] returns false. 577 // [[preventExtensions]] returns false.
OLDNEW
« no previous file with comments | « test/cctest/test-api-interceptors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698