aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-02-25 00:24:24 +0200
committerJukka Jylänki <jujjyl@gmail.com>2014-02-25 00:24:24 +0200
commit5756f82b74c076dd0ce3226f0eb0e713f70d8915 (patch)
tree9e8e3aacb3f8bf685c0582449f942b09505a854a /src/library.js
parent11a75881530903c2e4e16e51664c70c2a5a397c5 (diff)
Fix emscripten_get_callstack to work on Firefox 30 after it implemented column information in callstack info. See https://bugzilla.mozilla.org/show_bug.cgi?id=762556 . Fixes test browser.test_emscripten_log on Firefox 30.
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/library.js b/src/library.js
index 91d5f925..485d5ee8 100644
--- a/src/library.js
+++ b/src/library.js
@@ -8941,7 +8941,8 @@ LibraryManager.library = {
// Process all lines:
lines = callstack.split('\n');
callstack = '';
- var firefoxRe = new RegExp('\\s*(.*?)@(.*):(.*)'); // Extract components of form ' Object._main@http://server.com:4324'
+ var newFirefoxRe = new RegExp('\\s*(.*?)@(.*?):([0-9]+):([0-9]+)'); // New FF30 with column info: extract components of form ' Object._main@http://server.com:4324:12'
+ var firefoxRe = new RegExp('\\s*(.*?)@(.*):(.*)(:(.*))?'); // Old FF without column info: extract components of form ' Object._main@http://server.com:4324'
var chromeRe = new RegExp('\\s*at (.*?) \\\((.*):(.*):(.*)\\\)'); // Extract components of form ' at Object._main (http://server.com/file.html:4324:12)'
for(l in lines) {
@@ -8959,12 +8960,13 @@ LibraryManager.library = {
lineno = parts[3];
column = parts[4];
} else {
- parts = firefoxRe.exec(line);
- if (parts && parts.length == 4) {
+ parts = newFirefoxRe.exec(line);
+ if (!parts) parts = firefoxRe.exec(line);
+ if (parts && parts.length >= 4) {
jsSymbolName = parts[1];
file = parts[2];
lineno = parts[3];
- column = 0; // Firefox doesn't carry column information. See https://bugzilla.mozilla.org/show_bug.cgi?id=762556
+ column = parts[4]|0; // Old Firefox doesn't carry column information, but in new FF30, it is present. See https://bugzilla.mozilla.org/show_bug.cgi?id=762556
} else {
// Was not able to extract this line for demangling/sourcemapping purposes. Output it as-is.
callstack += line + '\n';