012 js dispatch binding shadow

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

count=1

Expected output

✓ Zig✓ JavaScript
count=1
Emitted JavaScript source
let count = 0;
const main_module = {
  run_event: {
    handler(input, H) {
      const key = H.key;
      const n = input.n;
      for (let i = 0; i < n; i++) {
      const c = 42;
      key(c);
      }
    },
  },
  onKey_event: {
    handler(input) {
      const ch = input.ch;
      count = count + 1;
    },
  },
  report_event: {
    handler(input) {
      console.log("count=" + count);
    },
  },
  flow0() {
    const __arg_0 = 1;
    {
      const n = __arg_0;
      for (let i = 0; i < n; i++) {
      const c = 42;
      {
        {
          const ch = c;
          count = count + 1;
        }
      }
      }    }
  },
  flow1() {
    {
      console.log("count=" + count);
    }
  },
};
main_module.flow0();
main_module.flow1();

Test Configuration

MUST_RUN