Skip to content

Commit

Permalink
Fix interface attributes setters using wrong JS method names (#4170)
Browse files Browse the repository at this point in the history
  • Loading branch information
0HyperCube authored Oct 10, 2024
1 parent 0e89a29 commit 76013f2
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 96 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
* Added support for `Self` in complex type expressions in methods.
[#4155](https://github.com/rustwasm/wasm-bindgen/pull/4155)

### Fixed

* Fixed generated setters from WebIDL interface attributes binding to wrong JS method names.
[#4170](https://github.com/rustwasm/wasm-bindgen/pull/4170)

--------------------------------------------------------------------------------

## [0.2.94](https://github.com/rustwasm/wasm-bindgen/compare/0.2.93...0.2.94)
Expand Down
36 changes: 18 additions & 18 deletions crates/web-sys/src/features/gen_CanvasRenderingContext2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,29 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
#[deprecated]
pub fn set_stroke_style(this: &CanvasRenderingContext2d, value: &::wasm_bindgen::JsValue);
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyleStr)]
#[doc = "Setter for the `strokeStyleStr` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyle)]
#[doc = "Setter for the `strokeStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyleStr)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
pub fn set_stroke_style_str(this: &CanvasRenderingContext2d, value: &str);
#[cfg(feature = "CanvasGradient")]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyleCanvasGradient)]
#[doc = "Setter for the `strokeStyleCanvasGradient` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyle)]
#[doc = "Setter for the `strokeStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyleCanvasGradient)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `CanvasRenderingContext2d`*"]
pub fn set_stroke_style_canvas_gradient(
this: &CanvasRenderingContext2d,
value: &CanvasGradient,
);
#[cfg(feature = "CanvasPattern")]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyleCanvasPattern)]
#[doc = "Setter for the `strokeStyleCanvasPattern` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyle)]
#[doc = "Setter for the `strokeStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyleCanvasPattern)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`*"]
pub fn set_stroke_style_canvas_pattern(this: &CanvasRenderingContext2d, value: &CanvasPattern);
Expand All @@ -107,26 +107,26 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
#[deprecated]
pub fn set_fill_style(this: &CanvasRenderingContext2d, value: &::wasm_bindgen::JsValue);
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyleStr)]
#[doc = "Setter for the `fillStyleStr` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)]
#[doc = "Setter for the `fillStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyleStr)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
pub fn set_fill_style_str(this: &CanvasRenderingContext2d, value: &str);
#[cfg(feature = "CanvasGradient")]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyleCanvasGradient)]
#[doc = "Setter for the `fillStyleCanvasGradient` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)]
#[doc = "Setter for the `fillStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyleCanvasGradient)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `CanvasRenderingContext2d`*"]
pub fn set_fill_style_canvas_gradient(this: &CanvasRenderingContext2d, value: &CanvasGradient);
#[cfg(feature = "CanvasPattern")]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyleCanvasPattern)]
#[doc = "Setter for the `fillStyleCanvasPattern` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)]
#[doc = "Setter for the `fillStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyleCanvasPattern)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`*"]
pub fn set_fill_style_canvas_pattern(this: &CanvasRenderingContext2d, value: &CanvasPattern);
Expand Down
12 changes: 6 additions & 6 deletions crates/web-sys/src/features/gen_IdbFileHandle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"]
#[deprecated]
pub fn set_location(this: &IdbFileHandle, value: Option<f64>);
# [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = locationOptU32)]
#[doc = "Setter for the `locationOptU32` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = location)]
#[doc = "Setter for the `location` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/locationOptU32)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/location)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"]
#[deprecated]
pub fn set_location_opt_u32(this: &IdbFileHandle, value: Option<u32>);
# [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = locationOptF64)]
#[doc = "Setter for the `locationOptF64` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = location)]
#[doc = "Setter for the `location` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/locationOptF64)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/location)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"]
#[deprecated]
Expand Down
12 changes: 6 additions & 6 deletions crates/web-sys/src/features/gen_KeyframeEffect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ extern "C" {
#[deprecated]
pub fn set_target(this: &KeyframeEffect, value: Option<&::js_sys::Object>);
#[cfg(feature = "Element")]
# [wasm_bindgen (structural , method , setter , js_class = "KeyframeEffect" , js_name = targetOptElement)]
#[doc = "Setter for the `targetOptElement` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "KeyframeEffect" , js_name = target)]
#[doc = "Setter for the `target` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/targetOptElement)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/target)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Element`, `KeyframeEffect`*"]
pub fn set_target_opt_element(this: &KeyframeEffect, value: Option<&Element>);
#[cfg(feature = "CssPseudoElement")]
# [wasm_bindgen (structural , method , setter , js_class = "KeyframeEffect" , js_name = targetOptCssPseudoElement)]
#[doc = "Setter for the `targetOptCssPseudoElement` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "KeyframeEffect" , js_name = target)]
#[doc = "Setter for the `target` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/targetOptCssPseudoElement)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/target)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CssPseudoElement`, `KeyframeEffect`*"]
pub fn set_target_opt_css_pseudo_element(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,29 @@ extern "C" {
this: &OffscreenCanvasRenderingContext2d,
value: &::wasm_bindgen::JsValue,
);
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyleStr)]
#[doc = "Setter for the `strokeStyleStr` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyle)]
#[doc = "Setter for the `strokeStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyleStr)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"]
pub fn set_stroke_style_str(this: &OffscreenCanvasRenderingContext2d, value: &str);
#[cfg(feature = "CanvasGradient")]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyleCanvasGradient)]
#[doc = "Setter for the `strokeStyleCanvasGradient` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyle)]
#[doc = "Setter for the `strokeStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyleCanvasGradient)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `OffscreenCanvasRenderingContext2d`*"]
pub fn set_stroke_style_canvas_gradient(
this: &OffscreenCanvasRenderingContext2d,
value: &CanvasGradient,
);
#[cfg(feature = "CanvasPattern")]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyleCanvasPattern)]
#[doc = "Setter for the `strokeStyleCanvasPattern` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyle)]
#[doc = "Setter for the `strokeStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyleCanvasPattern)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `OffscreenCanvasRenderingContext2d`*"]
pub fn set_stroke_style_canvas_pattern(
Expand All @@ -118,29 +118,29 @@ extern "C" {
this: &OffscreenCanvasRenderingContext2d,
value: &::wasm_bindgen::JsValue,
);
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyleStr)]
#[doc = "Setter for the `fillStyleStr` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyle)]
#[doc = "Setter for the `fillStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyleStr)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"]
pub fn set_fill_style_str(this: &OffscreenCanvasRenderingContext2d, value: &str);
#[cfg(feature = "CanvasGradient")]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyleCanvasGradient)]
#[doc = "Setter for the `fillStyleCanvasGradient` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyle)]
#[doc = "Setter for the `fillStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyleCanvasGradient)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `OffscreenCanvasRenderingContext2d`*"]
pub fn set_fill_style_canvas_gradient(
this: &OffscreenCanvasRenderingContext2d,
value: &CanvasGradient,
);
#[cfg(feature = "CanvasPattern")]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyleCanvasPattern)]
#[doc = "Setter for the `fillStyleCanvasPattern` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyle)]
#[doc = "Setter for the `fillStyle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyleCanvasPattern)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `OffscreenCanvasRenderingContext2d`*"]
pub fn set_fill_style_canvas_pattern(
Expand Down
12 changes: 6 additions & 6 deletions crates/web-sys/src/features/gen_RtcRtpReceiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ extern "C" {
pub fn transform(this: &RtcRtpReceiver) -> Option<::js_sys::Object>;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "SFrameTransform")]
# [wasm_bindgen (structural , method , setter , js_class = "RTCRtpReceiver" , js_name = transformOptSFrameTransform)]
#[doc = "Setter for the `transformOptSFrameTransform` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "RTCRtpReceiver" , js_name = transform)]
#[doc = "Setter for the `transform` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transformOptSFrameTransform)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transform)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `SFrameTransform`*"]
#[doc = ""]
Expand All @@ -73,10 +73,10 @@ extern "C" {
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "RtcRtpScriptTransform")]
# [wasm_bindgen (structural , method , setter , js_class = "RTCRtpReceiver" , js_name = transformOptRtcRtpScriptTransform)]
#[doc = "Setter for the `transformOptRtcRtpScriptTransform` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "RTCRtpReceiver" , js_name = transform)]
#[doc = "Setter for the `transform` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transformOptRtcRtpScriptTransform)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transform)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `RtcRtpScriptTransform`*"]
#[doc = ""]
Expand Down
12 changes: 6 additions & 6 deletions crates/web-sys/src/features/gen_RtcRtpSender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ extern "C" {
pub fn transform(this: &RtcRtpSender) -> Option<::js_sys::Object>;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "SFrameTransform")]
# [wasm_bindgen (structural , method , setter , js_class = "RTCRtpSender" , js_name = transformOptSFrameTransform)]
#[doc = "Setter for the `transformOptSFrameTransform` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "RTCRtpSender" , js_name = transform)]
#[doc = "Setter for the `transform` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/transformOptSFrameTransform)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/transform)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpSender`, `SFrameTransform`*"]
#[doc = ""]
Expand All @@ -56,10 +56,10 @@ extern "C" {
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "RtcRtpScriptTransform")]
# [wasm_bindgen (structural , method , setter , js_class = "RTCRtpSender" , js_name = transformOptRtcRtpScriptTransform)]
#[doc = "Setter for the `transformOptRtcRtpScriptTransform` field of this object."]
# [wasm_bindgen (structural , method , setter , js_class = "RTCRtpSender" , js_name = transform)]
#[doc = "Setter for the `transform` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/transformOptRtcRtpScriptTransform)"]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/transform)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransform`, `RtcRtpSender`*"]
#[doc = ""]
Expand Down
Loading

0 comments on commit 76013f2

Please sign in to comment.