Port WeakMap tests to wasm

This commit is contained in:
Alex Crichton
2018-07-20 17:01:26 -07:00
parent b667cafb63
commit 1d1df09e60
5 changed files with 57 additions and 188 deletions

View File

@ -2253,28 +2253,28 @@ extern "C" {
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set
#[wasm_bindgen(method, js_class = "WeakMap")]
pub fn set(this: &WeakMap, key: Object, value: JsValue) -> WeakMap;
pub fn set(this: &WeakMap, key: &Object, value: JsValue) -> WeakMap;
/// The get() method returns a specified by key element
/// from a [`WeakMap`] object.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get
#[wasm_bindgen(method)]
pub fn get(this: &WeakMap, key: Object) -> JsValue;
pub fn get(this: &WeakMap, key: &Object) -> JsValue;
/// The `has()` method returns a boolean indicating whether an element with
/// the specified key exists in the [`WeakMap`] object or not.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has
#[wasm_bindgen(method)]
pub fn has(this: &WeakMap, key: Object) -> bool;
pub fn has(this: &WeakMap, key: &Object) -> bool;
/// The `delete()` method removes the specified element from a [`WeakMap`]
/// object.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete
#[wasm_bindgen(method)]
pub fn delete(this: &WeakMap, key: Object) -> bool;
pub fn delete(this: &WeakMap, key: &Object) -> bool;
}
// WeakSet