Skip to content

Commit

Permalink
Merge pull request #2 from ide/iojs
Browse files Browse the repository at this point in the history
Support and test cases for io.js
  • Loading branch information
Calamari committed Jul 28, 2015
2 parents 49c879d + 6f9aa3e commit bcff42f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "iojs-v2"
- "iojs-v1"
2 changes: 1 addition & 1 deletion lib/stacktrace-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var StackTraceParser = {
*/
parse: function(stackString) {
var chrome = /^\s*at (?:(?:(?:Anonymous function)?|((?:\[object object\])?\S+(?: \[as \S+\])?)) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
gecko = /^(?:\s*(\S*)(?:\((.*?)\))?@)?((?:\w).*?):(\d+)(?::(\d+))?\s*$/i,
gecko = /^(?:\s*(\S*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i,
node = /^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i,
lines = stackString.split('\n'),
stack = [],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Parses every stack trace into a nicely formatted array of hashes.",
"version": "0.1.1",
"engines": {
"node": "~0.10"
"node": "0.10 - 2"
},
"dependencies": {},
"devDependencies": {
Expand Down
48 changes: 47 additions & 1 deletion test/stacktrace_parser_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,53 @@ describe('StackTraceParser', function() {
methodName: 'Timer.listOnTimeout [as ontimeout]',
lineNumber: 110,
column: 15 } ]
}
},
],
'io.js': [
// io.js 2.4.0
{
from: "ReferenceError: test is not defined\n at repl:1:1\n at REPLServer.defaultEval (repl.js:154:27)\n at bound (domain.js:254:14)\n at REPLServer.runBound [as eval] (domain.js:267:12)\n at REPLServer.<anonymous> (repl.js:308:12)\n at emitOne (events.js:77:13)\n at REPLServer.emit (events.js:169:7)\n at REPLServer.Interface._onLine (readline.js:210:10)\n at REPLServer.Interface._line (readline.js:549:8)\n at REPLServer.Interface._ttyWrite (readline.js:826:14)",
to: [ { file: 'repl',
methodName: '<unknown>',
lineNumber: 1,
column: 1 },
{ file: 'repl.js',
methodName: 'REPLServer.defaultEval',
lineNumber: 154,
column: 27 },
{ file: 'domain.js',
methodName: 'bound',
lineNumber: 254,
column: 14 },
{ file: 'domain.js',
methodName: 'REPLServer.runBound [as eval]',
lineNumber: 267,
column: 12 },
{ file: 'repl.js',
methodName: 'REPLServer.<anonymous>',
lineNumber: 308,
column: 12 },
{ file: 'events.js',
methodName: 'emitOne',
lineNumber: 77,
column: 13 },
{ file: 'events.js',
methodName: 'REPLServer.emit',
lineNumber: 169,
column: 7 },
{ file: 'readline.js',
methodName: 'REPLServer.Interface._onLine',
lineNumber: 210,
column: 10 },
{ file: 'readline.js',
methodName: 'REPLServer.Interface._line',
lineNumber: 549,
column: 8 },
{ file: 'readline.js',
methodName: 'REPLServer.Interface._ttyWrite',
lineNumber: 826,
column: 14 } ]
},
]
};

Expand Down

0 comments on commit bcff42f

Please sign in to comment.