Files
scriptc/tests/corpus/1822-static-block-js.js
2026-07-22 18:08:04 -05:00

24 lines
430 B
JavaScript

// JS-lane static blocks (salsa/checkJs inference): the block assigns a
// module binding and runs at the class statement whether or not the class
// is referenced — same declaration-time contract as the .ts lane.
let seen = 0;
class Unreferenced {
static {
seen = 42;
}
}
console.log(seen);
let order = "";
class C {
static {
order += "first;";
}
static {
order += "second;";
}
}
console.log(order);