diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..80ff4d1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "iojs-v2" + - "iojs-v1" diff --git a/lib/stacktrace-parser.js b/lib/stacktrace-parser.js index 1453f95..5a3fc7a 100644 --- a/lib/stacktrace-parser.js +++ b/lib/stacktrace-parser.js @@ -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 = [], diff --git a/package.json b/package.json index e7e92b1..050a3de 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test/stacktrace_parser_test.js b/test/stacktrace_parser_test.js index 8696870..83b4299 100644 --- a/test/stacktrace_parser_test.js +++ b/test/stacktrace_parser_test.js @@ -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. (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: '', + 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.', + 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 } ] + }, ] };