f
Size: a a a
f
f
wasm-pack --target browser
генерирует точно такой же код. Спасибо, буду знатьf
M
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "host")]
extern "C" {
// Writes a byte string of size bytes that starts from ptr to a logger
#[link_name = "log_utf8_string"]
fn log_utf8_string_impl(level: i32, target: i64, msg_ptr: i32, msg_size: i32);
}
(type $t26 (func (param i32 i64 i32 i32)))
(import "host" "log_utf8_string" (func $host.log_utf8_string (type $t26)))
TypeError: wasm function signature contains illegal type
TypeError: wasm function signature contains illegal type
f
TypeError: wasm function signature contains illegal type
M
SR
f
AF
AF
f
passStringToWasm0
вот такfunction passStringToWasm0(arg, malloc, realloc) {
...
const buf = cachedTextEncoder.encode(arg);
WASM_VECTOR_LEN = buf.length;
...
}
var ptr0 = passStringToWasm0(init_peer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
var ptr1 = passStringToWasm0(aqua, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len1 = WASM_VECTOR_LEN;
var ptr2 = passStringToWasm0(prev_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len2 = WASM_VECTOR_LEN;
f
AF
f
f
f
M
f
f
f
WebAssembly.instantiate(...).exports