Skip to content

Commit

Permalink
Deprecate builder-pattern setters for WebIDL dictionaries
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jul 28, 2024
1 parent bb084e5 commit b5e9e08
Show file tree
Hide file tree
Showing 553 changed files with 15,200 additions and 11,992 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
* Update and stabilize the Clipboard API.
[#3992](https://github.com/rustwasm/wasm-bindgen/pull/3992)

* Deprecate builder-pattern type setters for WebIDL dictionary types and introduce non-mutable setters instead.
[#3993](https://github.com/rustwasm/wasm-bindgen/pull/3993)

### Fixed

* Copy port from headless test server when using `WASM_BINDGEN_TEST_ADDRESS`.
Expand Down
27 changes: 15 additions & 12 deletions crates/web-sys/src/features/gen_AddEventListenerOptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,31 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, getter = "capture")]
pub fn get_capture(this: &AddEventListenerOptions) -> Option<bool>;
#[doc = "Change the `capture` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, setter = "capture")]
fn set_capture(this: &AddEventListenerOptions, val: bool);
pub fn set_capture(this: &AddEventListenerOptions, val: bool);
#[doc = "Get the `once` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, getter = "once")]
pub fn get_once(this: &AddEventListenerOptions) -> Option<bool>;
#[doc = "Change the `once` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, setter = "once")]
fn set_once(this: &AddEventListenerOptions, val: bool);
pub fn set_once(this: &AddEventListenerOptions, val: bool);
#[doc = "Get the `passive` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, getter = "passive")]
pub fn get_passive(this: &AddEventListenerOptions) -> Option<bool>;
#[doc = "Change the `passive` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[wasm_bindgen(method, setter = "passive")]
fn set_passive(this: &AddEventListenerOptions, val: bool);
pub fn set_passive(this: &AddEventListenerOptions, val: bool);
}
impl AddEventListenerOptions {
#[doc = "Construct a new `AddEventListenerOptions`."]
Expand All @@ -41,23 +50,17 @@ impl AddEventListenerOptions {
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `capture` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[deprecated = "Use `set_capture()` instead."]
pub fn capture(&mut self, val: bool) -> &mut Self {
self.set_capture(val);
self
}
#[doc = "Change the `once` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[deprecated = "Use `set_once()` instead."]
pub fn once(&mut self, val: bool) -> &mut Self {
self.set_once(val);
self
}
#[doc = "Change the `passive` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
#[deprecated = "Use `set_passive()` instead."]
pub fn passive(&mut self, val: bool) -> &mut Self {
self.set_passive(val);
self
Expand Down
18 changes: 10 additions & 8 deletions crates/web-sys/src/features/gen_AesCbcParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesCbcParams) -> String;
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
#[wasm_bindgen(method, setter = "name")]
fn set_name(this: &AesCbcParams, val: &str);
pub fn set_name(this: &AesCbcParams, val: &str);
#[doc = "Get the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
#[wasm_bindgen(method, getter = "iv")]
pub fn get_iv(this: &AesCbcParams) -> ::js_sys::Object;
#[doc = "Change the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
#[wasm_bindgen(method, setter = "iv")]
fn set_iv(this: &AesCbcParams, val: &::js_sys::Object);
pub fn set_iv(this: &AesCbcParams, val: &::js_sys::Object);
}
impl AesCbcParams {
#[doc = "Construct a new `AesCbcParams`."]
Expand All @@ -36,16 +42,12 @@ impl AesCbcParams {
ret.iv(iv);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
#[deprecated = "Use `set_name()` instead."]
pub fn name(&mut self, val: &str) -> &mut Self {
self.set_name(val);
self
}
#[doc = "Change the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
#[deprecated = "Use `set_iv()` instead."]
pub fn iv(&mut self, val: &::js_sys::Object) -> &mut Self {
self.set_iv(val);
self
Expand Down
27 changes: 15 additions & 12 deletions crates/web-sys/src/features/gen_AesCtrParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,31 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesCtrParams) -> String;
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, setter = "name")]
fn set_name(this: &AesCtrParams, val: &str);
pub fn set_name(this: &AesCtrParams, val: &str);
#[doc = "Get the `counter` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, getter = "counter")]
pub fn get_counter(this: &AesCtrParams) -> ::js_sys::Object;
#[doc = "Change the `counter` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, setter = "counter")]
fn set_counter(this: &AesCtrParams, val: &::js_sys::Object);
pub fn set_counter(this: &AesCtrParams, val: &::js_sys::Object);
#[doc = "Get the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, getter = "length")]
pub fn get_length(this: &AesCtrParams) -> u8;
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[wasm_bindgen(method, setter = "length")]
fn set_length(this: &AesCtrParams, val: u8);
pub fn set_length(this: &AesCtrParams, val: u8);
}
impl AesCtrParams {
#[doc = "Construct a new `AesCtrParams`."]
Expand All @@ -44,23 +53,17 @@ impl AesCtrParams {
ret.length(length);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[deprecated = "Use `set_name()` instead."]
pub fn name(&mut self, val: &str) -> &mut Self {
self.set_name(val);
self
}
#[doc = "Change the `counter` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[deprecated = "Use `set_counter()` instead."]
pub fn counter(&mut self, val: &::js_sys::Object) -> &mut Self {
self.set_counter(val);
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
#[deprecated = "Use `set_length()` instead."]
pub fn length(&mut self, val: u8) -> &mut Self {
self.set_length(val);
self
Expand Down
18 changes: 10 additions & 8 deletions crates/web-sys/src/features/gen_AesDerivedKeyParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesDerivedKeyParams) -> String;
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
#[wasm_bindgen(method, setter = "name")]
fn set_name(this: &AesDerivedKeyParams, val: &str);
pub fn set_name(this: &AesDerivedKeyParams, val: &str);
#[doc = "Get the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
#[wasm_bindgen(method, getter = "length")]
pub fn get_length(this: &AesDerivedKeyParams) -> u32;
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
#[wasm_bindgen(method, setter = "length")]
fn set_length(this: &AesDerivedKeyParams, val: u32);
pub fn set_length(this: &AesDerivedKeyParams, val: u32);
}
impl AesDerivedKeyParams {
#[doc = "Construct a new `AesDerivedKeyParams`."]
Expand All @@ -36,16 +42,12 @@ impl AesDerivedKeyParams {
ret.length(length);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
#[deprecated = "Use `set_name()` instead."]
pub fn name(&mut self, val: &str) -> &mut Self {
self.set_name(val);
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
#[deprecated = "Use `set_length()` instead."]
pub fn length(&mut self, val: u32) -> &mut Self {
self.set_length(val);
self
Expand Down
36 changes: 20 additions & 16 deletions crates/web-sys/src/features/gen_AesGcmParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,41 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesGcmParams) -> String;
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, setter = "name")]
fn set_name(this: &AesGcmParams, val: &str);
pub fn set_name(this: &AesGcmParams, val: &str);
#[doc = "Get the `additionalData` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, getter = "additionalData")]
pub fn get_additional_data(this: &AesGcmParams) -> Option<::js_sys::Object>;
#[doc = "Change the `additionalData` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, setter = "additionalData")]
fn set_additional_data(this: &AesGcmParams, val: &::js_sys::Object);
pub fn set_additional_data(this: &AesGcmParams, val: &::js_sys::Object);
#[doc = "Get the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, getter = "iv")]
pub fn get_iv(this: &AesGcmParams) -> ::js_sys::Object;
#[doc = "Change the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, setter = "iv")]
fn set_iv(this: &AesGcmParams, val: &::js_sys::Object);
pub fn set_iv(this: &AesGcmParams, val: &::js_sys::Object);
#[doc = "Get the `tagLength` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, getter = "tagLength")]
pub fn get_tag_length(this: &AesGcmParams) -> Option<u8>;
#[doc = "Change the `tagLength` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[wasm_bindgen(method, setter = "tagLength")]
fn set_tag_length(this: &AesGcmParams, val: u8);
pub fn set_tag_length(this: &AesGcmParams, val: u8);
}
impl AesGcmParams {
#[doc = "Construct a new `AesGcmParams`."]
Expand All @@ -50,30 +62,22 @@ impl AesGcmParams {
ret.iv(iv);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[deprecated = "Use `set_name()` instead."]
pub fn name(&mut self, val: &str) -> &mut Self {
self.set_name(val);
self
}
#[doc = "Change the `additionalData` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[deprecated = "Use `set_additional_data()` instead."]
pub fn additional_data(&mut self, val: &::js_sys::Object) -> &mut Self {
self.set_additional_data(val);
self
}
#[doc = "Change the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[deprecated = "Use `set_iv()` instead."]
pub fn iv(&mut self, val: &::js_sys::Object) -> &mut Self {
self.set_iv(val);
self
}
#[doc = "Change the `tagLength` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
#[deprecated = "Use `set_tag_length()` instead."]
pub fn tag_length(&mut self, val: u8) -> &mut Self {
self.set_tag_length(val);
self
Expand Down
18 changes: 10 additions & 8 deletions crates/web-sys/src/features/gen_AesKeyAlgorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesKeyAlgorithm) -> String;
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
#[wasm_bindgen(method, setter = "name")]
fn set_name(this: &AesKeyAlgorithm, val: &str);
pub fn set_name(this: &AesKeyAlgorithm, val: &str);
#[doc = "Get the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
#[wasm_bindgen(method, getter = "length")]
pub fn get_length(this: &AesKeyAlgorithm) -> u16;
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
#[wasm_bindgen(method, setter = "length")]
fn set_length(this: &AesKeyAlgorithm, val: u16);
pub fn set_length(this: &AesKeyAlgorithm, val: u16);
}
impl AesKeyAlgorithm {
#[doc = "Construct a new `AesKeyAlgorithm`."]
Expand All @@ -36,16 +42,12 @@ impl AesKeyAlgorithm {
ret.length(length);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
#[deprecated = "Use `set_name()` instead."]
pub fn name(&mut self, val: &str) -> &mut Self {
self.set_name(val);
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
#[deprecated = "Use `set_length()` instead."]
pub fn length(&mut self, val: u16) -> &mut Self {
self.set_length(val);
self
Expand Down
18 changes: 10 additions & 8 deletions crates/web-sys/src/features/gen_AesKeyGenParams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
#[wasm_bindgen(method, getter = "name")]
pub fn get_name(this: &AesKeyGenParams) -> String;
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
#[wasm_bindgen(method, setter = "name")]
fn set_name(this: &AesKeyGenParams, val: &str);
pub fn set_name(this: &AesKeyGenParams, val: &str);
#[doc = "Get the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
#[wasm_bindgen(method, getter = "length")]
pub fn get_length(this: &AesKeyGenParams) -> u16;
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
#[wasm_bindgen(method, setter = "length")]
fn set_length(this: &AesKeyGenParams, val: u16);
pub fn set_length(this: &AesKeyGenParams, val: u16);
}
impl AesKeyGenParams {
#[doc = "Construct a new `AesKeyGenParams`."]
Expand All @@ -36,16 +42,12 @@ impl AesKeyGenParams {
ret.length(length);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
#[deprecated = "Use `set_name()` instead."]
pub fn name(&mut self, val: &str) -> &mut Self {
self.set_name(val);
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
#[deprecated = "Use `set_length()` instead."]
pub fn length(&mut self, val: u16) -> &mut Self {
self.set_length(val);
self
Expand Down
Loading

0 comments on commit b5e9e08

Please sign in to comment.