GeezerVison is showing github.com — lib: replace sprintf-like format to template string literal by yosuke-furukawa · Pull Request #691 · nodejs/node
lib: replace sprintf-like format to template string literal
#691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement . We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from all commits
Commits
File filter
Filter by extension
.js
(7)
All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
lib: replace sprintf-like format to template string literal
Loading branch information
Uh oh!
There was an error while loading. Please reload this page.
commit ad28e0356a4094bc4c315327dd61fb82f3dd6177
There are no files selected for viewing
Original file line number
Diff line number
Diff line change
Expand Up
@@ -20,7 +20,7 @@ exports.start = function start() {
agent.listen(process._debugAPI.port, function() {
var addr = this.address();
process._rawDebug(' Debugger listening on port %d', addr.port);
process._rawDebug(` Debugger listening on port ${ addr.port}` );
process._debugAPI.notifyListen();
});
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -317,7 +317,7 @@ function connectionListener(socket) {
function socketOnData(d) {
assert(!socket._paused);
debug(' SERVER socketOnData %d', d .length);
debug(` SERVER socketOnData ${d .length}` );
var ret = parser.execute(d);
if (ret instanceof Error) {
debug('parse error');
Expand All
@@ -337,7 +337,7 @@ function connectionListener(socket) {
var eventName = req.method === 'CONNECT' ? 'connect' : 'upgrade';
if (EventEmitter.listenerCount(self, eventName) > 0) {
debug(' SERVER have listener for %s', eventName);
debug(` SERVER have listener for ${ eventName}` );
var bodyHead = d.slice(bytesParsed, d.length);
// TODO(isaacs): Need a way to reset a stream to fresh state
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -157,10 +157,10 @@ CryptoStream.prototype._write = function write(data, encoding, cb) {
// Write current buffer now
var written;
if (this === this.pair.cleartext) {
debug(' cleartext.write called with %d bytes', data.length);
debug(` cleartext.write called with ${ data.length} bytes` );
written = this.pair.ssl.clearIn(data, 0, data.length);
} else {
debug(' encrypted.write called with %d bytes', data.length);
debug(` encrypted.write called with ${ data.length} bytes` );
written = this.pair.ssl.encIn(data, 0, data.length);
}
Expand Down
Expand Up
@@ -215,9 +215,9 @@ CryptoStream.prototype._write = function write(data, encoding, cb) {
this._pendingCallback = cb;
if (this === this.pair.cleartext) {
debug(' cleartext.write queued with %d bytes', data.length);
debug(` cleartext.write queued with ${ data.length} bytes` );
} else {
debug(' encrypted.write queued with %d bytes', data.length);
debug(` encrypted.write queued with ${ data.length} bytes` );
}
};
Expand All
@@ -244,10 +244,10 @@ CryptoStream.prototype._read = function read(size) {
var out;
if (this === this.pair.cleartext) {
debug(' cleartext.read called with %d bytes', size );
debug(` cleartext.read called with ${size} bytes` );
out = this.pair.ssl.clearOut;
} else {
debug(' encrypted.read called with %d bytes', size );
debug(` encrypted.read called with ${size} bytes` );
out = this.pair.ssl.encOut;
}
Expand Down
Expand Up
@@ -282,9 +282,9 @@ CryptoStream.prototype._read = function read(size) {
assert(bytesRead >= 0);
if (this === this.pair.cleartext) {
debug(' cleartext.read succeed with %d bytes', bytesRead );
debug(` cleartext.read succeed with ${bytesRead} bytes` );
} else {
debug(' encrypted.read succeed with %d bytes', bytesRead );
debug(` encrypted.read succeed with ${bytesRead} bytes` );
}
// Try writing pending data
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -1265,10 +1265,8 @@ function spawnSync(/*file, args, options*/) {
else if (util.isString(input))
pipe.input = new Buffer(input, options.encoding);
else
throw new TypeError(util.format(
'stdio[%d] should be Buffer or string not %s',
i,
typeof input));
throw new TypeError(
`stdio[${i}] should be Buffer or string not ${typeof input}`);
}
}
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -158,9 +158,9 @@ EventEmitter.prototype.addListener = function addListener(type, listener) {
if (m && m > 0 && this._events[type].length > m) {
this._events[type].warned = true;
console.error('(node) warning: possible EventEmitter memory ' +
' leak detected. %d %s listeners added. ' +
'Use emitter.setMaxListeners() to increase limit.',
this._events[type].length, type );
` leak detected. ${this._events[type]} ${type} ` +
'listeners added. ' +
'Use emitter.setMaxListeners() to increase limit.' );
console.trace();
}
}
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -56,17 +56,17 @@ function listOnTimeout() {
var msecs = this.msecs;
var list = this;
debug(' timeout callback %d', msecs);
debug(` timeout callback ${ msecs}` );
var now = Timer.now();
debug('now: %s', now);
debug('now: ' + now);
var diff, first, threw;
while (first = L.peek(list)) {
diff = now - first._idleStart;
if (diff < msecs) {
list.start(msecs - diff, 0);
debug('%d list wait because diff is %d', msecs, diff);
debug(`${msecs} list wait because diff is ${ diff}` );
return;
} else {
L.remove(first);
Expand Down
Expand Up
@@ -107,7 +107,7 @@ function listOnTimeout() {
}
}
debug('%d list empty', msecs );
debug(`${msecs} list empty` );
assert(L.isEmpty(list));
list.close();
delete lists[msecs];
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -598,7 +598,7 @@ function timestamp() {
// log is just a thin wrapper to console.log that prepends a timestamp
exports.log = function() {
console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
console.log(`${ timestamp()} - ${ exports.format.apply(exports, arguments)}` );
};
Expand Down
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.