You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The err variable declared in lib/runner.js:137 will be overwritten by the one in :153 because those variables live in the same scope.
To mitigate this problem, I avoided creating a variable at all and refactored by inlining the object into the call to emit(), which is no less readable and slightly more efficient (avoids a variable assignment).
Sort of similarly, we can't re-scope a named parameter with var, as in lib/debug-helper.js:9. That line could be improved (and made slightly safer) by being changed to:
module.exports=function(logger){// other codelogger=typeoflogger!=='undefined' ? logger : console;`
// other code}
The text was updated successfully, but these errors were encountered:
The
err
variable declared inlib/runner.js:137
will be overwritten by the one in:153
because those variables live in the same scope.To mitigate this problem, I avoided creating a variable at all and refactored by inlining the object into the call to
emit()
, which is no less readable and slightly more efficient (avoids a variable assignment).Sort of similarly, we can't re-scope a named parameter with
var
, as inlib/debug-helper.js:9
. That line could be improved (and made slightly safer) by being changed to:The text was updated successfully, but these errors were encountered: