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]); |