h5wasm
h5wasm copied to clipboard
Optional arguments in JS embind bindings
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