Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 195397957f976f8920ba3310698dc69dc6b0c12a
      
https://github.com/WebKit/WebKit/commit/195397957f976f8920ba3310698dc69dc6b0c12a
  Author: Chris Dumez <[email protected]>
  Date:   2026-04-16 (Thu, 16 Apr 2026)

  Changed paths:
    M Source/JavaScriptCore/runtime/JSCast.h
    M Source/WebCore/bindings/js/IDBBindingUtilities.cpp
    M Source/WebCore/bindings/js/JSDOMConvertXPathNSResolver.h
    M Source/WebCore/bindings/js/JSDOMPromiseDeferred.h
    M Source/WebCore/bindings/js/JSEventListener.cpp
    M Source/WebCore/bindings/js/ScriptController.cpp

  Log Message:
  -----------
  Make downcast / dynamicDowncast / uncheckedDowncast work with JSCell 
subclasses
https://bugs.webkit.org/show_bug.cgi?id=312444

Reviewed by Yusuke Suzuki.

Add TypeCastTraits specializations to JSCast.h so that the WTF casting
functions (uncheckedDowncast, downcast, dynamicDowncast) work with JS
types, enabling a future transition away from jsCast / jsSecureCast /
jsDynamicCast.

  - Per-type TypeCastTraits specializations generated via
    FOR_EACH_JS_DYNAMIC_CAST_JS_TYPE_OVERLOAD macro, preserving optimized
    JSType range checking.
  - Generic constrained TypeCastTraits fallback for JSCell subclasses not
    in the macro list (e.g. WebCore binding types like JSDOMGlobalObject).
  - JSCell-specific uncheckedDowncast overloads that preserve
    reportZappedCellAndCrash behavior on x86_64.
  - JSValue overloads for all three casting functions.
  - Adopt the new casting functions in a handful of WebCore sites to
    prove they work end-to-end.

* Source/JavaScriptCore/runtime/JSCast.h:
(WTF::uncheckedDowncast):
(dynamicDowncast):
(downcast):
(uncheckedDowncast):
* Source/WebCore/bindings/js/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
* Source/WebCore/bindings/js/JSDOMConvertXPathNSResolver.h:
(WebCore::Converter<IDLInterface<XPathNSResolver>>::convert):
* Source/WebCore/bindings/js/JSDOMPromiseDeferred.h:
(WebCore::callPromiseFunction):
* Source/WebCore/bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::functionName const):
* Source/WebCore/bindings/js/ScriptController.cpp:
(WebCore::jsValueToModuleKey):

Canonical link: https://commits.webkit.org/311418@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to