Skip to content

Commit

Permalink
move some arguments.length access from loops
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jul 26, 2021
1 parent 89d7019 commit d78e4ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/core-js/internals/task.js
Expand Up @@ -49,8 +49,9 @@ var post = function (id) {
if (!set || !clear) {
set = function setImmediate(fn) {
var args = [];
var argumentsLength = arguments.length;
var i = 1;
while (arguments.length > i) args.push(arguments[i++]);
while (argumentsLength > i) args.push(arguments[i++]);
queue[++counter] = function () {
// eslint-disable-next-line no-new-func -- spec requirement
(typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
Expand Down
3 changes: 2 additions & 1 deletion packages/core-js/modules/esnext.map.merge.js
Expand Up @@ -12,8 +12,9 @@ $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
merge: function merge(iterable /* ...iterbles */) {
var map = anObject(this);
var setter = aFunction(map.set);
var argumentsLength = arguments.length;
var i = 0;
while (i < arguments.length) {
while (i < argumentsLength) {
iterate(arguments[i++], setter, { that: map, AS_ENTRIES: true });
}
return map;
Expand Down

0 comments on commit d78e4ed

Please sign in to comment.