Files
scriptc/tests/corpus/js-open-binding-writes.js
Chris Tate 81afd2bdd7 perf: avoid repeated type queries and JavaScript binding scans (#630)
* perf: skip island type probes in static compilation

* test: retain reached declaration checker panic diagnostics

* test: make child backpressure event ordering deterministic

* perf: index JavaScript binding writes once per scope

* test: record preflight baseline for binding writes fixture
2026-10-03 07:40:13 -05:00

25 lines
605 B
JavaScript

let shared = 0;
function setShared(value) { shared = value; }
setShared("global");
console.log("shared", typeof shared, shared);
function scoped(value) {
let state = 0;
const update = (next) => { state = next; };
update(value);
{
let state = 0;
const update = (next) => { state = next; };
update("inner");
console.log("shadow", typeof state, state);
}
console.log("scope", typeof state, state);
}
scoped("outer");
scoped(true);
/** @type {number} */ let annotated = 1;
function updateNumber(value) { annotated = value; }
updateNumber(4);
console.log("annotated", annotated);