Replace usage of arguments in arrow function

arguments is not available in arrow function so it is simpler to use rest
parameters.

issue11493
review419181003
This commit is contained in:
Cédric Krier committed 2022-05-31 23:49:22 +02:00
1 parent 55be0885a6
commit 025794704a
2 files changed
+3 -4

No files matched your search

+1 -2
View File
@@ -3975,8 +3975,7 @@
};
Sao.common.debounce = function(func, wait) {
return () => {
var args = [].slice(arguments);
return (...args) => {
clearTimeout(func._debounceTimeout);
func._debounceTimeout = setTimeout(() => {
func.apply(this, args);
+2 -2
View File
@@ -1965,11 +1965,11 @@
(attributes.states || {})).pre_validate || [];
prms.push(record.validate(fields, false, domain));
}
return jQuery.when.apply(jQuery, prms).then(() => {
return jQuery.when.apply(jQuery, prms).then((...args) => {
var record;
for (var i = 0; i < selected_records.length; i++) {
record = selected_records[i];
var result = arguments[i];
var result = args[i];
if (result) {
continue;
}