Skip to content

Commit ad82651

Browse files
authored
Annotate methods in WebCodecs that throw (#3970)
1 parent 71bd366 commit ad82651

10 files changed

+103
-85
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
* Use `table.fill` when appropriate.
5454
[#3446](https://github.com/rustwasm/wasm-bindgen/pull/3446)
5555

56+
* Annotated methods in WebCodecs that throw.
57+
[#3970](https://github.com/rustwasm/wasm-bindgen/pull/3970)
58+
5659
### Fixed
5760

5861
* Copy port from headless test server when using `WASM_BINDGEN_TEST_ADDRESS`.

crates/web-sys/src/features/gen_AudioData.rs

+11-8
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ extern "C" {
9797
pub fn new(init: &AudioDataInit) -> Result<AudioData, JsValue>;
9898
#[cfg(web_sys_unstable_apis)]
9999
#[cfg(feature = "AudioDataCopyToOptions")]
100-
# [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = allocationSize)]
100+
# [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = allocationSize)]
101101
#[doc = "The `allocationSize()` method."]
102102
#[doc = ""]
103103
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/allocationSize)"]
@@ -106,9 +106,12 @@ extern "C" {
106106
#[doc = ""]
107107
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
108108
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
109-
pub fn allocation_size(this: &AudioData, options: &AudioDataCopyToOptions) -> u32;
109+
pub fn allocation_size(
110+
this: &AudioData,
111+
options: &AudioDataCopyToOptions,
112+
) -> Result<u32, JsValue>;
110113
#[cfg(web_sys_unstable_apis)]
111-
# [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = clone)]
114+
# [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = clone)]
112115
#[doc = "The `clone()` method."]
113116
#[doc = ""]
114117
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/clone)"]
@@ -117,7 +120,7 @@ extern "C" {
117120
#[doc = ""]
118121
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
119122
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
120-
pub fn clone(this: &AudioData) -> AudioData;
123+
pub fn clone(this: &AudioData) -> Result<AudioData, JsValue>;
121124
#[cfg(web_sys_unstable_apis)]
122125
# [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = close)]
123126
#[doc = "The `close()` method."]
@@ -131,7 +134,7 @@ extern "C" {
131134
pub fn close(this: &AudioData);
132135
#[cfg(web_sys_unstable_apis)]
133136
#[cfg(feature = "AudioDataCopyToOptions")]
134-
# [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = copyTo)]
137+
# [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = copyTo)]
135138
#[doc = "The `copyTo()` method."]
136139
#[doc = ""]
137140
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/copyTo)"]
@@ -144,10 +147,10 @@ extern "C" {
144147
this: &AudioData,
145148
destination: &::js_sys::Object,
146149
options: &AudioDataCopyToOptions,
147-
);
150+
) -> Result<(), JsValue>;
148151
#[cfg(web_sys_unstable_apis)]
149152
#[cfg(feature = "AudioDataCopyToOptions")]
150-
# [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = copyTo)]
153+
# [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = copyTo)]
151154
#[doc = "The `copyTo()` method."]
152155
#[doc = ""]
153156
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/copyTo)"]
@@ -160,5 +163,5 @@ extern "C" {
160163
this: &AudioData,
161164
destination: &mut [u8],
162165
options: &AudioDataCopyToOptions,
163-
);
166+
) -> Result<(), JsValue>;
164167
}

crates/web-sys/src/features/gen_AudioDecoder.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern "C" {
5252
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
5353
pub fn new(init: &AudioDecoderInit) -> Result<AudioDecoder, JsValue>;
5454
#[cfg(web_sys_unstable_apis)]
55-
# [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = close)]
55+
# [wasm_bindgen (catch , method , structural , js_class = "AudioDecoder" , js_name = close)]
5656
#[doc = "The `close()` method."]
5757
#[doc = ""]
5858
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/close)"]
@@ -61,10 +61,10 @@ extern "C" {
6161
#[doc = ""]
6262
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
6363
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
64-
pub fn close(this: &AudioDecoder);
64+
pub fn close(this: &AudioDecoder) -> Result<(), JsValue>;
6565
#[cfg(web_sys_unstable_apis)]
6666
#[cfg(feature = "AudioDecoderConfig")]
67-
# [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = configure)]
67+
# [wasm_bindgen (catch , method , structural , js_class = "AudioDecoder" , js_name = configure)]
6868
#[doc = "The `configure()` method."]
6969
#[doc = ""]
7070
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/configure)"]
@@ -73,10 +73,10 @@ extern "C" {
7373
#[doc = ""]
7474
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
7575
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
76-
pub fn configure(this: &AudioDecoder, config: &AudioDecoderConfig);
76+
pub fn configure(this: &AudioDecoder, config: &AudioDecoderConfig) -> Result<(), JsValue>;
7777
#[cfg(web_sys_unstable_apis)]
7878
#[cfg(feature = "EncodedAudioChunk")]
79-
# [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = decode)]
79+
# [wasm_bindgen (catch , method , structural , js_class = "AudioDecoder" , js_name = decode)]
8080
#[doc = "The `decode()` method."]
8181
#[doc = ""]
8282
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/decode)"]
@@ -85,7 +85,7 @@ extern "C" {
8585
#[doc = ""]
8686
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
8787
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
88-
pub fn decode(this: &AudioDecoder, chunk: &EncodedAudioChunk);
88+
pub fn decode(this: &AudioDecoder, chunk: &EncodedAudioChunk) -> Result<(), JsValue>;
8989
#[cfg(web_sys_unstable_apis)]
9090
# [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = flush)]
9191
#[doc = "The `flush()` method."]
@@ -110,7 +110,7 @@ extern "C" {
110110
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
111111
pub fn is_config_supported(config: &AudioDecoderConfig) -> ::js_sys::Promise;
112112
#[cfg(web_sys_unstable_apis)]
113-
# [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = reset)]
113+
# [wasm_bindgen (catch , method , structural , js_class = "AudioDecoder" , js_name = reset)]
114114
#[doc = "The `reset()` method."]
115115
#[doc = ""]
116116
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/reset)"]
@@ -119,5 +119,5 @@ extern "C" {
119119
#[doc = ""]
120120
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
121121
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
122-
pub fn reset(this: &AudioDecoder);
122+
pub fn reset(this: &AudioDecoder) -> Result<(), JsValue>;
123123
}

crates/web-sys/src/features/gen_AudioEncoder.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern "C" {
5252
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
5353
pub fn new(init: &AudioEncoderInit) -> Result<AudioEncoder, JsValue>;
5454
#[cfg(web_sys_unstable_apis)]
55-
# [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = close)]
55+
# [wasm_bindgen (catch , method , structural , js_class = "AudioEncoder" , js_name = close)]
5656
#[doc = "The `close()` method."]
5757
#[doc = ""]
5858
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/close)"]
@@ -61,10 +61,10 @@ extern "C" {
6161
#[doc = ""]
6262
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
6363
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
64-
pub fn close(this: &AudioEncoder);
64+
pub fn close(this: &AudioEncoder) -> Result<(), JsValue>;
6565
#[cfg(web_sys_unstable_apis)]
6666
#[cfg(feature = "AudioEncoderConfig")]
67-
# [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = configure)]
67+
# [wasm_bindgen (catch , method , structural , js_class = "AudioEncoder" , js_name = configure)]
6868
#[doc = "The `configure()` method."]
6969
#[doc = ""]
7070
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/configure)"]
@@ -73,10 +73,10 @@ extern "C" {
7373
#[doc = ""]
7474
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
7575
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
76-
pub fn configure(this: &AudioEncoder, config: &AudioEncoderConfig);
76+
pub fn configure(this: &AudioEncoder, config: &AudioEncoderConfig) -> Result<(), JsValue>;
7777
#[cfg(web_sys_unstable_apis)]
7878
#[cfg(feature = "AudioData")]
79-
# [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = encode)]
79+
# [wasm_bindgen (catch , method , structural , js_class = "AudioEncoder" , js_name = encode)]
8080
#[doc = "The `encode()` method."]
8181
#[doc = ""]
8282
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/encode)"]
@@ -85,7 +85,7 @@ extern "C" {
8585
#[doc = ""]
8686
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
8787
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
88-
pub fn encode(this: &AudioEncoder, data: &AudioData);
88+
pub fn encode(this: &AudioEncoder, data: &AudioData) -> Result<(), JsValue>;
8989
#[cfg(web_sys_unstable_apis)]
9090
# [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = flush)]
9191
#[doc = "The `flush()` method."]
@@ -110,7 +110,7 @@ extern "C" {
110110
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
111111
pub fn is_config_supported(config: &AudioEncoderConfig) -> ::js_sys::Promise;
112112
#[cfg(web_sys_unstable_apis)]
113-
# [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = reset)]
113+
# [wasm_bindgen (catch , method , structural , js_class = "AudioEncoder" , js_name = reset)]
114114
#[doc = "The `reset()` method."]
115115
#[doc = ""]
116116
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/reset)"]
@@ -119,5 +119,5 @@ extern "C" {
119119
#[doc = ""]
120120
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
121121
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
122-
pub fn reset(this: &AudioEncoder);
122+
pub fn reset(this: &AudioEncoder) -> Result<(), JsValue>;
123123
}

crates/web-sys/src/features/gen_EncodedAudioChunk.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ extern "C" {
7474
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
7575
pub fn new(init: &EncodedAudioChunkInit) -> Result<EncodedAudioChunk, JsValue>;
7676
#[cfg(web_sys_unstable_apis)]
77-
# [wasm_bindgen (method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)]
77+
# [wasm_bindgen (catch , method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)]
7878
#[doc = "The `copyTo()` method."]
7979
#[doc = ""]
8080
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedAudioChunk/copyTo)"]
@@ -83,9 +83,12 @@ extern "C" {
8383
#[doc = ""]
8484
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
8585
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
86-
pub fn copy_to_with_buffer_source(this: &EncodedAudioChunk, destination: &::js_sys::Object);
86+
pub fn copy_to_with_buffer_source(
87+
this: &EncodedAudioChunk,
88+
destination: &::js_sys::Object,
89+
) -> Result<(), JsValue>;
8790
#[cfg(web_sys_unstable_apis)]
88-
# [wasm_bindgen (method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)]
91+
# [wasm_bindgen (catch , method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)]
8992
#[doc = "The `copyTo()` method."]
9093
#[doc = ""]
9194
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedAudioChunk/copyTo)"]
@@ -94,5 +97,8 @@ extern "C" {
9497
#[doc = ""]
9598
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
9699
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
97-
pub fn copy_to_with_u8_array(this: &EncodedAudioChunk, destination: &mut [u8]);
100+
pub fn copy_to_with_u8_array(
101+
this: &EncodedAudioChunk,
102+
destination: &mut [u8],
103+
) -> Result<(), JsValue>;
98104
}

crates/web-sys/src/features/gen_EncodedVideoChunk.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ extern "C" {
7474
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
7575
pub fn new(init: &EncodedVideoChunkInit) -> Result<EncodedVideoChunk, JsValue>;
7676
#[cfg(web_sys_unstable_apis)]
77-
# [wasm_bindgen (method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)]
77+
# [wasm_bindgen (catch , method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)]
7878
#[doc = "The `copyTo()` method."]
7979
#[doc = ""]
8080
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedVideoChunk/copyTo)"]
@@ -83,9 +83,12 @@ extern "C" {
8383
#[doc = ""]
8484
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
8585
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
86-
pub fn copy_to_with_buffer_source(this: &EncodedVideoChunk, destination: &::js_sys::Object);
86+
pub fn copy_to_with_buffer_source(
87+
this: &EncodedVideoChunk,
88+
destination: &::js_sys::Object,
89+
) -> Result<(), JsValue>;
8790
#[cfg(web_sys_unstable_apis)]
88-
# [wasm_bindgen (method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)]
91+
# [wasm_bindgen (catch , method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)]
8992
#[doc = "The `copyTo()` method."]
9093
#[doc = ""]
9194
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedVideoChunk/copyTo)"]
@@ -94,5 +97,8 @@ extern "C" {
9497
#[doc = ""]
9598
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
9699
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
97-
pub fn copy_to_with_u8_array(this: &EncodedVideoChunk, destination: &mut [u8]);
100+
pub fn copy_to_with_u8_array(
101+
this: &EncodedVideoChunk,
102+
destination: &mut [u8],
103+
) -> Result<(), JsValue>;
98104
}

crates/web-sys/src/features/gen_VideoDecoder.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern "C" {
5252
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
5353
pub fn new(init: &VideoDecoderInit) -> Result<VideoDecoder, JsValue>;
5454
#[cfg(web_sys_unstable_apis)]
55-
# [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = close)]
55+
# [wasm_bindgen (catch , method , structural , js_class = "VideoDecoder" , js_name = close)]
5656
#[doc = "The `close()` method."]
5757
#[doc = ""]
5858
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/close)"]
@@ -61,10 +61,10 @@ extern "C" {
6161
#[doc = ""]
6262
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
6363
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
64-
pub fn close(this: &VideoDecoder);
64+
pub fn close(this: &VideoDecoder) -> Result<(), JsValue>;
6565
#[cfg(web_sys_unstable_apis)]
6666
#[cfg(feature = "VideoDecoderConfig")]
67-
# [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = configure)]
67+
# [wasm_bindgen (catch , method , structural , js_class = "VideoDecoder" , js_name = configure)]
6868
#[doc = "The `configure()` method."]
6969
#[doc = ""]
7070
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/configure)"]
@@ -73,10 +73,10 @@ extern "C" {
7373
#[doc = ""]
7474
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
7575
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
76-
pub fn configure(this: &VideoDecoder, config: &VideoDecoderConfig);
76+
pub fn configure(this: &VideoDecoder, config: &VideoDecoderConfig) -> Result<(), JsValue>;
7777
#[cfg(web_sys_unstable_apis)]
7878
#[cfg(feature = "EncodedVideoChunk")]
79-
# [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = decode)]
79+
# [wasm_bindgen (catch , method , structural , js_class = "VideoDecoder" , js_name = decode)]
8080
#[doc = "The `decode()` method."]
8181
#[doc = ""]
8282
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/decode)"]
@@ -85,7 +85,7 @@ extern "C" {
8585
#[doc = ""]
8686
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
8787
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
88-
pub fn decode(this: &VideoDecoder, chunk: &EncodedVideoChunk);
88+
pub fn decode(this: &VideoDecoder, chunk: &EncodedVideoChunk) -> Result<(), JsValue>;
8989
#[cfg(web_sys_unstable_apis)]
9090
# [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = flush)]
9191
#[doc = "The `flush()` method."]
@@ -110,7 +110,7 @@ extern "C" {
110110
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
111111
pub fn is_config_supported(config: &VideoDecoderConfig) -> ::js_sys::Promise;
112112
#[cfg(web_sys_unstable_apis)]
113-
# [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = reset)]
113+
# [wasm_bindgen (catch , method , structural , js_class = "VideoDecoder" , js_name = reset)]
114114
#[doc = "The `reset()` method."]
115115
#[doc = ""]
116116
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/reset)"]
@@ -119,5 +119,5 @@ extern "C" {
119119
#[doc = ""]
120120
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
121121
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
122-
pub fn reset(this: &VideoDecoder);
122+
pub fn reset(this: &VideoDecoder) -> Result<(), JsValue>;
123123
}

0 commit comments

Comments
 (0)