expected fileName is "http://localhost:5000/misc/@stuff/foo.js"
actual fileName is "stuff/foo.js"
Description
Calling .split('@') on the stackframe string split it into an arbitrary number of chunks depending on whether there was an @ in the URL or in the method name.
I created a rather gnarly looking regex (after exhausting other options) to extract everything after the first @, unless it was preceded by something like obj["@method"], in which case it will extract everything after the first @ preceded by the enclosing quotes.
Motivation and Context
We're using this module on bugsnag-js and a customer of ours reported an issue with errors coming from URLs containing @ but only in Firefox.
How Has This Been Tested?
Cases have been added to the automated test suite.
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] node_modules/.bin/jscs -c .jscsrc error-stack-parser.js passes without errors
When the URL path of a stackframe contains
@
, theparseFFOrSafari()
function returns an incompletefileName
value.e.g. given the string:
"who@http://localhost:5000/misc/@stuff/foo.js:3:9"
expected
fileName
is"http://localhost:5000/misc/@stuff/foo.js"
actualfileName
is"stuff/foo.js"
Description
Calling
.split('@')
on the stackframe string split it into an arbitrary number of chunks depending on whether there was an@
in the URL or in the method name.I created a rather gnarly looking regex (after exhausting other options) to extract everything after the first
@
, unless it was preceded by something likeobj["@method"]
, in which case it will extract everything after the first@
preceded by the enclosing quotes.Motivation and Context
We're using this module on bugsnag-js and a customer of ours reported an issue with errors coming from URLs containing
@
but only in Firefox.How Has This Been Tested?
Cases have been added to the automated test suite.
Types of changes
Checklist:
node_modules/.bin/jscs -c .jscsrc error-stack-parser.js
passes without errorsnpm test
passes without errors