JS Error Stack contains incorrect line and column numbers in DOM handlers
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: louis.dellorto, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Steps to reproduce:
https://jsfiddle.net/krogjfud/
Throw an error within a DOM element handler. i.e.) a button's onclick, or the body tag's onload.
The sample provided above demonstrates an error that gets thrown within an onclick handler when clicking on the button "Click me to throw an error". The handler catches the error and prints the stack to the DOM so you can see the value easily.
Actual results:
The line and column numbers are always ":1:1" on the root cause of the stack trace.
Expected results:
The line and column numbers should represent the actual location of the function call. In the jsfiddle provided for instance, the line and column for the onclick handler should be ":106:39" (as it is in all other browsers).
Comment 1•5 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•4 years ago
|
Currently, we transport the line and column on a per-element basis. It would be possible to record it on a per-attribute basis.
Description
•