File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2811,6 +2811,10 @@ bool v8__Promise__HasHandler(const v8::Promise& self) {
28112811 return ptr_to_local (&self)->HasHandler ();
28122812}
28132813
2814+ void v8__Promise__MarkAsHandled (const v8::Promise& self) {
2815+ ptr_to_local (&self)->MarkAsHandled ();
2816+ }
2817+
28142818const v8::Value* v8__Promise__Result (const v8::Promise& self) {
28152819 return local_to_ptr (ptr_to_local (&self)->Result ());
28162820}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ unsafe extern "C" {
2828 ) -> MaybeBool ;
2929 fn v8__Promise__State ( this : * const Promise ) -> PromiseState ;
3030 fn v8__Promise__HasHandler ( this : * const Promise ) -> bool ;
31+ fn v8__Promise__MarkAsHandled ( this : * const Promise ) ;
3132 fn v8__Promise__Result ( this : * const Promise ) -> * const Value ;
3233 fn v8__Promise__Catch (
3334 this : * const Promise ,
@@ -79,6 +80,12 @@ impl Promise {
7980 unsafe { v8__Promise__HasHandler ( self ) }
8081 }
8182
83+ /// Marks this promise as handled to avoid reporting unhandled rejections.
84+ #[ inline( always) ]
85+ pub fn mark_as_handled ( & self ) {
86+ unsafe { v8__Promise__MarkAsHandled ( self ) }
87+ }
88+
8289 /// Returns the content of the [[PromiseResult]] field. The Promise must not
8390 /// be pending.
8491 #[ inline( always) ]
You can’t perform that action at this time.
0 commit comments