`scratch`: bare expressions are watch expressions. `import`: an existing module; re-export lists are plumbing and are skipped, side-effecting statements are errors.
The tags of declarations merged into one definition (see `extract`), weakest first: the strongest heads the definition's IR. A class stays a class, and a `declare const` keeps its salt (each is a distinct symbol).
`// @ts-expect-error` / `// @ts-ignore` comments directly above a declaration, as source pieces. They're kept with the definition (they decide whether it typechecks; like other comments they aren't hashed).
An anonymous function or class expression, after erasable wrappers. Binding one to a name gives it that name at runtime (`const f = () => 1` has `f.name === "f"`).
What a top-level statement writes into, outside the functions in it: the root of what it assigns to (`codes[i] = …`, `Impl.prototype = …`, `delete x.k`), and what it hands to `Object`'s and `Reflect`'s mutators (`Object.defineProperty(Proto, …)`, `Object.freeze(types)`). Its own variables (`for (let i …)`) don't count; a write into something else than a name (`f().x = 1`) is `""`. A method call isn't a write: `server.listen()` is a side effect, not setting up.