<?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>305789</bug_id>
          
          <creation_ts>2026-01-19 12:52:08 -0800</creation_ts>
          <short_desc>Error.captureStackTrace() is not working</short_desc>
          <delta_ts>2026-01-28 10:32:22 -0800</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>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="Alex Schwartz">alexschwartz01</reporter>
          <assigned_to name="Shu-yu Guo">syg</assigned_to>
          <cc>keith_miller</cc>
    
    <cc>syg</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2173096</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Schwartz">alexschwartz01</who>
    <bug_when>2026-01-19 12:52:08 -0800</bug_when>
    <thetext>```js
function wrapper(x) {
    if (x === 5) {
        const e = new Error
        Error.captureStackTrace(e, wrapper)
        throw e
    }
    return 7
}

Promise.try(() =&gt; {
    const x = wrapper(5)
}).catch(err =&gt; {
    console.log(err.stack)
})
```

---

# Chromium Output

Error
    at &lt;anonymous&gt;:11:15
    at Promise.try (&lt;anonymous&gt;)
    at &lt;anonymous&gt;:10:12

# Chromium Output without Error.captureStackTrace()

Error
    at wrapper (&lt;anonymous&gt;:3:19)
    at &lt;anonymous&gt;:11:15
    at Promise.try (&lt;anonymous&gt;)
    at &lt;anonymous&gt;:10:12

---

# Firefox Output

@debugger eval code:11:22
@debugger eval code:10:9

# Firefox Output without Error.captureStackTrace()

wrapper@debugger eval code:3:19
@debugger eval code:11:22
@debugger eval code:10:9

---

# Webkit Output

wrapper@
@
try@[native code]
global code@

# Webkit Output without Error.captureStackTrace()

wrapper@
@
try@[native code]
global code@</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173097</commentid>
    <comment_count>1</comment_count>
    <who name="Alex Schwartz">alexschwartz01</who>
    <bug_when>2026-01-19 12:54:29 -0800</bug_when>
    <thetext>I would expect the &quot;Webkit Output&quot; section
    (where Error.captureStackTrace() is used)
to be smaller than the &quot;Webkit Output without Error.captureStackTrace()&quot; section</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173098</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Schwartz">alexschwartz01</who>
    <bug_when>2026-01-19 12:55:38 -0800</bug_when>
    <thetext>I used Epiphany Technology Preview</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173712</commentid>
    <comment_count>3</comment_count>
    <who name="Alex Schwartz">alexschwartz01</who>
    <bug_when>2026-01-21 10:17:08 -0800</bug_when>
    <thetext>original PR for this feature: https://github.com/WebKit/WebKit/pull/16790</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2175231</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-01-26 12:53:12 -0800</bug_when>
    <thetext>&lt;rdar://problem/168941975&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2175660</commentid>
    <comment_count>5</comment_count>
    <who name="Shu-yu Guo">syg</who>
    <bug_when>2026-01-27 20:32:20 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/57384</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2175840</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-01-28 09:52:12 -0800</bug_when>
    <thetext>Committed 306356@main (0e62abf49f09): &lt;https://commits.webkit.org/306356@main&gt;

Reviewed commits have been landed. Closing PR #57384 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2175868</commentid>
    <comment_count>7</comment_count>
    <who name="Alex Schwartz">alexschwartz01</who>
    <bug_when>2026-01-28 10:32:22 -0800</bug_when>
    <thetext>Can confirm this fixes my issue 
Thank you!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>