Created
July 20, 2017 06:13
-
-
Save moonrailgun/c39b7e5eae080e35161b504818a2864d to your computer and use it in GitHub Desktop.
IE兼容性处理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object.assign for IE11 | |
if(!Object.assign) { | |
Object.assign = function(target) { | |
'use strict'; | |
if(target == null) { | |
throw new TypeError('Cannot convert undefined or null to object'); | |
} | |
target = Object(target); | |
for(var index = 1; index < arguments.length; index++) { | |
var source = arguments[index]; | |
if(source != null) { | |
for (var key in source) { | |
if (source.hasOwnProperty.call(source, key)) { | |
target[key] = source[key]; | |
} | |
} | |
} | |
} | |
return target; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment