<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>239491</bug_id>
          
          <creation_ts>2022-04-19 04:31:19 -0700</creation_ts>
          <short_desc>Wrong column number in window.onerror handler in code with template literals</short_desc>
          <delta_ts>2022-04-26 12:40:21 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>Safari Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>235607</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michal Polko">michal64128</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1862493</commentid>
    <comment_count>0</comment_count>
    <who name="Michal Polko">michal64128</who>
    <bug_when>2022-04-19 04:31:19 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1864413</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-04-26 04:32:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/92326939&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1864571</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2022-04-26 12:40:21 -0700</bug_when>
    <thetext>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 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>