diff options
| author | Johann-S <[email protected]> | 2018-06-11 22:25:37 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-02-20 22:05:45 +0200 |
| commit | 4510e7e61db27b264c1fadc125beb2d4c80f07df (patch) | |
| tree | a29d16a23ffff6732423f16e07cfb64782b081f5 /js/src/dom | |
| parent | b4a3b00ac8635b51b6216f540ac59219432c0d65 (diff) | |
| download | bootstrap-4510e7e61db27b264c1fadc125beb2d4c80f07df.tar.xz bootstrap-4510e7e61db27b264c1fadc125beb2d4c80f07df.zip | |
fix(util): remove extend
Diffstat (limited to 'js/src/dom')
| -rw-r--r-- | js/src/dom/eventHandler.js | 2 | ||||
| -rw-r--r-- | js/src/dom/polyfill.js | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/js/src/dom/eventHandler.js b/js/src/dom/eventHandler.js index 25248fb92..95bafe4ed 100644 --- a/js/src/dom/eventHandler.js +++ b/js/src/dom/eventHandler.js @@ -281,7 +281,7 @@ const EventHandler = (() => { // merge custom informations in our event if (typeof args !== 'undefined') { - evt = Util.extend(evt, args) + evt = Object.assign(evt, args) } if (defaultPrevented) { diff --git a/js/src/dom/polyfill.js b/js/src/dom/polyfill.js index 159884df8..c0c1139f0 100644 --- a/js/src/dom/polyfill.js +++ b/js/src/dom/polyfill.js @@ -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', |
