[Webkit-unassigned] [Bug 221548] New: comment blocks cause incorrect reporting of column numbers in stack traces

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 8 05:55:34 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=221548

            Bug ID: 221548
           Summary: comment blocks cause incorrect reporting of column
                    numbers in stack traces
           Product: WebKit
           Version: Safari 14
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: dan at atomx.io

Consider this JavaScript executing on a webpage, imported as an external script file:

window.onload = () => {
  console.log('something unrelated');const e = new Error("new error");console.log(e.stack);console.log('something unrelated');
}

The output of `console.log(e.stack)` in the Safari console is: http://127.0.0.1:8081/build/main.js:2:57

Note the column number. 57 is between the "r" and the "(" in new Error("new error"). This looks good.

Now consider this:

window.onload = () => {/*
  something about this comment means the line number gets reported incorrectly in the stack
  */console.log('something unrelated');const e = new Error("new error");console.log(e.stack);console.log('something unrelated');
}

The relevant output is then: http://127.0.0.1:8081/build/main.js:3:161

Now the stack trace is reporting the error occurred at column 161, which does not exist.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210208/341288ff/attachment.htm>


More information about the webkit-unassigned mailing list