Summary: | Implement AbortSignal.throwIfAborted | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anne van Kesteren <annevk> | ||||||
Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | achristensen, cdumez, clopez, darin, esprehn+autocc, ews-watchlist, ggaren, kangil.han, kondapallykalyan, sam, webkit-bug-importer, youennf, ysuzuki | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | Safari Technology Preview | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
URL: | https://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted | ||||||||
Attachments: |
|
Description
Anne van Kesteren
2021-12-10 00:36:17 PST
Created attachment 446731 [details]
Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess Comment on attachment 446731 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446731&action=review > Source/WebCore/dom/AbortSignal.cpp:124 > + JSC::throwException(&lexicalGlobalObject, scope, static_cast<JSC::JSValue>(m_reason)); Don’t need to write JSC::throwException; argument-dependent lookup should work unless AbortSignal has a member function named throwException. The cast to JSC::JSValue seems really sad. I would probably add one more local variable: JSC::JSValue reason = m_reason; Just because assignment is less forceful than a static_cast. Another solution would be to add a member function to JSValueInWrappedObject that returns the value. Could be named value() or get(). And use that instead of the static_cast. Created attachment 446829 [details]
Patch
(In reply to Darin Adler from comment #3) > Comment on attachment 446731 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=446731&action=review > > > Source/WebCore/dom/AbortSignal.cpp:124 > > + JSC::throwException(&lexicalGlobalObject, scope, static_cast<JSC::JSValue>(m_reason)); > > Don’t need to write JSC::throwException; argument-dependent lookup should > work unless AbortSignal has a member function named throwException. You're right, I didn't need the JSC::. > The cast to JSC::JSValue seems really sad. I would probably add one more > local variable: > > JSC::JSValue reason = m_reason; > > Just because assignment is less forceful than a static_cast. Another > solution would be to add a member function to JSValueInWrappedObject that > returns the value. Could be named value() or get(). And use that instead of > the static_cast. I actually didn't need the static_cast<> at all it seems. Committed r286904 (245130@main): <https://commits.webkit.org/245130@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 446829 [details]. |