Summary: | Implement self.reportError() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anne van Kesteren <annevk> | ||||||
Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, clopez, darin, esprehn+autocc, ews-watchlist, ggaren, hi, kondapallykalyan, mkwst, rniwa, sam, webkit-bug-importer, youennf | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Anne van Kesteren
2021-07-26 23:10:56 PDT
Created attachment 436682 [details]
Patch
Comment on attachment 436682 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436682&action=review > Source/WebCore/page/DOMWindow.cpp:1809 > + auto* exception = JSC::jsDynamicCast<JSC::Exception*>(vm, error); FYI, I initially tried to call `reportException(JSGlobalObject* lexicalGlobalObject, JSValue exceptionValue, CachedScript* cachedScript)` overload directly with the JSValue. However, for some reason, that reportException() overload doesn't capture the stack when constructing the JSC::Exception. This was causing some failures in the WPT tests as a result (things like e.filename were not populated). (In reply to Chris Dumez from comment #3) > Comment on attachment 436682 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=436682&action=review > > > Source/WebCore/page/DOMWindow.cpp:1809 > > + auto* exception = JSC::jsDynamicCast<JSC::Exception*>(vm, error); > > FYI, I initially tried to call `reportException(JSGlobalObject* > lexicalGlobalObject, JSValue exceptionValue, CachedScript* cachedScript)` > overload directly with the JSValue. > However, for some reason, that reportException() overload doesn't capture > the stack when constructing the JSC::Exception. This was causing some > failures in the WPT tests as a result (things like e.filename were not > populated). We definitely have other issues where the stack is not captured or exposed for DOM related errors: http://wpt.live/WebIDL/ecmascript-binding/es-exceptions/DOMException-custom-bindings.any.html Comment on attachment 436682 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436682&action=review > Source/WebCore/page/WindowOrWorkerGlobalScope.idl:71 > + [CallWith=GlobalObject] undefined reportError(any error); Please move this to below crossOriginIsolated; to match it's location in the spec (I try to keep these as close to the spec IDL as I can). > Source/WebCore/workers/WorkerGlobalScope.cpp:551 > +void WorkerGlobalScope::reportError(JSC::JSGlobalObject& globalObject, JSC::JSValue error) Kind of a bummer to have to repeat this. Created attachment 436768 [details]
Patch
Committed r281756 (241098@main): <https://commits.webkit.org/241098@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 436768 [details]. (In reply to Sam Weinig from comment #5) > Comment on attachment 436682 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=436682&action=review > > > Source/WebCore/page/WindowOrWorkerGlobalScope.idl:71 > > + [CallWith=GlobalObject] undefined reportError(any error); > > Please move this to below crossOriginIsolated; to match it's location in the > spec (I try to keep these as close to the spec IDL as I can). > > > Source/WebCore/workers/WorkerGlobalScope.cpp:551 > > +void WorkerGlobalScope::reportError(JSC::JSGlobalObject& globalObject, JSC::JSValue error) > > Kind of a bummer to have to repeat this. Yes, I agree. I'll find a way to share and follow up. |