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

Unified Diff: src/collection.js

Issue 466003002: ES6: Make Map/Set constructors support iterable values (Closed) Base URL: http://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 | « no previous file | src/weak_collection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/collection.js
diff --git a/src/collection.js b/src/collection.js
index 5e4421eb1072448a186f47eb85f909cb60bdf6bb..20887dd8f7adf5f4ae61c0919c8afbd09469e341 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -23,7 +23,7 @@ function SetConstructor(iterable) {
var iter, adder;
if (!IS_NULL_OR_UNDEFINED(iterable)) {
- iter = GetIterator(iterable);
+ iter = GetIterator(ToObject(iterable));
adder = this.add;
if (!IS_SPEC_FUNCTION(adder)) {
throw MakeTypeError('property_not_function', ['add', this]);
@@ -147,7 +147,7 @@ function MapConstructor(iterable) {
var iter, adder;
if (!IS_NULL_OR_UNDEFINED(iterable)) {
- iter = GetIterator(iterable);
+ iter = GetIterator(ToObject(iterable));
adder = this.set;
if (!IS_SPEC_FUNCTION(adder)) {
throw MakeTypeError('property_not_function', ['set', this]);
« no previous file with comments | « no previous file | src/weak_collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698