Skip to content

Commit 0878f6b

Browse files
Update main.js
Signed-off-by: Suyash Pathak <[email protected]>
1 parent 9f8fca9 commit 0878f6b

File tree

1 file changed

+7
-6
lines changed
  • lib/node_modules/@stdlib/utils/async/while/lib

1 file changed

+7
-6
lines changed

lib/node_modules/@stdlib/utils/async/while/lib/main.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,13 @@ function whileAsync( predicate, fcn, done, thisArg ) {
111111
idx += 1;
112112

113113
// Cache the most recent results...
114-
if ( arguments.length > 1 ) {
115-
args = new Array( arguments.length-1 );
116-
for ( i = 1; i < arguments.length; i++ ) {
117-
args[ i-1 ] = arguments[ i ];
118-
}
119-
}
114+
if ( arguments.length > 1 ) {
115+
args = [];
116+
for ( i = 1; i < arguments.length; i++ ) {
117+
args.push( arguments[ i ] );
118+
}
119+
}
120+
120121
// Run the test condition:
121122
predicate( idx, onPredicate );
122123
}

0 commit comments

Comments
 (0)