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:
Daniel Loomer 2019-06-15 22:48:24 -04:00 committed by Isiah Meadows
parent dd6572579d
commit 10f0b4934a
3 changed files with 28 additions and 1 deletions

View file

@ -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] })
}