dillon1000/react
Commit
Browse files Use Object.assign in merge/mergeInto
Relax the argument type checks. Currently we throw for non-objects and terminals but Object.assign does a coercion to Object instead. It also allows merging Arrays as if they are objects. This also relaxes the check for dependents such as ImmutableObject. This sucks but it will allow us to use a fast code path to native Object.assign. We always have the option of adding warnings to Object.assign or static type checks. I'm keeping the null check. Object.assign throws for null checks. We'll also start returning the result of coercions just like Object.assign.
Changed paths3 files
First-parent comparisonsrc/utils/__tests__/LegacyImmutableObject-test.js ModifiedM src/vendor/core/merge.js ModifiedM src/vendor/core/mergeInto.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…