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

Unified Diff: test/mjsunit/harmony/array-from.js

Issue 856303002: Don't take iterable path in ArrayFrom if items[@@iterator] is null (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
« src/v8natives.js ('K') | « src/v8natives.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/array-from.js
diff --git a/test/mjsunit/harmony/array-from.js b/test/mjsunit/harmony/array-from.js
index e8dde163fc227bb21bdeaab6d14ff944cec65b96..5d651ea6984096230ebe088cceec3d6e3bfd2c33 100644
--- a/test/mjsunit/harmony/array-from.js
+++ b/test/mjsunit/harmony/array-from.js
@@ -91,21 +91,23 @@ function testArrayFrom(thisArg, constructor) {
return x.toUpperCase();
}), ['T', 'E', 'S', 'T'], constructor);
- this.thisArg = thisArg;
- assertThrows('Array.from.call(thisArg, null)', TypeError);
- assertThrows('Array.from.call(thisArg, undefined)', TypeError);
- assertThrows('Array.from.call(thisArg, [], null)', TypeError);
- assertThrows('Array.from.call(thisArg, [], "noncallable")', TypeError);
+ assertThrows(function() { Array.from.call(thisArg, null); }, TypeError);
+ assertThrows(function() { Array.from.call(thisArg, undefined); }, TypeError);
+ assertThrows(function() { Array.from.call(thisArg, [], null); }, TypeError);
+ assertThrows(function() { Array.from.call(thisArg, [], "noncallable"); },
+ TypeError);
- this.nullIterator = {};
+ var nullIterator = {};
nullIterator[Symbol.iterator] = null;
- assertThrows('Array.from.call(thisArg, nullIterator)', TypeError);
+ assertArrayLikeEquals(Array.from.call(thisArg, nullIterator), [],
+ constructor);
- this.nonObjIterator = {};
+ var nonObjIterator = {};
nonObjIterator[Symbol.iterator] = function() { return "nonObject"; };
- assertThrows('Array.from.call(thisArg, nonObjIterator)', TypeError);
+ assertThrows(function() { Array.from.call(thisArg, nonObjIterator); },
+ TypeError);
- assertThrows('Array.from.call(thisArg, [], null)', TypeError);
+ assertThrows(function() { Array.from.call(thisArg, [], null); }, TypeError);
}
function Other() {}
« src/v8natives.js ('K') | « src/v8natives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698