rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.37k stars 195 forks source link

Ensure object is an Immutable before calling merge on it #84

Closed ramivalta closed 8 years ago

ramivalta commented 8 years ago

Different approach to solve merge() getting called on empty objects. Passes tests this time. Ping @rtfeldman.

rtfeldman commented 8 years ago

@tiil I'm surprised this approach fixes https://github.com/rtfeldman/seamless-immutable/issues/82 - would you mind adding a test case to confirm that it's fixed?

ramivalta commented 8 years ago

@rtfeldman Sorry for not being responsive. This PR merely works around #82 by always turning currentValue into an Immutable before calling merge on it - it's not pretty but it doesn't break any tests unlike the previous attempt. I'll try to provide a test case soon.

rtfeldman commented 8 years ago

Thanks! :smiley:

davidkpiano commented 8 years ago

Extremely tiny nit: isMergeableObject :wink:

rtfeldman commented 8 years ago

Closing as stale; feel free to reopen if desired!