support falsy arguments in Object.assign polyfill (#2433)
* support falsy arguments in Object.assign polyfill * add tests for assign polyfill
This commit is contained in:
parent
dd6572579d
commit
10f0b4934a
3 changed files with 28 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
module.exports = Object.assign || function(target, source) {
|
||||
Object.keys(source).forEach(function(key) { target[key] = source[key] })
|
||||
if(source) Object.keys(source).forEach(function(key) { target[key] = source[key] })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue