diff --git a/src/core/core.config.js b/src/core/core.config.js index e57fa28864f..ff97d5f7572 100644 --- a/src/core/core.config.js +++ b/src/core/core.config.js @@ -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); } diff --git a/src/helpers/helpers.collection.js b/src/helpers/helpers.collection.js index 66f2a557b07..7280117afc8 100644 --- a/src/helpers/helpers.collection.js +++ b/src/helpers/helpers.collection.js @@ -154,9 +154,5 @@ export function _arrayUnique(items) { return items; } - const result = []; - set.forEach(item => { - result.push(item); - }); - return result; + return Array.from(set); } diff --git a/src/helpers/helpers.config.js b/src/helpers/helpers.config.js index a3625984daa..ce78ec68fa9 100644 --- a/src/helpers/helpers.config.js +++ b/src/helpers/helpers.config.js @@ -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); }