You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Should exceptions remain strictly equal across call frames?
letwasm_module=/* instantiate a module with appropriate functions */varsaved_exception=undefinedfunctioncalled_by_wasm(){try{wasm_module.exports.function_that_throws_exception();}catch(e){saved_exception=ethrowe}}functioncall_wasm(){try{wasm_module.exports.function_that_calls_called_by_wasm();}catch(e){console.info(e===saved_exception)}}
Let's assume that wasm_module.exports.function_that_calls_called_by_wasm either does not contain a catch block or catches and rethrows the exception.
Should the console.info line be guaranteed to print true?
One could imagine an implementation strategy for rethrow that reconstructs an equivalent exception rather than throwing the exact same one. Do we want to require rethrow to reuse the same exception object?
I think this constraint would only apply to the JavaScript embedding. I imagine there exist platforms where "reuse the same exception object" doesn't mean much.