diff options
Diffstat (limited to 'js/dist/dom/manipulator.js')
-rw-r--r-- | js/dist/dom/manipulator.js | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/js/dist/dom/manipulator.js b/js/dist/dom/manipulator.js index 6ce9bc46c0..3c049e9e47 100644 --- a/js/dist/dom/manipulator.js +++ b/js/dist/dom/manipulator.js @@ -24,20 +24,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(source, true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(source).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -87,7 +102,7 @@ return {}; } - var attributes = _objectSpread({}, element.dataset); + var attributes = _objectSpread2({}, element.dataset); Object.keys(attributes).forEach(function (key) { attributes[key] = normalizeData(attributes[key]); |