mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:27:45 +00:00
LibWeb: Implement PromiseRejectionEvent
This paves the way for the rejectionhandled and unhandledrejection events. It's also used by core-js (in browsers, at least) to check whether Promise needs to be polyfilled, so adding it should allow more websites to leverage LibJS's native Promise implementation :^)
This commit is contained in:
parent
661dd32432
commit
f952db1a1f
6 changed files with 75 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <LibWeb/Bindings/MouseEventWrapper.h>
|
||||
#include <LibWeb/Bindings/PageTransitionEventWrapper.h>
|
||||
#include <LibWeb/Bindings/ProgressEventWrapper.h>
|
||||
#include <LibWeb/Bindings/PromiseRejectionEventWrapper.h>
|
||||
#include <LibWeb/Bindings/SubmitEventWrapper.h>
|
||||
|
||||
namespace Web::Bindings {
|
||||
|
@ -31,6 +32,8 @@ EventWrapper* wrap(JS::GlobalObject& global_object, DOM::Event& event)
|
|||
return static_cast<MessageEventWrapper*>(wrap_impl(global_object, static_cast<HTML::MessageEvent&>(event)));
|
||||
if (is<HTML::PageTransitionEvent>(event))
|
||||
return static_cast<PageTransitionEventWrapper*>(wrap_impl(global_object, static_cast<HTML::PageTransitionEvent&>(event)));
|
||||
if (is<HTML::PromiseRejectionEvent>(event))
|
||||
return static_cast<PromiseRejectionEventWrapper*>(wrap_impl(global_object, static_cast<HTML::PromiseRejectionEvent&>(event)));
|
||||
if (is<HTML::SubmitEvent>(event))
|
||||
return static_cast<SubmitEventWrapper*>(wrap_impl(global_object, static_cast<HTML::SubmitEvent&>(event)));
|
||||
if (is<UIEvents::KeyboardEvent>(event))
|
||||
|
|
|
@ -231,6 +231,8 @@
|
|||
#include <LibWeb/Bindings/ProcessingInstructionPrototype.h>
|
||||
#include <LibWeb/Bindings/ProgressEventConstructor.h>
|
||||
#include <LibWeb/Bindings/ProgressEventPrototype.h>
|
||||
#include <LibWeb/Bindings/PromiseRejectionEventConstructor.h>
|
||||
#include <LibWeb/Bindings/PromiseRejectionEventPrototype.h>
|
||||
#include <LibWeb/Bindings/RangeConstructor.h>
|
||||
#include <LibWeb/Bindings/RangePrototype.h>
|
||||
#include <LibWeb/Bindings/ResizeObserverConstructor.h>
|
||||
|
@ -396,6 +398,7 @@
|
|||
ADD_WINDOW_OBJECT_INTERFACE(PerformanceTiming) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(ProcessingInstruction) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(ProgressEvent) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(PromiseRejectionEvent) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(Range) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(ResizeObserver) \
|
||||
ADD_WINDOW_OBJECT_INTERFACE(Screen) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue