From f2882f233e82ff901c45cf0cedd93caa84878d52 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Thu, 10 Oct 2024 21:27:10 -0700 Subject: [PATCH] fix: sticking on certain webassembly breakpoints (#2103) --- src/adapter/templates/breakOnWasm.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/adapter/templates/breakOnWasm.ts b/src/adapter/templates/breakOnWasm.ts index 0e5a0bbc4..6cdd6ed16 100644 --- a/src/adapter/templates/breakOnWasm.ts +++ b/src/adapter/templates/breakOnWasm.ts @@ -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; }); };