code wiki / _hdl_build / nx_jsscope_gate.nx

nx_jsscope_gate.nx

buildroot/runtime/_hdl_build/nx_jsscope_gate.nx

14976 B277 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_js_lex.nx nx_js_parse.nx nx_jsscope.nx nx_gate_verdict.nx nx_jsscope_gate.nx

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ jg_fix jss_check sys_mmap ↻ jp_parse_source js_lex js_skip_trivia js_is_space js_lex_one js_is_idstart js_scan_ident js_is_keyword js_emit js_num_starts js_scan_number js_lex_string js_lex_template js_regex_context js_lex_regex js_punct_len jp_parse_program

structs

none

consts

20const JG_PAGE: *u8 = "../sites/nishifamily/world/beach.html"
21const JG_GLOBALS: *u8 = "../knowledge/js_globals.conf"
24const JG_MIN_PAGE: i64 = 100000
26const JG_PRINT_MAX: i64 = 24

functions

28func jg_len(s: *u8) -> i64 { var n: i64 = 0; while (s[n] & 255) != 0 { n = n + 1 } return n }
called by 2: jg_fixmain
30func jg_put_tok(st: *i64, tokidx: i64) -> i64
39func jg_count(st: *i64, kind: i64) -> i64
called by 1: main
48func jg_print(st: *i64) -> i64
71func jg_fix(src: *u8) -> *i64 { return jss_check(src, jg_len(src), 0 as *u8, 0) }
called by 1: main calls 2: jss_checkjg_len
73func main() -> i64