diff --git a/hosts/ocaml/browser/sx-platform.js b/hosts/ocaml/browser/sx-platform.js index ab8f6330..a43e690a 100644 --- a/hosts/ocaml/browser/sx-platform.js +++ b/hosts/ocaml/browser/sx-platform.js @@ -700,8 +700,9 @@ K.eval("(handle-popstate " + scrollY + ")"); }); // Wire up streaming suspense resolution + var _resolveFn = K.eval("resolve-suspense"); Sx.resolveSuspense = function(id, sx) { - try { K.eval('(resolve-suspense "' + id.replace(/"/g, '\\"') + '" "' + sx.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '")'); } + try { K.callFn(_resolveFn, [id, sx]); } catch(e) { console.error("[sx] resolveSuspense error:", e); } }; // Drain any pending resolves that arrived before boot diff --git a/shared/static/wasm/sx-platform.js b/shared/static/wasm/sx-platform.js index ab8f6330..a43e690a 100644 --- a/shared/static/wasm/sx-platform.js +++ b/shared/static/wasm/sx-platform.js @@ -700,8 +700,9 @@ K.eval("(handle-popstate " + scrollY + ")"); }); // Wire up streaming suspense resolution + var _resolveFn = K.eval("resolve-suspense"); Sx.resolveSuspense = function(id, sx) { - try { K.eval('(resolve-suspense "' + id.replace(/"/g, '\\"') + '" "' + sx.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '")'); } + try { K.callFn(_resolveFn, [id, sx]); } catch(e) { console.error("[sx] resolveSuspense error:", e); } }; // Drain any pending resolves that arrived before boot