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

Unified Diff: test/mjsunit/es6/collections.js

Issue 461193002: Revert "ES6: Make Map/Set constructors support iterable values" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/weak_collection.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/collections.js
diff --git a/test/mjsunit/es6/collections.js b/test/mjsunit/es6/collections.js
index 911b748ed9de632d7da903f203d744fea2cfaa44..c58571950c9545861dfa9d99e8ac25ebde8913d4 100644
--- a/test/mjsunit/es6/collections.js
+++ b/test/mjsunit/es6/collections.js
@@ -1015,9 +1015,6 @@ function TestSetConstructor(ctor) {
assertThrows(function() {
new ctor({});
}, TypeError);
- assertThrows(function() {
- new ctor(true);
- }, TypeError);
// @@iterator not callable
assertThrows(function() {
@@ -1151,39 +1148,6 @@ TestSetConstructorNextNotAnObject(WeakSet);
})();
-function TestSetConstructorIterableValue(ctor) {
- 'use strict';
- // Strict mode is required to prevent implicit wrapping in the getter.
- Object.defineProperty(Number.prototype, Symbol.iterator, {
- get: function() {
- assertEquals('object', typeof this);
- return function() {
- return oneAndTwo.keys();
- };
- },
- configurable: true
- });
-
- var set = new ctor(42);
- assertSize(2, set);
- assertTrue(set.has(k1));
- assertTrue(set.has(k2));
-
- delete Number.prototype[Symbol.iterator];
-}
-TestSetConstructorIterableValue(Set);
-TestSetConstructorIterableValue(WeakSet);
-
-
-(function TestSetConstructorStringValue() {
- var s = new Set('abc');
- assertSize(3, s);
- assertTrue(s.has('a'));
- assertTrue(s.has('b'));
- assertTrue(s.has('c'));
-})();
-
-
function TestMapConstructor(ctor) {
var m = new ctor(null);
assertSize(0, m);
@@ -1195,9 +1159,6 @@ function TestMapConstructor(ctor) {
assertThrows(function() {
new ctor({});
}, TypeError);
- assertThrows(function() {
- new ctor(true);
- }, TypeError);
// @@iterator not callable
assertThrows(function() {
@@ -1339,27 +1300,3 @@ TestMapConstructorIteratorNotObjectValues(WeakMap);
new WeakMap([[1, 2]])
}, TypeError);
})();
-
-
-function TestMapConstructorIterableValue(ctor) {
- 'use strict';
- // Strict mode is required to prevent implicit wrapping in the getter.
- Object.defineProperty(Number.prototype, Symbol.iterator, {
- get: function() {
- assertEquals('object', typeof this);
- return function() {
- return oneAndTwo.entries();
- };
- },
- configurable: true
- });
-
- var map = new ctor(42);
- assertSize(2, map);
- assertEquals(1, map.get(k1));
- assertEquals(2, map.get(k2));
-
- delete Number.prototype[Symbol.iterator];
-}
-TestMapConstructorIterableValue(Map);
-TestMapConstructorIterableValue(WeakMap);
« 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