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:
0bceaaa
)
Support of console.dir + console.assert
author
Jerome Etienne
<jerome.etienne@gmail.com>
Wed, 7 Jul 2010 09:58:33 +0000
(11:58 +0200)
committer
Ryan Dahl
<ry@tinyclouds.org>
Wed, 7 Jul 2010 14:48:59 +0000
(16:48 +0200)
src/node.js
patch
|
blob
|
history
diff --git
a/src/node.js
b/src/node.js
index
97b1f1b
..
2319527
100644
(file)
--- a/
src/node.js
+++ b/
src/node.js
@@
-220,6
+220,17
@@
global.console.warn = function () {
global.console.error = global.console.warn;
+global.console.dir = function(object){
+ var sys = module.requireNative('sys');
+ process.stdout.write(sys.inspect(object) + '\n');
+}
+
+global.console.assert = function(expression){
+ if(!expression){
+ var arr = Array.prototype.slice.call(arguments, 1);
+ process.assert(false, format.apply(this, arr));
+ }
+}
process.exit = function (code) {
process.emit("exit");