Bug 239491
Summary: | Wrong column number in window.onerror handler in code with template literals | ||
---|---|---|---|
Product: | WebKit | Reporter: | Michal Polko <michal64128> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | webkit-bug-importer, ysuzuki |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | All | ||
OS: | All |
Michal Polko
Suppose we have the following JavaScript:
const a = `
query test {
field1
field2
field3
}
`;const b = f();
If there is an error during call to f() function, Safari reports correct row number (line 7), but the column number is wrong (column 100 does not exist on line 7) - it seems that line breaks inside the template literal are ignored when calculating the column number. Chrome and Firefox both correctly reports the error happened on column 13.
This issue breaks displaying stacktraces in Sentry if the source code contains template literals with line breaks.
Link to reproduction: https://benevolent-hotteok-d24077.netlify.app/
Reproduced in latest Safari Technology Preview (143) and also in Safari 14.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/92326939>
Yusuke Suzuki
Thanks for your report! It is fixed in bug 235607, which is not included in STP yet.
*** This bug has been marked as a duplicate of bug 235607 ***