Created
August 20, 2011 10:33
-
-
Save jay3sh/1158940 to your computer and use it in GitHub Desktop.
Revisions
-
Jayesh Salvi revised this gist
Aug 20, 2011 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,17 @@ function foo(args) { var i, j, k; // ... // j acquires some interesting value // Who called foo when j took this interesting value? // var e = new Error('dummy'); var stack = e.stack.replace(/^[^\(]+?[\n$]/gm, '') .replace(/^\s+at\s+/gm, '') .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') .split('\n'); console.log(stack); // ... // rest of the code } -
Jayesh Salvi created this gist
Aug 20, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ function foo(args) { var i, j, k; // ... // j acquires some interesting value // Who called foo when j took this interesting value? // var e = new Error('dummy'); var stack = e.stack.replace(/^[^\(]+?[\n$]/gm, '') .replace(/^\s+at\s+/gm, '') .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') .split('\n'); console.log(stack); }