Skip to main content

Module emitted_names

Module emitted_names 

Source
Expand description

#2476: the names the emitter gives Bynk locals in the TypeScript it writes.

A debugger sees the emitted names, not Bynk’s, so a feature that points a debug session at a Bynk binding (inline values) needs the emitter’s mapping. It lives here, below both the emitter and the language server, so neither re-derives it: the emitter calls ts_ident when it declares a binding, and emitted_local_name mirrors Emitter::bind_local_name’s choice for a let.

Functions§

emitted_local_name
The JS identifier the emitter declares for binding, or None when it cannot be known from the source alone.
ts_ident
The TypeScript spelling of a user identifier in a binding or reference position (params, locals, function names, import names). Bynk identifiers that are illegal as TS binding names — the JS reserved words plus the strict-mode/module sets (emitted modules are always strict ESM) — and names the emitter itself introduces alongside user bindings (deps) are renamed into the generated-name namespace (__id_<name>), which the parser keeps free of user identifiers. Property/field names never pass through here: reserved words are legal there, and record field names are wire format.