fix(csr): prevent native output recursion
Quality / quality (ubuntu-latest) (push) Failing after 22s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-12 18:08:35 +05:30
parent 8fa3d7ecd1
commit cf06a60f2b
2 changed files with 26 additions and 0 deletions
+6
View File
@@ -2512,6 +2512,11 @@ export const REACTIVE_RUNTIME = String.raw`
var stmt = attr.value;
var listener = function (event) {
// An unbound output falls back to a same-named CustomEvent for
// external consumers. Do not feed that synthetic event back into
// the component's own declarative DOM handler (for example,
// @click="output.click()"), which would recurse indefinitely.
if (event && event.__wrnexusComponentOutput) return;
var locals =
decodeLoopLocals(node);
@@ -4167,6 +4172,7 @@ export const REACTIVE_RUNTIME = String.raw`
bubbles: true,
detail: detail || {},
});
event.__wrnexusComponentOutput = true;
root.dispatchEvent(event);
// Compatibility for applications using the former prefixed contract.
root.dispatchEvent(new EventConstructor("wrnexus:" + String(name), {