justmoon / node-extend

Simple function to extend objects
MIT License
341 stars 68 forks source link

Add a Note about ES6 Object.assign now present in Node.js >= 4 #37

Closed madarche closed 8 years ago

madarche commented 8 years ago

Since Node.js >= 4, Object.assign now offers the same functionality natively. See ECMAScript 2015 (ES6) in Node.js

ljharb commented 8 years ago

According to my https://www.npmjs.com/package/object.assign tests, node 4 has 9 test failures, and node 5 has 8. Native support isn't the same thing as compliant native support.

This note should indicate a) that Object.assign does not offer "deep extend" functionality, and that b) the native implementations of Object.assign in both node and many browsers (since npm modules are for the browser too) are not fully spec-compliant. It'd be nice to also point at the object.assign module for a compliant replacement.

madarche commented 8 years ago

Thanks very much @ljharb I'll modify the PR. Object.assign in Node.js is working for my usages, I haven't done a compliant native support full review.

ljharb commented 8 years ago

(as to the test failures, a rebase on the latest master will fix those, they're obviously unrelated to this PR)

madarche commented 8 years ago

Please @ljharb what do you think of this PR now?

ljharb commented 8 years ago

@madarche Thanks! If you could condense these down to 1 commit I'll merge it straight away

madarche commented 8 years ago

@ljharb done as you requested