code wiki / _hdl_build / nx_jsscope_gate.nx
nx_jsscope_gate.nx
buildroot/runtime/_hdl_build/nx_jsscope_gate.nx
about
nx_jsscope_gate.nx -- EVERY NAME THE SHIPPED PAGE REFERENCES IS VISIBLE FROM WHERE IT IS USED.
THE DEFECT THIS EXISTS TO CATCH, VERBATIM FROM THE OPERATOR'S URL BAR ON 2026-08-25:
/world/craft?gl=0&why=ReferenceError%3A+nxHairTick+is+not+defined
A function declared inside loadNPC and called from drawNPCs at script scope. The page lexed, the
wasm painted, the ship lane read the page back and verified its marker -- and every visitor lost
the WebGL tier on the first frame. This gate asks the one question a browser asks first, statically,
over the incumbent nx_js_parse AST: is every referenced name declared in an ENCLOSING scope?
THE CONTROLS RUN FIRST AND THE LOAD-BEARING ONE IS THE PLANTED nxHairTick SHAPE. A resolver that
only reports "undefined" would send a reader to grep for a typo; this one must say OUT-OF-SCOPE and
NAME THE DECLARING FUNCTION, because that is the line that sends them to the fix.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_js_lex.nxnx_js_parse.nxnx_jsscope.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 20 | const JG_PAGE: *u8 = "../sites/nishifamily/world/beach.html" |
| 21 | const JG_GLOBALS: *u8 = "../knowledge/js_globals.conf" |
| 24 | const JG_MIN_PAGE: i64 = 100000 |
| 26 | const JG_PRINT_MAX: i64 = 24 |
functions
| 28 | func jg_len(s: *u8) -> i64 { var n: i64 = 0; while (s[n] & 255) != 0 { n = n + 1 } return n } |
| 30 | func jg_put_tok(st: *i64, tokidx: i64) -> i64 |
| 39 | func jg_count(st: *i64, kind: i64) -> i64 called by 1: main |
| 48 | func jg_print(st: *i64) -> i64 |
| 71 | func jg_fix(src: *u8) -> *i64 { return jss_check(src, jg_len(src), 0 as *u8, 0) } |
| 73 | func main() -> i64 |