var iter, adder;
if (!IS_NULL_OR_UNDEFINED(iterable)) {
- iter = GetIterator(ToObject(iterable));
+ iter = GetIterator(iterable);
adder = this.add;
if (!IS_SPEC_FUNCTION(adder)) {
throw MakeTypeError('property_not_function', ['add', this]);
var iter, adder;
if (!IS_NULL_OR_UNDEFINED(iterable)) {
- iter = GetIterator(ToObject(iterable));
+ iter = GetIterator(iterable);
adder = this.set;
if (!IS_SPEC_FUNCTION(adder)) {
throw MakeTypeError('property_not_function', ['set', this]);
// ----------------------------------------------------------------------------
// Iterator related spec functions.
-// ES6 rev 26, 2014-07-18
-// 7.4.1 CheckIterable ( obj )
-function ToIterable(obj) {
- if (!IS_SPEC_OBJECT(obj)) {
- return UNDEFINED;
- }
- return obj[symbolIterator];
-}
-
-
-// ES6 rev 26, 2014-07-18
-// 7.4.2 GetIterator ( obj, method )
+// ES6 rev 33, 2015-02-12
+// 7.4.1 GetIterator ( obj, method )
function GetIterator(obj, method) {
if (IS_UNDEFINED(method)) {
- method = ToIterable(obj);
+ method = ToObject(obj)[symbolIterator];
}
if (!IS_SPEC_FUNCTION(method)) {
throw MakeTypeError('not_iterable', [obj]);
var iter, adder;
if (!IS_NULL_OR_UNDEFINED(iterable)) {
- iter = GetIterator(ToObject(iterable));
+ iter = GetIterator(iterable);
adder = this.set;
if (!IS_SPEC_FUNCTION(adder)) {
throw MakeTypeError('property_not_function', ['set', this]);
var iter, adder;
if (!IS_NULL_OR_UNDEFINED(iterable)) {
- iter = GetIterator(ToObject(iterable));
+ iter = GetIterator(iterable);
adder = this.add;
if (!IS_SPEC_FUNCTION(adder)) {
throw MakeTypeError('property_not_function', ['add', this]);
get: function() {
assertEquals('object', typeof this);
return function() {
+ assertEquals('number', typeof this);
return oneAndTwo.keys();
};
},
get: function() {
assertEquals('object', typeof this);
return function() {
+ assertEquals('number', typeof this);
return oneAndTwo.entries();
};
},