Skip to content

Commit

Permalink
dns: avoid use of arguments
Browse files Browse the repository at this point in the history
PR-URL: nodejs#11359
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]
  • Loading branch information
jasnell authored and italoacasas committed Feb 16, 2017
1 parent bcc8111 commit 8e2fbde
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,12 @@ function errnoException(err, syscall, hostname) {
// callback.immediately = true;
// }
function makeAsync(callback) {
return function asyncCallback() {
return function asyncCallback(...args) {
if (asyncCallback.immediately) {
// The API already returned, we can invoke the callback immediately.
callback.apply(null, arguments);
callback.apply(null, args);
} else {
var args = new Array(arguments.length + 1);
args[0] = callback;
for (var i = 0; i < arguments.length; ++i)
args[i + 1] = arguments[i];
args.unshift(callback);
process.nextTick.apply(null, args);
}
};
Expand Down

0 comments on commit 8e2fbde

Please sign in to comment.