mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 04:09:08 +02:00
Replace [...set] with Array.from(set) (#9260)
This commit is contained in:
parent
9db3680440
commit
dc373f3aaa
@ -276,7 +276,7 @@ export default class Config {
|
||||
keys.forEach(key => addIfFound(scopes, descriptors, key));
|
||||
});
|
||||
|
||||
const array = [...scopes];
|
||||
const array = Array.from(scopes);
|
||||
if (keysCached.has(keyLists)) {
|
||||
cache.set(keyLists, array);
|
||||
}
|
||||
|
@ -154,9 +154,5 @@ export function _arrayUnique(items) {
|
||||
return items;
|
||||
}
|
||||
|
||||
const result = [];
|
||||
set.forEach(item => {
|
||||
result.push(item);
|
||||
});
|
||||
return result;
|
||||
return Array.from(set);
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ function _resolveScriptable(prop, value, target, receiver) {
|
||||
const {_proxy, _context, _subProxy, _stack} = target;
|
||||
if (_stack.has(prop)) {
|
||||
// @ts-ignore
|
||||
throw new Error('Recursion detected: ' + [..._stack].join('->') + '->' + prop);
|
||||
throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);
|
||||
}
|
||||
_stack.add(prop);
|
||||
value = value(_context, _subProxy || receiver);
|
||||
@ -290,7 +290,7 @@ function createSubResolver(parentScopes, resolver, prop, value) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return _createResolver([...set], [''], rootScopes, fallback,
|
||||
return _createResolver(Array.from(set), [''], rootScopes, fallback,
|
||||
() => subGetTarget(resolver, prop, value));
|
||||
}
|
||||
|
||||
@ -353,5 +353,5 @@ function resolveKeysFromAllScopes(scopes) {
|
||||
set.add(key);
|
||||
}
|
||||
}
|
||||
return [...set];
|
||||
return Array.from(set);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user