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

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

Issue 1073233002: [es6] Fix length property of collection constructors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/weak-collection.js ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 TestPrototype(Map); 339 TestPrototype(Map);
340 TestPrototype(WeakMap); 340 TestPrototype(WeakMap);
341 TestPrototype(WeakSet); 341 TestPrototype(WeakSet);
342 342
343 343
344 // Test constructor property of the Set, Map, WeakMap and WeakSet prototype. 344 // Test constructor property of the Set, Map, WeakMap and WeakSet prototype.
345 function TestConstructor(C) { 345 function TestConstructor(C) {
346 assertFalse(C === Object.prototype.constructor); 346 assertFalse(C === Object.prototype.constructor);
347 assertSame(C, C.prototype.constructor); 347 assertSame(C, C.prototype.constructor);
348 assertSame(C, (new C).__proto__.constructor); 348 assertSame(C, (new C).__proto__.constructor);
349 assertEquals(1, C.length); 349 assertEquals(0, C.length);
350 } 350 }
351 TestConstructor(Set); 351 TestConstructor(Set);
352 TestConstructor(Map); 352 TestConstructor(Map);
353 TestConstructor(WeakMap); 353 TestConstructor(WeakMap);
354 TestConstructor(WeakSet); 354 TestConstructor(WeakSet);
355 355
356 356
357 // Test the Set, Map, WeakMap and WeakSet global properties themselves. 357 // Test the Set, Map, WeakMap and WeakSet global properties themselves.
358 function TestDescriptor(global, C) { 358 function TestDescriptor(global, C) {
359 assertEquals({ 359 assertEquals({
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 assertEquals(adderName + 'iterator', log); 1467 assertEquals(adderName + 'iterator', log);
1468 1468
1469 Object.defineProperty(ctor.prototype, adderName, { 1469 Object.defineProperty(ctor.prototype, adderName, {
1470 value: adderFunction 1470 value: adderFunction
1471 }); 1471 });
1472 } 1472 }
1473 TestConstructorOrderOfAdderIterator(Map, 'set'); 1473 TestConstructorOrderOfAdderIterator(Map, 'set');
1474 TestConstructorOrderOfAdderIterator(Set, 'add'); 1474 TestConstructorOrderOfAdderIterator(Set, 'add');
1475 TestConstructorOrderOfAdderIterator(WeakMap, 'set'); 1475 TestConstructorOrderOfAdderIterator(WeakMap, 'set');
1476 TestConstructorOrderOfAdderIterator(WeakSet, 'add'); 1476 TestConstructorOrderOfAdderIterator(WeakSet, 'add');
OLDNEW
« no previous file with comments | « src/weak-collection.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698