projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfde465
)
Add p() like in Ruby.
author
Ryan
<ry@tinyclouds.org>
Thu, 14 May 2009 16:37:53 +0000
(18:37 +0200)
committer
Ryan
<ry@tinyclouds.org>
Thu, 14 May 2009 16:37:53 +0000
(18:37 +0200)
src/file.js
patch
|
blob
|
history
test/test_http.js
patch
|
blob
|
history
diff --git
a/src/file.js
b/src/file.js
index
4098411
..
028a3b9
100644
(file)
--- 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
9445a13
..
58d5c86
100644
(file)
--- a/
test/test_http.js
+++ b/
test/test_http.js
@@
-1,4
+1,4
@@
-p
uts(JSON.stringify({hello: "world"})
);
+p
({hello: "world"}
);
new node.http.Server(function (msg) {
setTimeout(function () {
msg.sendHeader(200, [["Content-Type", "text/plain"]]);