Skip to content

Commit

Permalink
dns: avoid use of arguments
Browse files Browse the repository at this point in the history
PR-URL: #11359
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com
  • Loading branch information
jasnell authored and italoacasas committed Feb 22, 2017
1 parent 678ea11 commit 662b0c3
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 662b0c3

Please sign in to comment.