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:
1 parent
55be0885a6
commit
025794704a
2 files changed
+3
-4
No files matched your search
+1
-2
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user