-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Description
collections breaks Array.from with Iterables. This can be reproduced with the following code:
var obj = {};
obj[Symbol.iterator] = function() {
var values = ['foo', 'bar'];
return {
next: function() {
var done = values.length === 0;
var value = done ? undefined : values.shift();
return {
value: value,
done: done
};
}
};
};
console.log('before collections load:', Array.from(obj));
require('collections/sorted-map');
console.log('after collections load:', Array.from(obj));Output:
$ node test.js
before collections load: [ 'foo', 'bar' ]
after collections load: []Environment:
collections v5.0.6
node v4.4.7
Mac OS X 10.12.2
a-x-, mnespor, IAmJulianAcosta, sergey-shevchuk and jameshadfield