Skip to content

Commit

Permalink
fix: sticking on certain webassembly breakpoints (#2103)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 authored Oct 11, 2024
1 parent 8b0bffc commit f2882f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/adapter/templates/breakOnWasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export const breakOnWasmInit = templateFunction(function() {
const original = (WebAssembly as any)[fn];
WebAssembly[fn] = function(...args) {
return original.apply(this, args).then((r: unknown) => {
debugger;
// note: instantiating an existing module won't (re)compile the script
// so we have no need to stop.
if (!(args[0] instanceof WebAssembly.Module)) {
debugger;
}
return r as any;
});
};
Expand Down

0 comments on commit f2882f2

Please # to comment.