Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 721e9cf

Browse files
cjihrigBethGriggs
authored andcommittedMay 10, 2019
lib: simplify several debug() calls
Avoid calling Array.prototype.join() in debug() calls. These are evaluated on every call, even if the debug() call is a no-op. This commit replaces the join() calls with the %j placeholder. PR-URL: #25241 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4427e5a commit 721e9cf

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
 

‎lib/internal/http2/core.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ function onOrigin(origins) {
470470
const session = this[kOwner];
471471
if (session.destroyed)
472472
return;
473-
debug(`Http2Session ${sessionName(session[kType])}: origin received: ` +
474-
`${origins.join(', ')}`);
473+
debug('Http2Session %s: origin received: %j',
474+
sessionName(session[kType]), origins);
475475
session[kUpdateTimer]();
476476
if (!session.encrypted || session.destroyed)
477477
return undefined;

‎lib/internal/modules/esm/create_dynamic_module.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ const ArrayJoin = Function.call.bind(Array.prototype.join);
66
const ArrayMap = Function.call.bind(Array.prototype.map);
77

88
const createDynamicModule = (exports, url = '', evaluate) => {
9-
debug(
10-
`creating ESM facade for ${url} with exports: ${ArrayJoin(exports, ', ')}`
11-
);
9+
debug('creating ESM facade for %s with exports: %j', url, exports);
1210
const names = ArrayMap(exports, (name) => `${name}`);
1311

1412
const source = `

0 commit comments

Comments
 (0)
Please sign in to comment.