File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -3061,6 +3061,13 @@ pub mod WebAssembly {
3061
3061
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/length)
3062
3062
#[ wasm_bindgen( method, getter, js_namespace = WebAssembly ) ]
3063
3063
pub fn length ( this : & Table ) -> u32 ;
3064
+
3065
+ /// The `get()` prototype method of the `WebAssembly.Table()` object
3066
+ /// retrieves a function reference stored at a given index.
3067
+ ///
3068
+ /// [MDN documentation](
3069
+ #[ wasm_bindgen( method, catch, js_namespace = WebAssembly ) ]
3070
+ pub fn get ( this : & Table , index : u32 ) -> Result < Function , JsValue > ;
3064
3071
}
3065
3072
3066
3073
// WebAssembly.Memory
Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ fn table_error() {
127
127
fn table ( ) {
128
128
let table = WebAssembly :: Table :: new ( & get_table_object ( ) . into ( ) ) . unwrap ( ) ;
129
129
assert_eq ! ( table. length( ) , 1 ) ;
130
+
131
+ assert ! ( table. get( 0 ) . is_ok( ) ) ;
132
+ assert ! ( table. get( 999 ) . is_err( ) ) ;
130
133
}
131
134
132
135
#[ wasm_bindgen_test]
You can’t perform that action at this time.
0 commit comments