-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michael Schmidt <[email protected]>
- Loading branch information
1 parent
4e77a61
commit 89f2af8
Showing
11 changed files
with
226 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export function exported(): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
let wasm; | ||
export function __wbg_set_wasm(val) { | ||
wasm = val; | ||
} | ||
|
||
|
||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
|
||
function addToExternrefTable0(obj) { | ||
const idx = wasm.__externref_table_alloc(); | ||
wasm.__wbindgen_export_1.set(idx, obj); | ||
return idx; | ||
} | ||
|
||
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; | ||
|
||
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
|
||
cachedTextDecoder.decode(); | ||
|
||
let cachedUint8ArrayMemory0 = null; | ||
|
||
function getUint8ArrayMemory0() { | ||
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { | ||
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8ArrayMemory0; | ||
} | ||
|
||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); | ||
} | ||
|
||
export function exported() { | ||
wasm.exported(); | ||
} | ||
|
||
export function __wbg_static_accessor_NAMESPACE_OPTIONAL_c9a4344c544120f4() { | ||
const ret = typeof test === 'undefined' ? null : test?.NAMESPACE_OPTIONAL; | ||
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); | ||
}; | ||
|
||
export function __wbg_static_accessor_NAMESPACE_PLAIN_784c8d7f5bbac62a() { | ||
const ret = test.NAMESPACE_PLAIN; | ||
return ret; | ||
}; | ||
|
||
export function __wbg_static_accessor_NESTED_NAMESPACE_OPTIONAL_a414abbeb018a35a() { | ||
const ret = typeof test1 === 'undefined' ? null : test1?.test2?.NESTED_NAMESPACE_OPTIONAL; | ||
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); | ||
}; | ||
|
||
export function __wbg_static_accessor_NESTED_NAMESPACE_PLAIN_1121b285cb8479df() { | ||
const ret = test1.test2.NESTED_NAMESPACE_PLAIN; | ||
return ret; | ||
}; | ||
|
||
export function __wbg_static_accessor_OPTIONAL_ade71b6402851d0c() { | ||
const ret = typeof OPTIONAL === 'undefined' ? null : OPTIONAL; | ||
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); | ||
}; | ||
|
||
export function __wbg_static_accessor_PLAIN_c0f08eb2f0db194c() { | ||
const ret = PLAIN; | ||
return ret; | ||
}; | ||
|
||
export function __wbindgen_init_externref_table() { | ||
const table = wasm.__wbindgen_export_1; | ||
const offset = table.grow(4); | ||
table.set(0, undefined); | ||
table.set(offset + 0, undefined); | ||
table.set(offset + 1, null); | ||
table.set(offset + 2, true); | ||
table.set(offset + 3, false); | ||
; | ||
}; | ||
|
||
export function __wbindgen_throw(arg0, arg1) { | ||
throw new Error(getStringFromWasm0(arg0, arg1)); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// DEPENDENCY: js-sys = { path = '{root}/crates/js-sys' } | ||
|
||
use wasm_bindgen::prelude::*; | ||
use js_sys::Number; | ||
|
||
#[wasm_bindgen] | ||
extern "C" { | ||
#[wasm_bindgen(thread_local_v2)] | ||
static PLAIN: JsValue; | ||
#[wasm_bindgen(thread_local_v2)] | ||
static OPTIONAL: Option<Number>; | ||
#[wasm_bindgen(thread_local_v2, js_namespace = test)] | ||
static NAMESPACE_PLAIN: JsValue; | ||
#[wasm_bindgen(thread_local_v2, js_namespace = test)] | ||
static NAMESPACE_OPTIONAL: Option<Number>; | ||
#[wasm_bindgen(thread_local_v2, js_namespace = ["test1", "test2"])] | ||
static NESTED_NAMESPACE_PLAIN: JsValue; | ||
#[wasm_bindgen(thread_local_v2, js_namespace = ["test1", "test2"])] | ||
static NESTED_NAMESPACE_OPTIONAL: Option<Number>; | ||
} | ||
|
||
#[wasm_bindgen] | ||
pub fn exported() { | ||
let _ = PLAIN.with(JsValue::clone); | ||
let _ = OPTIONAL.with(Option::clone); | ||
let _ = NAMESPACE_PLAIN.with(JsValue::clone); | ||
let _ = NAMESPACE_OPTIONAL.with(Option::clone); | ||
let _ = NESTED_NAMESPACE_PLAIN.with(JsValue::clone); | ||
let _ = NESTED_NAMESPACE_OPTIONAL.with(Option::clone); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(module $reference_test.wasm | ||
(type (;0;) (func)) | ||
(type (;1;) (func (result i32))) | ||
(import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) | ||
(func $__externref_table_alloc (;1;) (type 1) (result i32)) | ||
(func $exported (;2;) (type 0)) | ||
(table (;0;) 128 externref) | ||
(memory (;0;) 17) | ||
(export "memory" (memory 0)) | ||
(export "exported" (func $exported)) | ||
(export "__externref_table_alloc" (func $__externref_table_alloc)) | ||
(export "__wbindgen_export_1" (table 0)) | ||
(export "__wbindgen_start" (func 0)) | ||
(@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters