applitopia / immutable-sorted

This is an extension of Immutable.js that provides sorted collections SortedMap and SortedSet. The current implementation is using highly optimized B-tree memory structure.
http://applitopia.github.io/immutable-sorted/
Other
29 stars 6 forks source link

Error when using `new` operator with SortedSet #3

Closed abonander closed 6 years ago

abonander commented 6 years ago

If one constructs a SortedSet with new SortedSet(), an error occurs, likely due to this line since this instanceof SortedSet will return true but the inner map isn't initialized so it can't provide a comparator.

It appears to be an Immutable.js convention to not use the new operator but the Immutable.js types also don't break when using the new operator so SortedMap and SortedSet shouldn't either. (SortedMap appears to not suffer from this problem, though.)

applitopia commented 6 years ago

Thank you for your fix, it has been merged and published to npm as immutable-sorted@0.2.5