Zsolt Haraszti | 7baf38a | 2016-10-01 15:15:18 -0700 | [diff] [blame] | 1 | if (typeof Object.assign != 'function') { |
| 2 | (function () { |
| 3 | Object.assign = function (target) { |
| 4 | 'use strict'; |
| 5 | if (target === undefined || target === null) { |
| 6 | throw new TypeError('Cannot convert undefined or null to object'); |
| 7 | } |
| 8 | |
| 9 | var output = Object(target); |
| 10 | for (var index = 1; index < arguments.length; index++) { |
| 11 | var source = arguments[index]; |
| 12 | if (source !== undefined && source !== null) { |
| 13 | for (var nextKey in source) { |
| 14 | if (Object.prototype.hasOwnProperty.call(source, nextKey)) { |
| 15 | output[nextKey] = source[nextKey]; |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | return output; |
| 21 | }; |
| 22 | })(); |
| 23 | } |