Sebastian McKenzie cb54c11d84 add esnext tests
2015-01-04 07:39:11 +11:00

20 lines
358 B
JavaScript

function Symbol() {}
Symbol.iterator = '@@iterator';
var obj = {
'@@iterator': function() {
var ttl = 3;
return {
next: function() {
if (ttl === 0) {
return { done: true, value: null };
} else {
return { done: false, value: ttl-- };
}
}
};
}
};
assert.deepEqual([3, 2, 1], [...obj]);