-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: Handle custom error names in TraceKit #1237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
vendor/TraceKit/tracekit.js
Outdated
function computeStackTraceFromStackProp(ex) { | ||
if (typeof ex.stack === 'undefined' || !ex.stack) return; | ||
|
||
var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, | ||
gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i, | ||
gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource).*?:\/.*?|\[native code\]|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty sure blob
is blob:foo
and not blob://fo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blob is blob:http://url/for/some/endpoint
, which is matched by blob.*?:\/
:) We have a test for it in place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That depends on the browser. Current chrome adds the http origin to it, but blob:UUID
is perfectly permissible and shows up in Firefox for instance.
You can try with (URL.createObjectURL(new Blob([new Int8Array()]))).toString()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently blob urls are now supposed to always have an origin. Since they are rare I might be okay with that but please add a comment why blob is okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added appropriate note and reformatted variables slightly so it's easier to move around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also made it two separate commits so it's easier to track precise changes
14489ea
to
1cc1915
Compare
1cc1915
to
845c83b
Compare
Fixes #1209 (comment)