h5wasm icon indicating copy to clipboard operation
h5wasm copied to clipboard

Optional arguments in JS embind bindings

Open axelboc opened this issue 4 months ago • 0 comments

Just to report that Emscripten 3.1.68 makes optional arguments in JS bindings actually optional: https://github.com/emscripten-core/emscripten/issues/22389

I discovered this issue when trying to use the new Module#open method signature with two optional arguments. Just calling open(filename) was throwing a BindingError saying that I was passing the wrong number of arguments. I had to pass undefined explicitly for the two optional arguments: https://github.com/silx-kit/h5web/blob/main/packages/h5wasm/src/worker.ts#L26

axelboc avatar Oct 01 '24 07:10 axelboc