summaryrefslogtreecommitdiff
path: root/lib/internal/consoleFunc.js
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2017-04-04 16:37:38 -0700
committerAlexander Early <alexander.early@gmail.com>2017-04-04 16:37:38 -0700
commitb8a051b2e604f21346a39ae47ed34636a1038140 (patch)
tree8d7ea9d6436adf0502bc2fad3294bbf8c5654bfb /lib/internal/consoleFunc.js
parent53019a85063576c3aa7e48410d5f8018337f348e (diff)
downloadasync-b8a051b2e604f21346a39ae47ed34636a1038140.tar.gz
small fixes from review
Diffstat (limited to 'lib/internal/consoleFunc.js')
-rw-r--r--lib/internal/consoleFunc.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/internal/consoleFunc.js b/lib/internal/consoleFunc.js
index 92f7e86..eb2e886 100644
--- a/lib/internal/consoleFunc.js
+++ b/lib/internal/consoleFunc.js
@@ -5,20 +5,20 @@ import wrapAsync from './wrapAsync';
export default function consoleFunc(name) {
return function (fn/*, ...args*/) {
var args = slice(arguments, 1);
- wrapAsync(fn).apply(null, args.concat(function (err/*, ...args*/) {
+ args.push(function (err/*, ...args*/) {
var args = slice(arguments, 1);
if (typeof console === 'object') {
if (err) {
if (console.error) {
console.error(err);
}
- }
- else if (console[name]) {
+ } else if (console[name]) {
arrayEach(args, function (x) {
console[name](x);
});
}
}
- }));
+ })
+ wrapAsync(fn).apply(null, args);
};
}