009 entry merges companions

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

142

Expected output

✓ Zig✓ JavaScript
142
Emitted JavaScript source
// JavaScript implementation facet. Unused on the Zig target (the harness only
// emits Zig), but it must coexist in the merged module without breaking it —
// its |js procs attach to the same events as the |zig variants.
const main_module = {
  compute_event: {
    handler(input) {
      const x = input.x;
      return { tag: "done", done: x + 100 };
    },
  },
  show_event: {
    handler(input) {
      const v = input.v;
      console.log(v);
    },
  },
  flow0() {
    const result_0 = main_module.compute_event.handler({ x: 42 });
    const r = result_0.done;
    {
      const v = r;
      console.log(v);
    }
  },
};
main_module.flow0();

Test Configuration

MUST_RUN