diff --git a/core/core.libraries.yml b/core/core.libraries.yml index 59660de8a0963a263bc84a871aebfe9be806d48a..6c1d31ac44d4a695f65cb4d2ebeb0298f14bfb99 100644 --- a/core/core.libraries.yml +++ b/core/core.libraries.yml @@ -666,3 +666,5 @@ js-cookie: gpl-compatible: true js: assets/vendor/js-cookie/js.cookie.min.js: {} + dependencies: + - core/drupal.object.assign diff --git a/core/misc/jquery.cookie.shim.es6.js b/core/misc/jquery.cookie.shim.es6.js index e0ac10fb473a226a7a3cef25fc90eecbadd66dd6..b6b925a10070e06f24115da563a09424a995e33b 100644 --- a/core/misc/jquery.cookie.shim.es6.js +++ b/core/misc/jquery.cookie.shim.es6.js @@ -120,7 +120,7 @@ if (value !== undefined && !isFunction(value)) { // The caller is setting a cookie value and not trying to retrieve the // cookie value using a converter callback. - const attributes = { ...$.cookie.defaults, ...options }; + const attributes = Object.assign($.cookie.defaults, options); if (!$.cookie.json) { // An object that is passed in must be typecast to a string when the @@ -201,7 +201,7 @@ Drupal.deprecationError({ message: `jQuery.removeCookie() ${deprecatedMessageSuffix}`, }); - cookies.remove(key, { ...$.cookie.defaults, ...options }); + cookies.remove(key, Object.assign($.cookie.defaults, options)); return !cookies.get(key); }; })(jQuery, Drupal, window.Cookies); diff --git a/core/misc/jquery.cookie.shim.js b/core/misc/jquery.cookie.shim.js index ed63a440a71a3abfe0bc7b01c2a852abf20fc6c9..29f98bca7944e7a3d3db08db203ab2f07b1d68f7 100644 --- a/core/misc/jquery.cookie.shim.js +++ b/core/misc/jquery.cookie.shim.js @@ -44,7 +44,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope }); if (value !== undefined && !isFunction(value)) { - var attributes = _objectSpread({}, $.cookie.defaults, {}, options); + var attributes = Object.assign($.cookie.defaults, options); if (!$.cookie.json) { value = String(value); @@ -79,7 +79,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope Drupal.deprecationError({ message: "jQuery.removeCookie() ".concat(deprecatedMessageSuffix) }); - cookies.remove(key, _objectSpread({}, $.cookie.defaults, {}, options)); + cookies.remove(key, Object.assign($.cookie.defaults, options)); return !cookies.get(key); }; })(jQuery, Drupal, window.Cookies); \ No newline at end of file