Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jeromeetienne/506529 to your computer and use it in GitHub Desktop.
Save jeromeetienne/506529 to your computer and use it in GitHub Desktop.
[PATCH] Support of console.trace()
From a66f80208c56e6677073965ca799763958d514ff Mon Sep 17 00:00:00 2001
From: Jerome Etienne <[email protected]>
Date: Tue, 3 Aug 2010 17:08:02 +0200
Subject: [PATCH] Support of console.trace()
---
src/node.js | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/node.js b/src/node.js
index 6d60113..dfa1ad5 100644
--- a/src/node.js
+++ b/src/node.js
@@ -231,6 +231,11 @@ global.console.assert = function(expression){
}
}
+global.console.trace = function(){
+ var msg = (new Error()).stack.split("\n").slice(2).join("\n");
+ writeError(msg+'\n');
+}
+
global.Buffer = module.requireNative('buffer').Buffer;
process.debug = global.v8debug.Debug;
--
1.7.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment