mirror of https://github.com/nodejs/node.git
console.log: if not string, coerce into one
parent
5aadeae888
commit
6b430a95c9
|
@ -194,7 +194,7 @@ process.openStdin = function () {
|
|||
function format (f) {
|
||||
var i = 1;
|
||||
var args = arguments;
|
||||
if (!(f instanceof String)) return f;
|
||||
if (!(f instanceof String)) f = String(f);
|
||||
return f.replace(/%([sdf])/g, function (x) {
|
||||
switch (x) {
|
||||
case '%s': return args[i++];
|
||||
|
|
Loading…
Reference in New Issue