File tree 3 files changed +13
-0
lines changed 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -3783,6 +3783,7 @@ extern {
3783
3783
/// an asynchronous operation, and its resulting value.
3784
3784
///
3785
3785
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
3786
+ #[ wasm_bindgen( extends = Object ) ]
3786
3787
pub type Promise ;
3787
3788
3788
3789
/// Creates a new `Promise` with the provided executor `cb`
Original file line number Diff line number Diff line change
1
+ use wasm_bindgen_test:: * ;
2
+ use wasm_bindgen:: JsCast ;
3
+ use js_sys:: * ;
4
+
5
+ #[ wasm_bindgen_test]
6
+ fn promise_inheritance ( ) {
7
+ let promise = Promise :: new ( & mut |_, _| ( ) ) ;
8
+ assert ! ( promise. is_instance_of:: <Promise >( ) ) ;
9
+ assert ! ( promise. is_instance_of:: <Object >( ) ) ;
10
+ let _: & Object = promise. as_ref ( ) ;
11
+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ pub mod MapIterator;
26
26
pub mod Math ;
27
27
pub mod Number ;
28
28
pub mod Object ;
29
+ pub mod Promise ;
29
30
pub mod Proxy ;
30
31
pub mod RangeError ;
31
32
pub mod ReferenceError ;
You can’t perform that action at this time.
0 commit comments