Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove initSync #5

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions extra/dart_fmt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl

export type InitOutput = unknown;

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;
// 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
Expand Down
14 changes: 7 additions & 7 deletions extra/dart_fmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ let wasm;
function get_imports() {}
function init_memory() {}

export function initSync(module) {
if (wasm !== undefined) return wasm;
// export function initSync(module) {
// if (wasm !== undefined) return wasm;

const imports = get_imports();
// const imports = get_imports();

init_memory(imports);
// init_memory(imports);

module = normalize(module);
// module = normalize(module);

return (wasm = instantiate(module));
}
// return (wasm = instantiate(module));
// }

function normalize(module) {
if (!(module instanceof WebAssembly.Module)) {
Expand Down