Issue #2435 - Declare PromiseRejectionEvent WebIDL

Based-on: m-c 1338059
This commit is contained in:
Martok 2024-01-02 01:56:12 +01:00 committed by roytam1
commit 511a9376e3
3 changed files with 24 additions and 1 deletions

View file

@ -80,7 +80,7 @@ def idlTypeNeedsCycleCollection(type):
type.isObject() or
type.isSpiderMonkeyInterface()):
return False
elif type.isCallback() or type.isGeckoInterface():
elif type.isCallback() or type.isPromise() or type.isGeckoInterface():
return True
elif type.isUnion():
return any(idlTypeNeedsCycleCollection(t) for t in type.flatMemberTypes)

View file

@ -0,0 +1,22 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* https://html.spec.whatwg.org/multipage/webappapis.html#the-promiserejectionevent-interface
*/
[Constructor(DOMString type, PromiseRejectionEventInit eventInitDict),
Exposed=(Window,Worker)]
interface PromiseRejectionEvent : Event
{
[BinaryName="rejectedPromise"]
readonly attribute Promise<any> promise;
readonly attribute any reason;
};
dictionary PromiseRejectionEventInit : EventInit {
required Promise<any> promise;
any reason;
};

View file

@ -695,6 +695,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'PopStateEvent.webidl',
'PopupBlockedEvent.webidl',
'ProgressEvent.webidl',
'PromiseRejectionEvent.webidl',
'RecordErrorEvent.webidl',
'ScrollViewChangeEvent.webidl',
'ServiceWorkerMessageEvent.webidl',