-
-
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.
Apply transformations even if the shim is empty (#4366)
- Loading branch information
Showing
6 changed files
with
86 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export function causes_error(): number; |
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,57 @@ | ||
let wasm; | ||
export function __wbg_set_wasm(val) { | ||
wasm = val; | ||
} | ||
|
||
|
||
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)); | ||
} | ||
|
||
function takeFromExternrefTable0(idx) { | ||
const value = wasm.__wbindgen_export_0.get(idx); | ||
wasm.__externref_table_dealloc(idx); | ||
return value; | ||
} | ||
/** | ||
* @returns {number} | ||
*/ | ||
export function causes_error() { | ||
const ret = wasm.causes_error(); | ||
if (ret[2]) { | ||
throw takeFromExternrefTable0(ret[1]); | ||
} | ||
return ret[0]; | ||
} | ||
|
||
export function __wbindgen_init_externref_table() { | ||
const table = wasm.__wbindgen_export_0; | ||
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,6 @@ | ||
use wasm_bindgen::prelude::*; | ||
|
||
#[wasm_bindgen] | ||
pub fn causes_error() -> Result<f64, JsError> { | ||
Ok(1.0) | ||
} |
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,17 @@ | ||
(module $reference_test.wasm | ||
(type (;0;) (func)) | ||
(type (;1;) (func (result f64 i32 i32))) | ||
(type (;2;) (func (param i32))) | ||
(import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) | ||
(func $__externref_table_dealloc (;1;) (type 2) (param i32)) | ||
(func $"causes_error multivalue shim" (;2;) (type 1) (result f64 i32 i32)) | ||
(table (;0;) 128 externref) | ||
(memory (;0;) 17) | ||
(export "memory" (memory 0)) | ||
(export "causes_error" (func $"causes_error multivalue shim")) | ||
(export "__wbindgen_export_0" (table 0)) | ||
(export "__externref_table_dealloc" (func $__externref_table_dealloc)) | ||
(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