Skip to content

Commit

Permalink
refactor: remove execute_node return value which is unused
Browse files Browse the repository at this point in the history
  • Loading branch information
uhyo committed Aug 19, 2024
1 parent 5ff5039 commit aad841c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,14 @@ export type NitrogqlConfigNamespace = {
* Executes given JavaScript (or TypeScript) code.
* Result is returned asynchronously via `execute_node_ret` function.
*/
execute_node(
code_ptr: number,
code_len: number,
ticket_handle: number
): number;
execute_node(code_ptr: number, code_len: number, ticket_handle: number): void;
};

export type InitNitrogqlConfigResult = {
namespace: NitrogqlConfigNamespace;
setWasmModule: (module: WebAssembly.Exports) => void;
};

let handleCounter = 0;

/**
* Initialize the `nitrogql_helper/config` namespace.
* This namespace is depended by nitrogql's wasm modules.
Expand All @@ -101,7 +95,7 @@ export function initConfigNamespace(): InitNitrogqlConfigResult {
code_ptr: number,
code_len: number,
ticket_handle: number
): number {
): void {
if (module === undefined) {
throw new Error("wasm module is not set");
}
Expand All @@ -115,7 +109,6 @@ export function initConfigNamespace(): InitNitrogqlConfigResult {
result_len: number
) => void;
const code = readString(code_ptr, code_len);
const handle = ++handleCounter;
w.run(code)
.then((data) => {
const result = JSON.stringify(data);
Expand All @@ -129,6 +122,5 @@ export function initConfigNamespace(): InitNitrogqlConfigResult {
.catch(() => {
execute_node_ret(ticket_handle, 0, 0, 0);
});
return handle;
}
}

0 comments on commit aad841c

Please sign in to comment.