1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-28 14:29:07 +02:00

fix(util): remove extend

This commit is contained in:
Johann-S
2018-06-11 22:25:37 +02:00
committed by XhmikosR
parent b4a3b00ac8
commit 4510e7e61d
3 changed files with 28 additions and 23 deletions

View File

@@ -155,6 +155,33 @@ const Polyfill = (() => {
}
}
if (typeof Object.assign !== 'function') {
Object.defineProperty(Object, 'assign', {
value: (target, ...args) => {
if (target === null || typeof target === 'undefined') {
throw new TypeError('Cannot convert undefined or null to object')
}
const to = Object(target)
for (let index = 1; index < args.length; index++) {
const nextSource = args[index]
if (nextSource !== null || !nextSource) {
for (const nextKey in nextSource) {
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey]
}
}
}
}
return to
},
writable: true,
configurable: true
})
}
return {
defaultPreventedPreservedOnDispatch,
focusIn: typeof window.onfocusin === 'undefined',