bindings/wasm: Fix VFS.sync() function signature

We don't expect any return value from the underlying `fsync()` so fix
the function signature accordingly.

Fixes the following obscure error:

```
TypeError: Cannot convert undefined to a BigInt
    at wasm://wasm/00942492:wasm-function[1501]:0x1c4dc1
    at wasm://wasm/00942492:wasm-function[694]:0x189586
    at wasm://wasm/00942492:wasm-function[50]:0x143d7
    at wasm://wasm/00942492:wasm-function[60]:0x3f91a
    at new Database (/Users/penberg/src/penberg/limbo/bindings/wasm/pkg/limbo_wasm.js:162:26)
    at file:///Users/penberg/src/penberg/limbo/bindings/wasm/perf/perf-limbo.js:5:12
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12)
```
This commit is contained in:
Pekka Enberg
2024-11-16 13:05:32 +02:00
parent 2eb299907f
commit 82ec900b07
2 changed files with 2 additions and 2 deletions

View File

@@ -256,7 +256,7 @@ extern "C" {
fn size(this: &VFS, fd: i32) -> u64;
#[wasm_bindgen(method)]
fn sync(this: &VFS, fd: i32) -> u64;
fn sync(this: &VFS, fd: i32);
}
#[wasm_bindgen(start)]

View File

@@ -26,7 +26,7 @@ class VFS {
}
sync(fd) {
return fs.fsyncSync(fd);
fs.fsyncSync(fd);
}
}