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

Unified Diff: src/weak_collection.js

Issue 464093002: 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/ic.cc ('k') | test/mjsunit/es6/collections.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/weak_collection.js
diff --git a/src/weak_collection.js b/src/weak_collection.js
index 73dd9de6ba9aa5c48d16596ffde2c015e1764673..1160176d66f6c34b8cf8acb59d0841d832055aae 100644
--- a/src/weak_collection.js
+++ b/src/weak_collection.js
@@ -23,7 +23,7 @@ function WeakMapConstructor(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]);
@@ -139,7 +139,7 @@ function WeakSetConstructor(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]);
« no previous file with comments | « src/ic.cc ('k') | test/mjsunit/es6/collections.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698