Logged errors don't respect //# sourceURL=foo.js pragmas

NEW
Unassigned

Status

()

Firefox
Developer Tools: Console
--
enhancement
2 years ago
3 months ago

People

(Reporter: fitzgen, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [DocArea=JS][polish-backlog], URL)

Testcase: http://htmlpad.org/console-source-url/

Note that `console.log(foo)` does respect //# sourceURL but uncaught errors that get logged to the console do not.
Keywords: dev-doc-complete
Whiteboard: [DocArea=JS] → [DocArea=JS][polish-backlog]

Comment 1

3 months ago
Gentle ping, FF 51 would still fail to show the sourceURL file when the inlined script throws or logs and error, e.g.
<script>
var s;
s = document.createElement('script');
s.textContent = `x.y.z = a.b.c;\n//# sourceURL=script-0.js\n`;
document.body.appendChild(s);

s = document.createElement('script');
s.textContent = `x.y.z = a.b.c;\n//# sourceURL=script-1.js\n`;
document.body.appendChild(s);
</script>

^ does show in the console that there are 2 errors, but only shows script-0 in the stack (instead of considering them as separate errors coming from 2 files).
You need to log in before you can comment on or make changes to this bug.