014 for template cross target

✗ Failing This test is currently failing.

Failed: js-runtime

Failure Output

🎯 Compiler coordination: Passes: 14 (flow-based: frontend, analysis, emission)

Code

input.kz

Actual · Zig

✓ pass
tick
tick
tick

Actual · JavaScript

✗ js-runtime
/Users/larsde/src/koru/tests/regression/100_MODULE_SYSTEM/140_FILE_LAYOUT/140_014_for_template_cross_target/output_emitted.js:4
        { const _auto_6 = __koru_item;       main_module.impl_event.handler({ expr: "tick\n" });
                                                                    ^

TypeError: Cannot read properties of undefined (reading 'handler')
    at Object.flow0 (/Users/larsde/src/koru/tests/regression/100_MODULE_SYSTEM/140_FILE_LAYOUT/140_014_for_template_cross_target/output_emitted.js:4:69)
    at Object.<anonymous> (/Users/larsde/src/koru/tests/regression/100_MODULE_SYSTEM/140_FILE_LAYOUT/140_014_for_template_cross_target/output_emitted.js:11: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✗ JavaScript
tick
tick
tick
Emitted JavaScript source
const main_module = {
  flow0() {
for (let __koru_item = 0; __koru_item < 3; __koru_item++) {
        { const _auto_6 = __koru_item;       main_module.impl_event.handler({ expr: "tick\n" });
 }
        
    }
    {  }
  },
};
main_module.flow0();

Test Configuration

MUST_RUN