Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup: move a statement
  • Loading branch information
BridgeAR committed Jul 18, 2017
commit 9b657aa60213c9a32bf985b7862a2ec16fde94d1
5 changes: 3 additions & 2 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ function message(key, args) {
assert.strictEqual(typeof key, 'string');
const msg = messages.get(key);
assert(msg, `An invalid error message key was used: ${key}.`);
if (util === null) util = require('util');
let fmt = util.format;
let fmt;
if (typeof msg === 'function') {
fmt = msg;
} else {
if (util === null) util = require('util');
fmt = util.format;
if (args === undefined || args.length === 0)
return msg;
args.unshift(msg);
Expand Down