✗
Failing This test is currently failing.
Failed: js-runtime
Failure Output
🎯 Compiler coordination: Passes: 14 (flow-based: frontend, analysis, emission) Code
// Pure-`.k` `if` with `print.ln` branch bodies fails to compile on the JS
// target (RED on js-compile; the zig target compiles + runs fine). This is the
// construct the playground default and self-contained `.k` programs reach for
// (Lars's repro). `print(text: ...)` branches are fine — it's print.ln (a
// comptime transform) as an if-branch body, on the JS path, that breaks.
// Pins a real JS-emission bug; a target divergence like this must be closed
// (or the JS path must error cleanly), never silently crash.
import std/io
if(7 > 3)
| then |> std/io:print.ln("big")
| else |> std/io:print.ln("small")
Actual · Zig
✓ passbig
Actual · JavaScript
✗ js-runtime/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/040_CONTROL_FLOW/010_008_if_print_ln_branch/output_emitted.js:4
{ main_module.impl_event.handler({ expr: "big" });
^
TypeError: Cannot read properties of undefined (reading 'handler')
at Object.flow0 (/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/040_CONTROL_FLOW/010_008_if_print_ln_branch/output_emitted.js:4:40)
at Object.<anonymous> (/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/040_CONTROL_FLOW/010_008_if_print_ln_branch/output_emitted.js:12:13)
at Module._compile (node:internal/modules/cjs/loader:1829:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1969:10)
at Module.load (node:internal/modules/cjs/loader:1552:32)
at Module._load (node:internal/modules/cjs/loader:1354:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
at node:internal/main/run_main_module:33:47
Node.js v25.9.0
Expected output
✓ Zig✗ JavaScriptbig
Emitted JavaScript source
const main_module = {
flow0() {
if (7 > 3) {
{ main_module.impl_event.handler({ expr: "big" });
}
} else {
{ main_module.impl_event.handler({ expr: "small" });
}
}
},
};
main_module.flow0();
Test Configuration
MUST_RUN