1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(typescript_type = "(typeof memory)")]
type Memory;
#[wasm_bindgen]
static memory: Memory;
#[wasm_bindgen(method, structural, indexing_getter)]
fn get(this: &Memory, prop: &JsValue) -> JsValue;
#[wasm_bindgen(method, structural, indexing_setter)]
fn set(this: &Memory, prop: &JsValue, val: &JsValue);
#[wasm_bindgen(method, structural, indexing_deleter)]
fn delete(this: &Memory, prop: &JsValue);
}
#[inline(always)]
pub fn get(prop: &JsValue) -> JsValue {
memory.get(prop)
}
#[inline(always)]
pub fn set(prop: &JsValue, val: &JsValue) {
memory.set(prop, val)
}
#[inline(always)]
pub fn delete(prop: &JsValue) {
memory.delete(prop)
}