Skip to content

Commit

Permalink
SM: Error.stackTraceLimit hack
Browse files Browse the repository at this point in the history
  • Loading branch information
ktrzeciaknubisa authored and obastemur committed Dec 19, 2015
1 parent d61371b commit c2f650e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,17 @@

function New_Error(cons, args) {
function tmp() {
var old = null;
if (Error.stackTraceLimit || Error.stackTraceLimit === 0) {
old = Error.stackTraceLimit;
Error.stackTraceLimit += 3;
}
var err = cons.apply(this, args);
Error.captureStackTrace(err);

if (old !== null)
Error.stackTraceLimit = old;

err.fileName = err.stack[3]._fileName;
err.lineNumber = err.stack[3]._lineNumber;
err.columnNumber = err.stack[3]._columnNumber;
Expand Down

0 comments on commit c2f650e

Please sign in to comment.