Permalink
Browse files

Merge pull request #5 from Heyride/master

Fix for issue #4
  • Loading branch information...
2 parents 9469f92 + ff1c27f commit 08ad65482c4ab01a840e8b2a6041d3d010e06943 @chrisdickinson committed Mar 15, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 trace.js
View
@@ -66,7 +66,8 @@ Color.stack = [colors.off];
var err_re1 = / at (.*?) \(([\w\d\._\-\/]+):(\d+):(\d+)\)/,
- err_re2 = / at ([^:]+):(\d+):(\d+)/;
+ err_re2 = / at ([^:]+):(\d+):(\d+)/,
+ err_re3 = / at (.*?) \(native\)/;
var Trace = function(first_line, frames, original_error) {
this.first_line = first_line;
@@ -211,11 +212,14 @@ var trace = function trace(err) {
frames = stack.map(function(line) {
match1 = err_re1.exec(line);
match2 = err_re2.exec(line);
+ match3 = err_re3.exec(line);
if(match1) {
return new Frame(match1[1], match1[2], parseInt(match1[3], 10), parseInt(match1[4], 10))
} else if(match2) {
return new Frame('<anonymous>', match2[1], parseInt(match2[2], 10), parseInt(match2[3], 10))
+ } else if(match3) {
+ return new Frame(match3[1], 'native');
}
});

0 comments on commit 08ad654

Please sign in to comment.