Bug 305789
| Summary: | Error.captureStackTrace() is not working | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Alex Schwartz <alexschwartz01> |
| Component: | JavaScriptCore | Assignee: | Shu-yu Guo <syg> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | keith_miller, syg, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Alex Schwartz
```js
function wrapper(x) {
if (x === 5) {
const e = new Error
Error.captureStackTrace(e, wrapper)
throw e
}
return 7
}
Promise.try(() => {
const x = wrapper(5)
}).catch(err => {
console.log(err.stack)
})
```
---
# Chromium Output
Error
at <anonymous>:11:15
at Promise.try (<anonymous>)
at <anonymous>:10:12
# Chromium Output without Error.captureStackTrace()
Error
at wrapper (<anonymous>:3:19)
at <anonymous>:11:15
at Promise.try (<anonymous>)
at <anonymous>: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@
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alex Schwartz
I would expect the "Webkit Output" section
(where Error.captureStackTrace() is used)
to be smaller than the "Webkit Output without Error.captureStackTrace()" section
Alex Schwartz
I used Epiphany Technology Preview
Alex Schwartz
original PR for this feature: https://github.com/WebKit/WebKit/pull/16790
Radar WebKit Bug Importer
<rdar://problem/168941975>
Shu-yu Guo
Pull request: https://github.com/WebKit/WebKit/pull/57384
EWS
Committed 306356@main (0e62abf49f09): <https://commits.webkit.org/306356@main>
Reviewed commits have been landed. Closing PR #57384 and removing active labels.
Alex Schwartz
Can confirm this fixes my issue
Thank you!