diff --git a/src/file.js b/src/file.js index 4098411763..028a3b9803 100644 --- a/src/file.js +++ b/src/file.js @@ -131,3 +131,7 @@ stdin.fd = File.STDIN_FILENO; this.puts = function (data, callback) { stdout.puts(data, callback); } + +this.p = function (data, callback) { + puts(JSON.stringify(data), callback); +} diff --git a/test/test_http.js b/test/test_http.js index 9445a13b08..58d5c86061 100644 --- a/test/test_http.js +++ b/test/test_http.js @@ -1,4 +1,4 @@ -puts(JSON.stringify({hello: "world"})); +p({hello: "world"}); new node.http.Server(function (msg) { setTimeout(function () { msg.sendHeader(200, [["Content-Type", "text/plain"]]);