diff options
Diffstat (limited to 'vendor/js-sys')
-rw-r--r-- | vendor/js-sys/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/js-sys/Cargo.toml | 10 | ||||
-rw-r--r-- | vendor/js-sys/src/lib.rs | 232 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/Array.rs | 29 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/Intl.rs | 20 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/JSON.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/JsString.rs | 2 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/Number.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/Object.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/Set.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/SharedArrayBuffer.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/Temporal.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/TypedArray.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/WeakMap.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/WeakSet.rs | 1 | ||||
-rw-r--r-- | vendor/js-sys/tests/wasm/WebAssembly.rs | 2 |
16 files changed, 285 insertions, 21 deletions
diff --git a/vendor/js-sys/.cargo-checksum.json b/vendor/js-sys/.cargo-checksum.json index e60e652d4..b7edf5397 100644 --- a/vendor/js-sys/.cargo-checksum.json +++ b/vendor/js-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"3441ebc3918099baefa15652602bb1b2a06e1fc1de9d95e23079ef7b22832fdc","Cargo.toml":"f5194a77dfcfcc82e4a7b94fa60b08c0c7948ef215d358576849f5a9819f7d76","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"de73c6d7a9d9eac0674770fde362175700676be0dfaee0b22d4c75fdc28b068e","src/Temporal.rs":"6c3745bf5cbfbbaee3fabecd870c50669f7a4f1ee65fc96e2baa8f3e440cfe86","src/lib.rs":"209ee49d97af84ae42d9f6b55a5175b5db82ff052dc2e66662fe7f86f2167cfb","tests/headless.js":"dc0fdafb377cd6aa1415897083bbbf3d53c0ca39fc1691cc1f1fa7c528190491","tests/headless.rs":"f9eb68e88cc40fc81b7afad881fbdf2243d574f4417705226aa2102a71187e60","tests/wasm/Array.js":"c21d3d69f388ed4574fa7670c4a41240d0cfa2a374ed29f32f93069983138c72","tests/wasm/Array.rs":"c8916a57751c27fab2f73cda700794412ccf4863cbceaa50ea824d13ee76a631","tests/wasm/ArrayBuffer.rs":"a465e7cf7114e7466eb843f6612e22f00eb070dda15759bf8c62a1a3147a8c8d","tests/wasm/ArrayIterator.rs":"d849e50fbb8ebf6979e962c89210cf278176b15198c37f59cb15337e9c30ffa0","tests/wasm/BigInt.rs":"55a8070545f477acea07aebccad1bfd36bac88202923c357f894d6721046f53e","tests/wasm/Boolean.rs":"6091385e24f292a7e65809fa9cf3d328d8e65ad01fb976aef5daa2b5143224c3","tests/wasm/DataView.rs":"b1bea4a6235c406ca1df0e12daec95158c5fb663f3733a8cf986038770ae23a7","tests/wasm/Date.rs":"4de15246207a5f4c961f448dd18c743aa4ae45950571c9e4ec948272677bf584","tests/wasm/Error.rs":"3d593bdce1dee56fa2c35c290d499d687cc7f08971f89f7aa5f9b52d73af1546","tests/wasm/EvalError.rs":"638641bdd06bb43cffee89d37cd39ee615fe98d44d4c8278756a798a6593111f","tests/wasm/Function.js":"6c5876f74cf2838823470c4c007089baa17e2b28e4f602b65a4b2bc67073b9d7","tests/wasm/Function.rs":"2ccfd94e301b569d70face86d31843d095380973673a811302fb67d8d58378fe","tests/wasm/Generator.js":"7be85b1acbc2de5c3d9d8d64a396baf8c5a5b111905759315b3b395a22ea49e2","tests/wasm/Generator.rs":"860e51ccd01a06076b713445a2eff27244f5b349211a322aa9e3e8df2e76c8ce","tests/wasm/Intl.rs":"7da28d28423f925e9de5270d5c0e7bc4382a587c3c72864d142e15c2e6c7dc30","tests/wasm/Iterator.js":"525d29257a508e0cfcf4aa01dddd522d1dda6f8f968f271802ebd703e6f347d6","tests/wasm/Iterator.rs":"b2ac023d150179c0c3cd54f27f9b2775f62ad519111dc233e9ebbad5e9983193","tests/wasm/JSON.rs":"bc78a06047550271e38fa412fcb1220e49208933af6e136d7f99294240807da4","tests/wasm/JsString.js":"931aedd837c316bd7e1e2d52142a92d663e36b79995e2dde6d91c9d762095c13","tests/wasm/JsString.rs":"d5f5eff01b6ffb95e4512a1cae171537bb3ee36bbe9d17ca936714bd291b6683","tests/wasm/Map.rs":"022b4c26387190e36726b493615f9852ce40ed0c86a97db85bcf06e9086925f2","tests/wasm/MapIterator.rs":"ed0405dbc9a74885fc3c3614d08d5b7c9da2ad14e4b8d3c5f392ad03e12c61cc","tests/wasm/Math.rs":"0604f28481ac122ee88a5198c2b4f234e3f25e266f73c8e455973d486bcf4768","tests/wasm/Number.js":"a0b161084686deee75588a01834dea2bc12fde317d96bd3a0b73c825db71180f","tests/wasm/Number.rs":"ec02a3c8a39b7148b685b9b7d8bb8dd99cc33640c7e105b133c9de53eee71e10","tests/wasm/Object.js":"a8ab74505388012de784b2f62f00a57058632e02a3e4bf70f33fa0e5332ff384","tests/wasm/Object.rs":"851a89c9ec20a21ee88f05a3971a2c09baecd84bd4fb1847a8d30dad685ff2ae","tests/wasm/Promise.rs":"8c62a5c08cb43c60391f94e2d697d8925ba47069e19318a30fa64062ef372c8b","tests/wasm/Proxy.js":"63baac7050190339ed772fed09e4bd1845f34bcc36d7aa40ab2ecf93e9db786a","tests/wasm/Proxy.rs":"02d5ec8e5b781e12cdd96b38e643a4d0f6b725c0c904cc614bc83d829d501035","tests/wasm/RangeError.rs":"00a75d29880f53704c1ede81fb0f5c80efa8528a7c9f75b9f64d25234f74c3a4","tests/wasm/ReferenceError.rs":"47b60df993231f4631de2b9317bc1ac0a968976747f05d9b655dc61bcf2a58b4","tests/wasm/Reflect.js":"e5c43d410802ed45f38bffe60d0313dfcb978ac29a748258e889fbb3efa6d64a","tests/wasm/Reflect.rs":"f8bd8876b6bc1740652d51b6bad948eac7eb49541a08e2fe32a85043f9e0aa65","tests/wasm/RegExp.rs":"f91a9c838921832299185582900df6132dd5263fdcce4cc5342b6a1575d727b7","tests/wasm/Set.rs":"c22ca4651d472eedaadcfb03cfbb5c7d37f449cc073586db8ea97299f5d40b63","tests/wasm/SetIterator.rs":"0ad63f4852adcd91a40ffc1d95bb269e23bc338666acdc85a9516c492d5e1561","tests/wasm/SharedArrayBuffer.js":"6d30cec14dfc5890c8303cd1b81da235bce8a37d730232fc8b0d050f0e1db1b2","tests/wasm/SharedArrayBuffer.rs":"1cbf97431f693297d86de8477b3eb5c2f6e36111c0723d3de51ba9c677c5e289","tests/wasm/Symbol.js":"76c6c15f9fd34ffb7efddc90e898e12be074e9c98e066076a2b46f0554754de2","tests/wasm/Symbol.rs":"ae91d396b867bdfd9fd0c66b8863fb8e5c569886eeec98ae6cbd0ffad1a952a8","tests/wasm/SyntaxError.rs":"526ae9168f4979594e9d44f456e6b2816e38860ebf5937c2c905577aae5be7c0","tests/wasm/Temporal.js":"83312c76bdaa0893b7a6d638ccedb5a3d35f9beeb36977e608a739a81a2f4460","tests/wasm/Temporal.rs":"c7daa8e9e3f1e134ea08bb1a29879d8b515c6db3f7e53d1bc3af12ac4bae4ed8","tests/wasm/TypeError.rs":"618530b6556daad348106bd1c48c6dd808f54fe4efb344b15238db4ec3254d9f","tests/wasm/TypedArray.rs":"e6e1a350e10f7244eb669858d0a6d1e4a1007d57bd34508d685d2b6d43b38896","tests/wasm/UriError.rs":"2e695b4823e8875aa72c41aa6679e4d3f924adf47b763cb4462cf96ecdacfda6","tests/wasm/WeakMap.rs":"300bf589a0cfb0b0d3c3534222c949406bb3b9b408bc44cd54a72e3642987782","tests/wasm/WeakSet.rs":"321e780b427e4e4779c69839e6731840b1869d18ece0d71994ae1ef1fd804a8f","tests/wasm/WebAssembly.js":"5870c3811c8c17bab0b0e14c5ed62af987b8fa52382572a27cf704cded30f061","tests/wasm/WebAssembly.rs":"ddc4d36238a1b36ff9c949d4e9c73b7eb055c0c04b28cf262d2ccb55ffd7bc54","tests/wasm/global_fns.rs":"34e12bfd548b8710297087920599d97e31971d142a8b0c4acb5712f71f1213d3","tests/wasm/main.rs":"e07b9a62897df33dba3d0962f403b19574d5cd99cd2e08e316be364c7a73d7e7"},"package":"49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"}
\ No newline at end of file +{"files":{"CHANGELOG.md":"3441ebc3918099baefa15652602bb1b2a06e1fc1de9d95e23079ef7b22832fdc","Cargo.toml":"fcec0421c41ea8276693ff1266ff2eb8312a1ab3798a19e8f5c95342202aac62","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"de73c6d7a9d9eac0674770fde362175700676be0dfaee0b22d4c75fdc28b068e","src/Temporal.rs":"6c3745bf5cbfbbaee3fabecd870c50669f7a4f1ee65fc96e2baa8f3e440cfe86","src/lib.rs":"7d9415daae0f8a22cab0f0df6d22a24a064fb65233519042e750fbb9d6ae471f","tests/headless.js":"dc0fdafb377cd6aa1415897083bbbf3d53c0ca39fc1691cc1f1fa7c528190491","tests/headless.rs":"f9eb68e88cc40fc81b7afad881fbdf2243d574f4417705226aa2102a71187e60","tests/wasm/Array.js":"c21d3d69f388ed4574fa7670c4a41240d0cfa2a374ed29f32f93069983138c72","tests/wasm/Array.rs":"a72124c18addf94bd5a8c96c2f5ee59ba6f387dff404576a5295b52dda96879d","tests/wasm/ArrayBuffer.rs":"a465e7cf7114e7466eb843f6612e22f00eb070dda15759bf8c62a1a3147a8c8d","tests/wasm/ArrayIterator.rs":"d849e50fbb8ebf6979e962c89210cf278176b15198c37f59cb15337e9c30ffa0","tests/wasm/BigInt.rs":"55a8070545f477acea07aebccad1bfd36bac88202923c357f894d6721046f53e","tests/wasm/Boolean.rs":"6091385e24f292a7e65809fa9cf3d328d8e65ad01fb976aef5daa2b5143224c3","tests/wasm/DataView.rs":"b1bea4a6235c406ca1df0e12daec95158c5fb663f3733a8cf986038770ae23a7","tests/wasm/Date.rs":"4de15246207a5f4c961f448dd18c743aa4ae45950571c9e4ec948272677bf584","tests/wasm/Error.rs":"3d593bdce1dee56fa2c35c290d499d687cc7f08971f89f7aa5f9b52d73af1546","tests/wasm/EvalError.rs":"638641bdd06bb43cffee89d37cd39ee615fe98d44d4c8278756a798a6593111f","tests/wasm/Function.js":"6c5876f74cf2838823470c4c007089baa17e2b28e4f602b65a4b2bc67073b9d7","tests/wasm/Function.rs":"2ccfd94e301b569d70face86d31843d095380973673a811302fb67d8d58378fe","tests/wasm/Generator.js":"7be85b1acbc2de5c3d9d8d64a396baf8c5a5b111905759315b3b395a22ea49e2","tests/wasm/Generator.rs":"860e51ccd01a06076b713445a2eff27244f5b349211a322aa9e3e8df2e76c8ce","tests/wasm/Intl.rs":"93ffd147882daca4f482aaa6d18d013c854dfd0bd3d7631e6128c91e88612cc2","tests/wasm/Iterator.js":"525d29257a508e0cfcf4aa01dddd522d1dda6f8f968f271802ebd703e6f347d6","tests/wasm/Iterator.rs":"b2ac023d150179c0c3cd54f27f9b2775f62ad519111dc233e9ebbad5e9983193","tests/wasm/JSON.rs":"a8bf63aa9cbc64448ad320d88224f435cd2980f980b1c0da3ff1c8c3a935399e","tests/wasm/JsString.js":"931aedd837c316bd7e1e2d52142a92d663e36b79995e2dde6d91c9d762095c13","tests/wasm/JsString.rs":"6aa441665ee43d84b13ec0b021d4544b5b0bdbe2cee2329cfb8a00770964390b","tests/wasm/Map.rs":"022b4c26387190e36726b493615f9852ce40ed0c86a97db85bcf06e9086925f2","tests/wasm/MapIterator.rs":"ed0405dbc9a74885fc3c3614d08d5b7c9da2ad14e4b8d3c5f392ad03e12c61cc","tests/wasm/Math.rs":"0604f28481ac122ee88a5198c2b4f234e3f25e266f73c8e455973d486bcf4768","tests/wasm/Number.js":"a0b161084686deee75588a01834dea2bc12fde317d96bd3a0b73c825db71180f","tests/wasm/Number.rs":"3965a281c43e26659391e02ac7fa76de93ebe582858b53f0ca764e61e922f371","tests/wasm/Object.js":"a8ab74505388012de784b2f62f00a57058632e02a3e4bf70f33fa0e5332ff384","tests/wasm/Object.rs":"c8010cd257ba0a49dc864936104cb19c59f9e7801f5b296d909b772aa1f29fb3","tests/wasm/Promise.rs":"8c62a5c08cb43c60391f94e2d697d8925ba47069e19318a30fa64062ef372c8b","tests/wasm/Proxy.js":"63baac7050190339ed772fed09e4bd1845f34bcc36d7aa40ab2ecf93e9db786a","tests/wasm/Proxy.rs":"02d5ec8e5b781e12cdd96b38e643a4d0f6b725c0c904cc614bc83d829d501035","tests/wasm/RangeError.rs":"00a75d29880f53704c1ede81fb0f5c80efa8528a7c9f75b9f64d25234f74c3a4","tests/wasm/ReferenceError.rs":"47b60df993231f4631de2b9317bc1ac0a968976747f05d9b655dc61bcf2a58b4","tests/wasm/Reflect.js":"e5c43d410802ed45f38bffe60d0313dfcb978ac29a748258e889fbb3efa6d64a","tests/wasm/Reflect.rs":"f8bd8876b6bc1740652d51b6bad948eac7eb49541a08e2fe32a85043f9e0aa65","tests/wasm/RegExp.rs":"f91a9c838921832299185582900df6132dd5263fdcce4cc5342b6a1575d727b7","tests/wasm/Set.rs":"ccd68d9240f52d5129169f999a2d782c29c3e00d77f47521c9c4c3158d4f41cd","tests/wasm/SetIterator.rs":"0ad63f4852adcd91a40ffc1d95bb269e23bc338666acdc85a9516c492d5e1561","tests/wasm/SharedArrayBuffer.js":"6d30cec14dfc5890c8303cd1b81da235bce8a37d730232fc8b0d050f0e1db1b2","tests/wasm/SharedArrayBuffer.rs":"fadefea98f3c61aa5ab04f7f5f182a5f73c3436da39c35e9b48e95e7f57a5100","tests/wasm/Symbol.js":"76c6c15f9fd34ffb7efddc90e898e12be074e9c98e066076a2b46f0554754de2","tests/wasm/Symbol.rs":"ae91d396b867bdfd9fd0c66b8863fb8e5c569886eeec98ae6cbd0ffad1a952a8","tests/wasm/SyntaxError.rs":"526ae9168f4979594e9d44f456e6b2816e38860ebf5937c2c905577aae5be7c0","tests/wasm/Temporal.js":"83312c76bdaa0893b7a6d638ccedb5a3d35f9beeb36977e608a739a81a2f4460","tests/wasm/Temporal.rs":"36423a29a94c0d1a218fe2f34384ddb5ec30c8a812ce8a4635579f0d61496b17","tests/wasm/TypeError.rs":"618530b6556daad348106bd1c48c6dd808f54fe4efb344b15238db4ec3254d9f","tests/wasm/TypedArray.rs":"8f70281c9a976e2bcbb67618200151635b8777f2819ca2c67faf4ff5eb248c26","tests/wasm/UriError.rs":"2e695b4823e8875aa72c41aa6679e4d3f924adf47b763cb4462cf96ecdacfda6","tests/wasm/WeakMap.rs":"930498b116924eda0d40ea11c73adbfc049ffd0f11e259f1faf29e090eeea853","tests/wasm/WeakSet.rs":"59c80b6ac0f60fe8499884ee4842b8a4f12039c6c29c58a329e85c187d42c94c","tests/wasm/WebAssembly.js":"5870c3811c8c17bab0b0e14c5ed62af987b8fa52382572a27cf704cded30f061","tests/wasm/WebAssembly.rs":"7b234b6dcea00d9cd37854de020247facd22af90ef1012b5d1a1b35f7c828cb8","tests/wasm/global_fns.rs":"34e12bfd548b8710297087920599d97e31971d142a8b0c4acb5712f71f1213d3","tests/wasm/main.rs":"e07b9a62897df33dba3d0962f403b19574d5cd99cd2e08e316be364c7a73d7e7"},"package":"445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730"}
\ No newline at end of file diff --git a/vendor/js-sys/Cargo.toml b/vendor/js-sys/Cargo.toml index a5643083a..fe5400815 100644 --- a/vendor/js-sys/Cargo.toml +++ b/vendor/js-sys/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "js-sys" -version = "0.3.60" +version = "0.3.61" authors = ["The wasm-bindgen Developers"] description = """ Bindings for all JS global objects and functions in all JS environments like @@ -30,16 +30,16 @@ test = false doctest = false [dependencies.wasm-bindgen] -version = "0.2.83" +version = "0.2.84" [target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-futures] -version = "0.4.33" +version = "0.4.34" [target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-test] -version = "=0.3.33" +version = "=0.3.34" [target."cfg(target_arch = \"wasm32\")".dev-dependencies.web-sys] -version = "0.3.60" +version = "0.3.61" features = [ "Headers", "Response", diff --git a/vendor/js-sys/src/lib.rs b/vendor/js-sys/src/lib.rs index 12fef1cb7..92890a62b 100644 --- a/vendor/js-sys/src/lib.rs +++ b/vendor/js-sys/src/lib.rs @@ -29,7 +29,6 @@ use std::str; use std::str::FromStr; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; // When adding new imports: // @@ -448,6 +447,19 @@ extern "C" { #[wasm_bindgen(method, getter, structural)] pub fn length(this: &Array) -> u32; + /// Sets the length of the array. + /// + /// If it is set to less than the current length of the array, it will + /// shrink the array. + /// + /// If it is set to more than the current length of the array, it will + /// increase the length of the array, filling the new space with empty + /// slots. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) + #[wasm_bindgen(method, setter)] + pub fn set_length(this: &Array, value: u32); + /// `map()` calls a provided callback function once for each element in an array, /// in order, and constructs a new array from the results. callback is invoked /// only for indexes of the array which have assigned values, including undefined. @@ -823,20 +835,47 @@ pub mod Atomics { /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `add_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/add) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn add(typed_array: &JsValue, index: u32, value: i32) -> Result<i32, JsValue>; + /// The static `Atomics.add()` method adds a given value at a given + /// position in the array and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/add) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = add)] + pub fn add_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result<i64, JsValue>; + /// The static `Atomics.and()` method computes a bitwise AND with a given /// value at a given position in the array, and returns the old value /// at that position. /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `and_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/and) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn and(typed_array: &JsValue, index: u32, value: i32) -> Result<i32, JsValue>; + /// The static `Atomics.and()` method computes a bitwise AND with a given + /// value at a given position in the array, and returns the old value + /// at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/and) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = and)] + pub fn and_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result<i64, JsValue>; + /// The static `Atomics.compareExchange()` method exchanges a given /// replacement value at a given position in the array, if a given expected /// value equals the old value. It returns the old value at that position @@ -844,6 +883,8 @@ pub mod Atomics { /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `compare_exchange_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/compareExchange) #[wasm_bindgen(js_namespace = Atomics, catch, js_name = compareExchange)] pub fn compare_exchange( @@ -853,15 +894,50 @@ pub mod Atomics { replacement_value: i32, ) -> Result<i32, JsValue>; + /// The static `Atomics.compareExchange()` method exchanges a given + /// replacement value at a given position in the array, if a given expected + /// value equals the old value. It returns the old value at that position + /// whether it was equal to the expected value or not. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/compareExchange) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = compareExchange)] + pub fn compare_exchange_bigint( + typed_array: &JsValue, + index: u32, + expected_value: i64, + replacement_value: i64, + ) -> Result<i64, JsValue>; + /// The static `Atomics.exchange()` method stores a given value at a given /// position in the array and returns the old value at that position. /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `exchange_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/exchange) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn exchange(typed_array: &JsValue, index: u32, value: i32) -> Result<i32, JsValue>; + /// The static `Atomics.exchange()` method stores a given value at a given + /// position in the array and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/exchange) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = exchange)] + pub fn exchange_bigint( + typed_array: &JsValue, + index: u32, + value: i64, + ) -> Result<i64, JsValue>; + /// The static `Atomics.isLockFree()` method is used to determine /// whether to use locks or atomic operations. It returns true, /// if the given size is one of the `BYTES_PER_ELEMENT` property @@ -874,10 +950,21 @@ pub mod Atomics { /// The static `Atomics.load()` method returns a value at a given /// position in the array. /// + /// You should use `load_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/load) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn load(typed_array: &JsValue, index: u32) -> Result<i32, JsValue>; + /// The static `Atomics.load()` method returns a value at a given + /// position in the array. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/load) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = load)] + pub fn load_bigint(typed_array: &JsValue, index: i64) -> Result<i64, JsValue>; + /// The static `Atomics.notify()` method notifies up some agents that /// are sleeping in the wait queue. /// Note: This operation works with a shared `Int32Array` only. @@ -900,26 +987,63 @@ pub mod Atomics { /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `or_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/or) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn or(typed_array: &JsValue, index: u32, value: i32) -> Result<i32, JsValue>; + /// The static `Atomics.or()` method computes a bitwise OR with a given value + /// at a given position in the array, and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/or) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = or)] + pub fn or_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result<i64, JsValue>; + /// The static `Atomics.store()` method stores a given value at the given /// position in the array and returns that value. /// + /// You should use `store_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/store) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn store(typed_array: &JsValue, index: u32, value: i32) -> Result<i32, JsValue>; + /// The static `Atomics.store()` method stores a given value at the given + /// position in the array and returns that value. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/store) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = store)] + pub fn store_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result<i64, JsValue>; + /// The static `Atomics.sub()` method substracts a given value at a /// given position in the array and returns the old value at that position. /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `sub_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/sub) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn sub(typed_array: &JsValue, index: u32, value: i32) -> Result<i32, JsValue>; + /// The static `Atomics.sub()` method substracts a given value at a + /// given position in the array and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/sub) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = sub)] + pub fn sub_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result<i64, JsValue>; + /// The static `Atomics.wait()` method verifies that a given /// position in an `Int32Array` still contains a given value /// and if so sleeps, awaiting a wakeup or a timeout. @@ -927,12 +1051,33 @@ pub mod Atomics { /// Note: This operation only works with a shared `Int32Array` /// and may not be allowed on the main thread. /// + /// You should use `wait_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn wait(typed_array: &Int32Array, index: u32, value: i32) -> Result<JsString, JsValue>; + /// The static `Atomics.wait()` method verifies that a given + /// position in an `Int32Array` still contains a given value + /// and if so sleeps, awaiting a wakeup or a timeout. + /// It returns a string which is either "ok", "not-equal", or "timed-out". + /// Note: This operation only works with a shared `Int32Array` + /// and may not be allowed on the main thread. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)] + pub fn wait_bigint( + typed_array: &Int32Array, + index: u32, + value: i64, + ) -> Result<JsString, JsValue>; + /// Like `wait()`, but with timeout /// + /// You should use `wait_with_timeout_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait) #[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)] pub fn wait_with_timeout( @@ -942,15 +1087,42 @@ pub mod Atomics { timeout: f64, ) -> Result<JsString, JsValue>; + /// Like `wait()`, but with timeout + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)] + pub fn wait_with_timeout_bigint( + typed_array: &Int32Array, + index: u32, + value: i64, + timeout: f64, + ) -> Result<JsString, JsValue>; + /// The static `Atomics.xor()` method computes a bitwise XOR /// with a given value at a given position in the array, /// and returns the old value at that position. /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `xor_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/xor) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn xor(typed_array: &JsValue, index: u32, value: i32) -> Result<i32, JsValue>; + + /// The static `Atomics.xor()` method computes a bitwise XOR + /// with a given value at a given position in the array, + /// and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/xor) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = xor)] + pub fn xor_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result<i64, JsValue>; } } @@ -5368,6 +5540,64 @@ pub mod Intl { ) } } + + // Intl.RelativeTimeFormat + #[wasm_bindgen] + extern "C" { + /// The `Intl.RelativeTimeFormat` object is a constructor for objects + /// that enable language-sensitive relative time formatting. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) + #[wasm_bindgen(extends = Object, js_namespace = Intl, typescript_type = "Intl.RelativeTimeFormat")] + #[derive(Clone, Debug)] + pub type RelativeTimeFormat; + + /// The `Intl.RelativeTimeFormat` object is a constructor for objects + /// that enable language-sensitive relative time formatting. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) + #[wasm_bindgen(constructor, js_namespace = Intl)] + pub fn new(locales: &Array, options: &Object) -> RelativeTimeFormat; + + /// The `Intl.RelativeTimeFormat.prototype.format` method formats a `value` and `unit` + /// according to the locale and formatting options of this Intl.RelativeTimeFormat object. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format) + #[wasm_bindgen(method, js_class = "Intl.RelativeTimeFormat")] + pub fn format(this: &RelativeTimeFormat, value: f64, unit: &str) -> JsString; + + /// The `Intl.RelativeTimeFormat.prototype.formatToParts()` method returns an array of + /// objects representing the relative time format in parts that can be used for custom locale-aware formatting. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts) + #[wasm_bindgen(method, js_class = "Intl.RelativeTimeFormat", js_name = formatToParts)] + pub fn format_to_parts(this: &RelativeTimeFormat, value: f64, unit: &str) -> Array; + + /// The `Intl.RelativeTimeFormat.prototype.resolvedOptions()` method returns a new + /// object with properties reflecting the locale and relative time formatting + /// options computed during initialization of this RelativeTimeFormat object. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions) + #[wasm_bindgen(method, js_namespace = Intl, js_name = resolvedOptions)] + pub fn resolved_options(this: &RelativeTimeFormat) -> Object; + + /// The `Intl.RelativeTimeFormat.supportedLocalesOf()` method returns an array + /// containing those of the provided locales that are supported in date and time + /// formatting without having to fall back to the runtime's default locale. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat/supportedLocalesOf) + #[wasm_bindgen(static_method_of = RelativeTimeFormat, js_namespace = Intl, js_name = supportedLocalesOf)] + pub fn supported_locales_of(locales: &Array, options: &Object) -> Array; + } + + impl Default for RelativeTimeFormat { + fn default() -> Self { + Self::new( + &JsValue::UNDEFINED.unchecked_into(), + &JsValue::UNDEFINED.unchecked_into(), + ) + } + } } // Promise diff --git a/vendor/js-sys/tests/wasm/Array.rs b/vendor/js-sys/tests/wasm/Array.rs index e498c2cc0..3934389f0 100644 --- a/vendor/js-sys/tests/wasm/Array.rs +++ b/vendor/js-sys/tests/wasm/Array.rs @@ -1,8 +1,6 @@ use js_sys::*; use std::iter::FromIterator; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; -use wasm_bindgen::JsValue; use wasm_bindgen_test::*; macro_rules! js_array { @@ -537,6 +535,33 @@ fn for_each() { } #[wasm_bindgen_test] +fn set_length() { + let array = js_array![1, 2, 3, 4, 5]; + array.set_length(3); + assert_eq!( + array.iter().collect::<Vec<_>>(), + [1.0, 2.0, 3.0].map(|x| JsValue::from_f64(x)) + ); + + array.set_length(7); + assert_eq!( + array.iter().collect::<Vec<_>>(), + [1.0, 2.0, 3.0] + .iter() + .copied() + .map(|x| JsValue::from_f64(x)) + .chain([JsValue::UNDEFINED; 4]) + .collect::<Vec<_>>() + ); + + let mut calls = 0; + array.for_each(&mut |_, _, _| calls += 1); + // The later elements don't get filled with `undefined`, they get filled with + // empty slots, which get skipped by `for_each`. + assert_eq!(calls, 3); +} + +#[wasm_bindgen_test] fn array_inheritance() { let array = Array::new(); assert!(array.is_instance_of::<Array>()); diff --git a/vendor/js-sys/tests/wasm/Intl.rs b/vendor/js-sys/tests/wasm/Intl.rs index 427ea00a5..a58d12abe 100644 --- a/vendor/js-sys/tests/wasm/Intl.rs +++ b/vendor/js-sys/tests/wasm/Intl.rs @@ -113,6 +113,26 @@ fn plural_rules() { } #[wasm_bindgen_test] +fn relative_time_format() { + let locales = Array::of1(&JsValue::from("en-US")); + let opts = Object::new(); + + let c = Intl::RelativeTimeFormat::new(&locales, &opts); + assert!(c.format(1_f64.into(), &"seconds").is_string()); + assert!(c + .format_to_parts(1_f64.into(), &"seconds") + .is_instance_of::<Array>()); + assert!(c.resolved_options().is_instance_of::<Object>()); + + assert_eq!(c.format(1_f64.into(), &"seconds"), "in 1 second"); + assert_eq!(c.format(1.5.into(), &"seconds"), "in 1.5 seconds"); + assert_eq!(c.format((-1.5).into(), &"seconds"), "1.5 seconds ago"); + + let a = Intl::RelativeTimeFormat::supported_locales_of(&locales, &opts); + assert!(a.is_instance_of::<Array>()); +} + +#[wasm_bindgen_test] fn plural_rules_inheritance() { let locales = Array::of1(&JsValue::from("en-US")); let opts = Object::new(); diff --git a/vendor/js-sys/tests/wasm/JSON.rs b/vendor/js-sys/tests/wasm/JSON.rs index 920ac1d6f..a5b006759 100644 --- a/vendor/js-sys/tests/wasm/JSON.rs +++ b/vendor/js-sys/tests/wasm/JSON.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen_test] diff --git a/vendor/js-sys/tests/wasm/JsString.rs b/vendor/js-sys/tests/wasm/JsString.rs index 33cd53bce..c96046234 100644 --- a/vendor/js-sys/tests/wasm/JsString.rs +++ b/vendor/js-sys/tests/wasm/JsString.rs @@ -1,7 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; -use wasm_bindgen::JsValue; use wasm_bindgen_test::*; #[wasm_bindgen(module = "tests/wasm/JsString.js")] diff --git a/vendor/js-sys/tests/wasm/Number.rs b/vendor/js-sys/tests/wasm/Number.rs index 6c3416eda..94fd551f3 100644 --- a/vendor/js-sys/tests/wasm/Number.rs +++ b/vendor/js-sys/tests/wasm/Number.rs @@ -2,7 +2,6 @@ use std::f64::{INFINITY, NAN}; use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen(module = "tests/wasm/Number.js")] diff --git a/vendor/js-sys/tests/wasm/Object.rs b/vendor/js-sys/tests/wasm/Object.rs index 4f1ade972..69db1af3a 100644 --- a/vendor/js-sys/tests/wasm/Object.rs +++ b/vendor/js-sys/tests/wasm/Object.rs @@ -1,7 +1,6 @@ use js_sys::*; use std::f64::NAN; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen] diff --git a/vendor/js-sys/tests/wasm/Set.rs b/vendor/js-sys/tests/wasm/Set.rs index 045e192e6..94905bef1 100644 --- a/vendor/js-sys/tests/wasm/Set.rs +++ b/vendor/js-sys/tests/wasm/Set.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; fn set2vec(s: &Set) -> Vec<JsValue> { diff --git a/vendor/js-sys/tests/wasm/SharedArrayBuffer.rs b/vendor/js-sys/tests/wasm/SharedArrayBuffer.rs index fdfd55d9b..6b50d7278 100644 --- a/vendor/js-sys/tests/wasm/SharedArrayBuffer.rs +++ b/vendor/js-sys/tests/wasm/SharedArrayBuffer.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen(module = "tests/wasm/SharedArrayBuffer.js")] diff --git a/vendor/js-sys/tests/wasm/Temporal.rs b/vendor/js-sys/tests/wasm/Temporal.rs index 5ea651bee..feff11991 100644 --- a/vendor/js-sys/tests/wasm/Temporal.rs +++ b/vendor/js-sys/tests/wasm/Temporal.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen(module = "tests/wasm/Temporal.js")] diff --git a/vendor/js-sys/tests/wasm/TypedArray.rs b/vendor/js-sys/tests/wasm/TypedArray.rs index ef06a4c44..653e6ea72 100644 --- a/vendor/js-sys/tests/wasm/TypedArray.rs +++ b/vendor/js-sys/tests/wasm/TypedArray.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; macro_rules! each { diff --git a/vendor/js-sys/tests/wasm/WeakMap.rs b/vendor/js-sys/tests/wasm/WeakMap.rs index 1eab1cb9d..b308c05f4 100644 --- a/vendor/js-sys/tests/wasm/WeakMap.rs +++ b/vendor/js-sys/tests/wasm/WeakMap.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen] diff --git a/vendor/js-sys/tests/wasm/WeakSet.rs b/vendor/js-sys/tests/wasm/WeakSet.rs index 094038b5f..2e5d576d2 100644 --- a/vendor/js-sys/tests/wasm/WeakSet.rs +++ b/vendor/js-sys/tests/wasm/WeakSet.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen] diff --git a/vendor/js-sys/tests/wasm/WebAssembly.rs b/vendor/js-sys/tests/wasm/WebAssembly.rs index 8f9a5b632..8a9b6ce18 100644 --- a/vendor/js-sys/tests/wasm/WebAssembly.rs +++ b/vendor/js-sys/tests/wasm/WebAssembly.rs @@ -1,5 +1,5 @@ use js_sys::*; -use wasm_bindgen::{prelude::*, JsCast}; +use wasm_bindgen::prelude::*; use wasm_bindgen_futures::JsFuture; use wasm_bindgen_test::*; use web_sys::{Headers, Response, ResponseInit}; |