Skip to content

Commit

Permalink
Temporarily use the fix from wasmerio/wasmer#3400
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Dec 1, 2022
1 parent 96d1601 commit 06c87bb
Show file tree
Hide file tree
Showing 6 changed files with 1,434 additions and 22 deletions.
54 changes: 34 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ wasmer-vfs = { version = "3.0.2", default-features = false, features = ["mem-fs"
[profile.release]
lto = true
opt-level = 'z'

[patch.crates-io]
wasmer = { git = "https://github.com/wasmerio/wasmer", default-features = false, features = ["js", "std"], branch = "fix-downcasting" }
wasmer-wasi = { git = "https://github.com/wasmerio/wasmer", default-features = false, features = ["js"], branch = "fix-downcasting" }
wasmer-vfs = { git = "https://github.com/wasmerio/wasmer", default-features = false, features = ["mem-fs"], branch = "fix-downcasting" }
75 changes: 75 additions & 0 deletions pkg/wasmer_wasi_js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,79 @@ export class WASI {
*/
export class WasmerRuntimeError {
free(): void;
/**
* @returns {Symbol}
*/
static __wbgd_downcast_token(): Symbol;
}

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly __wbg_wasmerruntimeerror_free: (a: number) => void;
readonly wasmerruntimeerror___wbgd_downcast_token: () => number;
readonly __wbg_memfs_free: (a: number) => void;
readonly memfs_new: (a: number) => void;
readonly memfs_from_js: (a: number, b: number) => void;
readonly memfs_readDir: (a: number, b: number, c: number, d: number) => void;
readonly memfs_createDir: (a: number, b: number, c: number, d: number) => void;
readonly memfs_removeDir: (a: number, b: number, c: number, d: number) => void;
readonly memfs_removeFile: (a: number, b: number, c: number, d: number) => void;
readonly memfs_rename: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
readonly memfs_metadata: (a: number, b: number, c: number, d: number) => void;
readonly memfs_open: (a: number, b: number, c: number, d: number, e: number) => void;
readonly __wbg_jsvirtualfile_free: (a: number) => void;
readonly jsvirtualfile_lastAccessed: (a: number) => number;
readonly jsvirtualfile_lastModified: (a: number) => number;
readonly jsvirtualfile_createdTime: (a: number) => number;
readonly jsvirtualfile_size: (a: number) => number;
readonly jsvirtualfile_setLength: (a: number, b: number, c: number) => void;
readonly jsvirtualfile_read: (a: number, b: number) => void;
readonly jsvirtualfile_readString: (a: number, b: number) => void;
readonly jsvirtualfile_write: (a: number, b: number, c: number, d: number) => void;
readonly jsvirtualfile_writeString: (a: number, b: number, c: number, d: number) => void;
readonly jsvirtualfile_flush: (a: number, b: number) => void;
readonly jsvirtualfile_seek: (a: number, b: number, c: number) => void;
readonly __wbg_wasi_free: (a: number) => void;
readonly wasi_new: (a: number, b: number) => void;
readonly wasi_fs: (a: number, b: number) => void;
readonly wasi_getImports: (a: number, b: number, c: number) => void;
readonly wasi_instantiate: (a: number, b: number, c: number, d: number) => void;
readonly wasi_start: (a: number, b: number, c: number) => void;
readonly wasi_getStdoutBuffer: (a: number, b: number) => void;
readonly wasi_getStdoutString: (a: number, b: number) => void;
readonly wasi_getStderrBuffer: (a: number, b: number) => void;
readonly wasi_getStderrString: (a: number, b: number) => void;
readonly wasi_setStdinBuffer: (a: number, b: number, c: number, d: number) => void;
readonly wasi_setStdinString: (a: number, b: number, c: number, d: number) => void;
readonly canonical_abi_realloc: (a: number, b: number, c: number, d: number) => number;
readonly canonical_abi_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_malloc: (a: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly __wbindgen_exn_store: (a: number) => void;
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
readonly __wbindgen_free: (a: number, b: number) => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {SyncInitInput} module
*
* @returns {InitOutput}
*/
export function initSync(module: SyncInitInput): InitOutput;

/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {InitInput | Promise<InitInput>} module_or_path
*
* @returns {Promise<InitOutput>}
*/
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
Loading

0 comments on commit 06c87bb

Please sign in to comment.