diff --git a/core/.eslintrc.passing.json b/core/.eslintrc.passing.json index 05bd17608712c95ba9f7eaf28e5560e55ef6e635..db5f24e49d9c93c37121e0e1405fc87687bcd5d8 100644 --- a/core/.eslintrc.passing.json +++ b/core/.eslintrc.passing.json @@ -12,7 +12,6 @@ "new-cap": "off", "max-len": "off", "default-case": "off", - "camelcase": "off", - "prefer-rest-params": "off" + "camelcase": "off" } } diff --git a/core/misc/debounce.es6.js b/core/misc/debounce.es6.js index 56ba0db681608ce0ece8be4211932fd25a6d5c82..e77940b9efa3883f82032f007e8b55a88ba2ee29 100644 --- a/core/misc/debounce.es6.js +++ b/core/misc/debounce.es6.js @@ -29,9 +29,8 @@ Drupal.debounce = function (func, wait, immediate) { let timeout; let result; - return function () { + return function (...args) { const context = this; - const args = arguments; const later = function () { timeout = null; if (!immediate) { diff --git a/core/misc/debounce.js b/core/misc/debounce.js index b6bb5d08c26917ff1dd0ae9353e951eee21c6d98..c2cfe9abe0e9dcbb58eb323d67313b61ae2e8bf2 100644 --- a/core/misc/debounce.js +++ b/core/misc/debounce.js @@ -9,8 +9,11 @@ Drupal.debounce = function (func, wait, immediate) { var timeout = void 0; var result = void 0; return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var context = this; - var args = arguments; var later = function later() { timeout = null; if (!immediate) { diff --git a/core/misc/dialog/dialog.ajax.es6.js b/core/misc/dialog/dialog.ajax.es6.js index 798673a1d86c4990be33da05d846b114d246ddc2..a6f2e71ce70e271bbbbecd3fca90a7ad61bcdbfc 100644 --- a/core/misc/dialog/dialog.ajax.es6.js +++ b/core/misc/dialog/dialog.ajax.es6.js @@ -42,8 +42,8 @@ const originalClose = settings.dialog.close; // Overwrite the close method to remove the dialog on closing. - settings.dialog.close = function (event) { - originalClose.apply(settings.dialog, arguments); + settings.dialog.close = function (event, ...args) { + originalClose.apply(settings.dialog, [event, ...args]); $(event.target).remove(); }; }, diff --git a/core/misc/dialog/dialog.ajax.js b/core/misc/dialog/dialog.ajax.js index 8277df3e51b2263577a97e2ca4112ae4e5139791..de1d3c921977e8460cc2a114046f29fd0ce8a889 100644 --- a/core/misc/dialog/dialog.ajax.js +++ b/core/misc/dialog/dialog.ajax.js @@ -26,7 +26,11 @@ var originalClose = settings.dialog.close; settings.dialog.close = function (event) { - originalClose.apply(settings.dialog, arguments); + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + originalClose.apply(settings.dialog, [event].concat(args)); $(event.target).remove(); }; }, diff --git a/core/misc/drupal.es6.js b/core/misc/drupal.es6.js index e64f9dac0dd182e337381c6c177b04739b69cc92..43a78f9f71f959d8e8a6dd62a45fac90d8fd43dc 100644 --- a/core/misc/drupal.es6.js +++ b/core/misc/drupal.es6.js @@ -559,10 +559,9 @@ window.Drupal = { behaviors: {}, locale: {} }; * Any data the theme function returns. This could be a plain HTML string, * but also a complex object. */ - Drupal.theme = function (func) { - const args = Array.prototype.slice.apply(arguments, [1]); + Drupal.theme = function (func, ...args) { if (func in Drupal.theme) { - return Drupal.theme[func].apply(this, args); + return Drupal.theme[func](...args); } }; diff --git a/core/misc/drupal.js b/core/misc/drupal.js index a00d8ce548357cc159970bff8346d1db19a102c1..0ede48da607ba15e0a9e8da9d79d1441738160d8 100644 --- a/core/misc/drupal.js +++ b/core/misc/drupal.js @@ -181,9 +181,14 @@ window.Drupal = { behaviors: {}, locale: {} }; }; Drupal.theme = function (func) { - var args = Array.prototype.slice.apply(arguments, [1]); if (func in Drupal.theme) { - return Drupal.theme[func].apply(this, args); + var _Drupal$theme; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return (_Drupal$theme = Drupal.theme)[func].apply(_Drupal$theme, args); } };