@scriptc/compiler 0.0.35 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +14 -11
  2. package/ambient/scriptc-overrides.d.ts +0 -7
  3. package/ambient/scriptc.d.ts +1 -1
  4. package/dist/backend/build-cache.d.ts +44 -0
  5. package/dist/backend/build-cache.js +241 -0
  6. package/dist/backend/build-cache.js.map +1 -0
  7. package/dist/backend/{emission/emit-async.d.ts → c/async.d.ts} +21 -30
  8. package/dist/backend/{emission/emit-async.js → c/async.js} +270 -286
  9. package/dist/backend/c/async.js.map +1 -0
  10. package/dist/backend/{emission/emitter.d.ts → c/c-emitter.d.ts} +6 -23
  11. package/dist/backend/{emission/emitter.js → c/c-emitter.js} +53 -107
  12. package/dist/backend/c/c-emitter.js.map +1 -0
  13. package/dist/backend/c/exprs.d.ts +8 -0
  14. package/dist/backend/c/exprs.js +7937 -0
  15. package/dist/backend/c/exprs.js.map +1 -0
  16. package/dist/backend/{emission/emit-island.d.ts → c/island.d.ts} +5 -5
  17. package/dist/backend/{emission/emit-island.js → c/island.js} +24 -22
  18. package/dist/backend/c/island.js.map +1 -0
  19. package/dist/backend/{emission → c}/may-throw.d.ts +1 -1
  20. package/dist/backend/{emission → c}/may-throw.js +4 -1
  21. package/dist/backend/c/may-throw.js.map +1 -0
  22. package/dist/backend/{emission/emit-shapes.d.ts → c/shapes.d.ts} +19 -19
  23. package/dist/backend/{emission/emit-shapes.js → c/shapes.js} +78 -87
  24. package/dist/backend/c/shapes.js.map +1 -0
  25. package/dist/backend/{emission/emit-stmts.d.ts → c/stmts.d.ts} +12 -12
  26. package/dist/backend/{emission/emit-stmts.js → c/stmts.js} +395 -343
  27. package/dist/backend/c/stmts.js.map +1 -0
  28. package/dist/backend/{emission/emit-types.d.ts → c/types.d.ts} +1 -1
  29. package/dist/backend/{emission/emit-types.js → c/types.js} +42 -286
  30. package/dist/backend/c/types.js.map +1 -0
  31. package/dist/backend/c/types.test.js +25 -0
  32. package/dist/backend/c/types.test.js.map +1 -0
  33. package/dist/backend/{emission/emit-walkers.d.ts → c/walkers.d.ts} +19 -41
  34. package/dist/backend/{emission/emit-walkers.js → c/walkers.js} +242 -304
  35. package/dist/backend/c/walkers.js.map +1 -0
  36. package/dist/backend/external-c.d.ts +33 -0
  37. package/dist/backend/external-c.js +51 -0
  38. package/dist/backend/external-c.js.map +1 -0
  39. package/dist/backend/ffi-callbacks.d.ts +1 -1
  40. package/dist/backend/ffi-callbacks.js +4 -3
  41. package/dist/backend/ffi-callbacks.js.map +1 -1
  42. package/dist/backend/{library-identity.d.ts → library-identity-markers.d.ts} +0 -4
  43. package/dist/backend/{library-identity.js → library-identity-markers.js} +10 -9
  44. package/dist/backend/library-identity-markers.js.map +1 -0
  45. package/dist/backend/link-plan.d.ts +37 -0
  46. package/dist/backend/link-plan.js +26 -0
  47. package/dist/backend/link-plan.js.map +1 -0
  48. package/dist/backend/linker.d.ts +22 -0
  49. package/dist/backend/linker.js +236 -0
  50. package/dist/backend/linker.js.map +1 -0
  51. package/dist/backend/llvm/blocks.d.ts +4 -0
  52. package/dist/backend/llvm/blocks.js +29 -0
  53. package/dist/backend/llvm/blocks.js.map +1 -1
  54. package/dist/backend/llvm/classes.d.ts +2 -19
  55. package/dist/backend/llvm/classes.js +20 -52
  56. package/dist/backend/llvm/classes.js.map +1 -1
  57. package/dist/backend/llvm/common.d.ts +4 -0
  58. package/dist/backend/llvm/common.js +27 -0
  59. package/dist/backend/llvm/common.js.map +1 -0
  60. package/dist/backend/llvm/dyn.d.ts +3 -8
  61. package/dist/backend/llvm/dyn.js +159 -224
  62. package/dist/backend/llvm/dyn.js.map +1 -1
  63. package/dist/backend/llvm/emitter.d.ts +4 -1
  64. package/dist/backend/llvm/emitter.js +548 -9988
  65. package/dist/backend/llvm/emitter.js.map +1 -1
  66. package/dist/backend/llvm/expr-async.d.ts +4 -0
  67. package/dist/backend/llvm/expr-async.js +726 -0
  68. package/dist/backend/llvm/expr-async.js.map +1 -0
  69. package/dist/backend/llvm/expr-bytes.d.ts +13 -0
  70. package/dist/backend/llvm/expr-bytes.js +456 -0
  71. package/dist/backend/llvm/expr-bytes.js.map +1 -0
  72. package/dist/backend/llvm/expr-callbacks.d.ts +22 -0
  73. package/dist/backend/llvm/expr-callbacks.js +520 -0
  74. package/dist/backend/llvm/expr-callbacks.js.map +1 -0
  75. package/dist/backend/llvm/expr-calls.d.ts +2 -0
  76. package/dist/backend/llvm/expr-calls.js +618 -0
  77. package/dist/backend/llvm/expr-calls.js.map +1 -0
  78. package/dist/backend/llvm/expr-containers.d.ts +25 -0
  79. package/dist/backend/llvm/expr-containers.js +637 -0
  80. package/dist/backend/llvm/expr-containers.js.map +1 -0
  81. package/dist/backend/llvm/expr-context.d.ts +255 -0
  82. package/dist/backend/llvm/expr-context.js +2 -0
  83. package/dist/backend/llvm/expr-context.js.map +1 -0
  84. package/dist/backend/llvm/expr-control.d.ts +2 -0
  85. package/dist/backend/llvm/expr-control.js +473 -0
  86. package/dist/backend/llvm/expr-control.js.map +1 -0
  87. package/dist/backend/llvm/expr-dispatch.d.ts +4 -0
  88. package/dist/backend/llvm/expr-dispatch.js +153 -0
  89. package/dist/backend/llvm/expr-dispatch.js.map +1 -0
  90. package/dist/backend/llvm/expr-dynamic.d.ts +2 -0
  91. package/dist/backend/llvm/expr-dynamic.js +810 -0
  92. package/dist/backend/llvm/expr-dynamic.js.map +1 -0
  93. package/dist/backend/llvm/expr-island.d.ts +15 -0
  94. package/dist/backend/llvm/expr-island.js +690 -0
  95. package/dist/backend/llvm/expr-island.js.map +1 -0
  96. package/dist/backend/llvm/expr-primitives.d.ts +6 -0
  97. package/dist/backend/llvm/expr-primitives.js +642 -0
  98. package/dist/backend/llvm/expr-primitives.js.map +1 -0
  99. package/dist/backend/llvm/expr-records.d.ts +9 -0
  100. package/dist/backend/llvm/expr-records.js +299 -0
  101. package/dist/backend/llvm/expr-records.js.map +1 -0
  102. package/dist/backend/llvm/expr-stream-bridges.d.ts +13 -0
  103. package/dist/backend/llvm/expr-stream-bridges.js +420 -0
  104. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -0
  105. package/dist/backend/llvm/expr-stream-callbacks.d.ts +12 -0
  106. package/dist/backend/llvm/expr-stream-callbacks.js +360 -0
  107. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -0
  108. package/dist/backend/llvm/lib-dispatch.d.ts +5 -0
  109. package/dist/backend/llvm/lib-dispatch.js +267 -0
  110. package/dist/backend/llvm/lib-dispatch.js.map +1 -0
  111. package/dist/backend/llvm/lib-filesystem.d.ts +6 -0
  112. package/dist/backend/llvm/lib-filesystem.js +594 -0
  113. package/dist/backend/llvm/lib-filesystem.js.map +1 -0
  114. package/dist/backend/llvm/lib-network.d.ts +2 -0
  115. package/dist/backend/llvm/lib-network.js +429 -0
  116. package/dist/backend/llvm/lib-network.js.map +1 -0
  117. package/dist/backend/llvm/lib-process.d.ts +5 -0
  118. package/dist/backend/llvm/lib-process.js +585 -0
  119. package/dist/backend/llvm/lib-process.js.map +1 -0
  120. package/dist/backend/llvm/lib-shared.d.ts +6 -0
  121. package/dist/backend/llvm/lib-shared.js +687 -0
  122. package/dist/backend/llvm/lib-shared.js.map +1 -0
  123. package/dist/backend/llvm/lib-stream.d.ts +2 -0
  124. package/dist/backend/llvm/lib-stream.js +470 -0
  125. package/dist/backend/llvm/lib-stream.js.map +1 -0
  126. package/dist/backend/llvm/shapes.d.ts +12 -2
  127. package/dist/backend/llvm/shapes.js +66 -307
  128. package/dist/backend/llvm/shapes.js.map +1 -1
  129. package/dist/backend/llvm/shapes.test.js +52 -0
  130. package/dist/backend/llvm/shapes.test.js.map +1 -0
  131. package/dist/backend/llvm/unsupported.d.ts +1 -1
  132. package/dist/backend/llvm/walkers.d.ts +2 -3
  133. package/dist/backend/llvm/walkers.js +195 -222
  134. package/dist/backend/llvm/walkers.js.map +1 -1
  135. package/dist/backend/native-codegen.d.ts +45 -0
  136. package/dist/backend/native-codegen.js +275 -0
  137. package/dist/backend/native-codegen.js.map +1 -0
  138. package/dist/backend/native-codegen.test.js +226 -0
  139. package/dist/backend/native-codegen.test.js.map +1 -0
  140. package/dist/backend/native-link-info.d.ts +96 -0
  141. package/dist/backend/native-link-info.js +243 -0
  142. package/dist/backend/native-link-info.js.map +1 -0
  143. package/dist/backend/native-link-info.test.d.ts +1 -0
  144. package/dist/backend/native-link-info.test.js +134 -0
  145. package/dist/backend/native-link-info.test.js.map +1 -0
  146. package/dist/backend/{cc.d.ts → native-toolchain.d.ts} +54 -34
  147. package/dist/backend/{cc.js → native-toolchain.js} +231 -810
  148. package/dist/backend/native-toolchain.js.map +1 -0
  149. package/dist/backend/native-toolchain.test.d.ts +1 -0
  150. package/dist/backend/{cc-cache.test.js → native-toolchain.test.js} +219 -7
  151. package/dist/backend/native-toolchain.test.js.map +1 -0
  152. package/dist/backend/object-localize.js +1 -1
  153. package/dist/backend/runtime-abi.d.ts +10 -0
  154. package/dist/backend/runtime-abi.js +11 -0
  155. package/dist/backend/runtime-abi.js.map +1 -0
  156. package/dist/backend/runtime-pack-targets.test.d.ts +1 -0
  157. package/dist/backend/runtime-pack-targets.test.js +54 -0
  158. package/dist/backend/runtime-pack-targets.test.js.map +1 -0
  159. package/dist/backend/runtime-pack.d.ts +112 -0
  160. package/dist/backend/runtime-pack.js +305 -0
  161. package/dist/backend/runtime-pack.js.map +1 -0
  162. package/dist/backend/runtime-pack.test.d.ts +1 -0
  163. package/dist/backend/runtime-pack.test.js +473 -0
  164. package/dist/backend/runtime-pack.test.js.map +1 -0
  165. package/dist/backend/targets.d.ts +76 -0
  166. package/dist/backend/targets.js +262 -0
  167. package/dist/backend/targets.js.map +1 -0
  168. package/dist/backend/targets.test.d.ts +1 -0
  169. package/dist/backend/targets.test.js +41 -0
  170. package/dist/backend/targets.test.js.map +1 -0
  171. package/dist/backend/vendor-archives.d.ts +41 -0
  172. package/dist/backend/vendor-archives.js +462 -0
  173. package/dist/backend/vendor-archives.js.map +1 -0
  174. package/dist/compat/fetch-profile.d.ts +0 -1
  175. package/dist/compat/fetch-profile.js +0 -1
  176. package/dist/compat/fetch-profile.js.map +1 -1
  177. package/dist/coverage/report.js +3 -3
  178. package/dist/coverage/report.js.map +1 -1
  179. package/dist/coverage/surface-manifest.js +35 -33
  180. package/dist/coverage/surface-manifest.js.map +1 -1
  181. package/dist/diagnostics/diagnostic.d.ts +11 -12
  182. package/dist/diagnostics/diagnostic.js +19 -17
  183. package/dist/diagnostics/diagnostic.js.map +1 -1
  184. package/dist/diagnostics/render.d.ts +1 -1
  185. package/dist/diagnostics/render.js +1 -1
  186. package/dist/diagnostics/render.js.map +1 -1
  187. package/dist/errors.d.ts +5 -0
  188. package/dist/errors.js +9 -0
  189. package/dist/errors.js.map +1 -0
  190. package/dist/executable/{early-cache.d.ts → executable-cache.d.ts} +2 -2
  191. package/dist/executable/{early-cache.js → executable-cache.js} +36 -98
  192. package/dist/executable/executable-cache.js.map +1 -0
  193. package/dist/executable/executable-cache.test.d.ts +1 -0
  194. package/dist/executable/{early-cache.test.js → executable-cache.test.js} +3 -3
  195. package/dist/executable/executable-cache.test.js.map +1 -0
  196. package/dist/ffi/{profile.js → ffi-manifest.js} +1 -1
  197. package/dist/ffi/ffi-manifest.js.map +1 -0
  198. package/dist/frontend/builtin-modules.d.ts +21 -0
  199. package/dist/frontend/builtin-modules.js +82 -0
  200. package/dist/frontend/builtin-modules.js.map +1 -0
  201. package/dist/frontend/cjs-lexer.d.ts +7 -0
  202. package/dist/frontend/cjs-lexer.js +15 -17
  203. package/dist/frontend/cjs-lexer.js.map +1 -1
  204. package/dist/frontend/dts-paths.d.ts +26 -0
  205. package/dist/frontend/dts-paths.js +41 -0
  206. package/dist/frontend/dts-paths.js.map +1 -0
  207. package/dist/frontend/input-tracker.d.ts +0 -2
  208. package/dist/frontend/input-tracker.js +1 -4
  209. package/dist/frontend/input-tracker.js.map +1 -1
  210. package/dist/frontend/lib-contract.d.ts +1 -5
  211. package/dist/frontend/lib-contract.js +1 -1
  212. package/dist/frontend/lib-contract.js.map +1 -1
  213. package/dist/frontend/lib-exports.d.ts +1 -1
  214. package/dist/frontend/lowering/array-values.d.ts +8 -0
  215. package/dist/frontend/lowering/array-values.js +60 -0
  216. package/dist/frontend/lowering/array-values.js.map +1 -0
  217. package/dist/frontend/lowering/call-position.d.ts +4 -0
  218. package/dist/frontend/lowering/call-position.js +7 -0
  219. package/dist/frontend/lowering/call-position.js.map +1 -0
  220. package/dist/frontend/lowering/callback-arg.d.ts +20 -0
  221. package/dist/frontend/lowering/callback-arg.js +44 -0
  222. package/dist/frontend/lowering/callback-arg.js.map +1 -0
  223. package/dist/frontend/lowering/lib-boundary.d.ts +1 -1
  224. package/dist/frontend/lowering/lib-boundary.js +34 -34
  225. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  226. package/dist/frontend/lowering/lower-array-sort.d.ts +22 -0
  227. package/dist/frontend/lowering/lower-array-sort.js +619 -0
  228. package/dist/frontend/lowering/lower-array-sort.js.map +1 -0
  229. package/dist/frontend/lowering/lower-assert.d.ts +3 -3
  230. package/dist/frontend/lowering/lower-assert.js +214 -241
  231. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  232. package/dist/frontend/lowering/lower-builtins.d.ts +74 -146
  233. package/dist/frontend/lowering/lower-builtins.js +1285 -1233
  234. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  235. package/dist/frontend/lowering/lower-calls.d.ts +59 -192
  236. package/dist/frontend/lowering/lower-calls.js +1644 -1506
  237. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  238. package/dist/frontend/lowering/lower-classes.d.ts +62 -125
  239. package/dist/frontend/lowering/lower-classes.js +832 -866
  240. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  241. package/dist/frontend/lowering/lower-comptime.d.ts +5 -12
  242. package/dist/frontend/lowering/lower-comptime.js +32 -31
  243. package/dist/frontend/lowering/lower-comptime.js.map +1 -1
  244. package/dist/frontend/lowering/lower-containers.d.ts +35 -135
  245. package/dist/frontend/lowering/lower-containers.js +1984 -2227
  246. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  247. package/dist/frontend/lowering/lower-dgram.d.ts +3 -7
  248. package/dist/frontend/lowering/lower-dgram.js +97 -111
  249. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  250. package/dist/frontend/lowering/lower-enums.d.ts +4 -4
  251. package/dist/frontend/lowering/lower-enums.js +30 -30
  252. package/dist/frontend/lowering/lower-enums.js.map +1 -1
  253. package/dist/frontend/lowering/{lower-emitter.d.ts → lower-event-emitter.d.ts} +7 -18
  254. package/dist/frontend/lowering/{lower-emitter.js → lower-event-emitter.js} +172 -174
  255. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -0
  256. package/dist/frontend/lowering/lower-expando.d.ts +5 -5
  257. package/dist/frontend/lowering/lower-expando.js +40 -40
  258. package/dist/frontend/lowering/lower-expando.js.map +1 -1
  259. package/dist/frontend/lowering/lower-exprs.d.ts +60 -264
  260. package/dist/frontend/lowering/lower-exprs.js +2361 -1765
  261. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  262. package/dist/frontend/lowering/lower-generators.d.ts +6 -6
  263. package/dist/frontend/lowering/lower-generators.js +73 -72
  264. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  265. package/dist/frontend/lowering/lower-inspect.d.ts +5 -17
  266. package/dist/frontend/lowering/lower-inspect.js +273 -261
  267. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  268. package/dist/frontend/lowering/lower-island.d.ts +39 -49
  269. package/dist/frontend/lowering/lower-island.js +447 -513
  270. package/dist/frontend/lowering/lower-island.js.map +1 -1
  271. package/dist/frontend/lowering/lower-mixins.d.ts +7 -10
  272. package/dist/frontend/lowering/lower-mixins.js +85 -85
  273. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  274. package/dist/frontend/lowering/lower-modules.d.ts +12 -18
  275. package/dist/frontend/lowering/lower-modules.js +284 -283
  276. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  277. package/dist/frontend/lowering/lower-namespaces.d.ts +23 -49
  278. package/dist/frontend/lowering/lower-namespaces.js +123 -115
  279. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  280. package/dist/frontend/lowering/lower-server.d.ts +18 -25
  281. package/dist/frontend/lowering/lower-server.js +909 -899
  282. package/dist/frontend/lowering/lower-server.js.map +1 -1
  283. package/dist/frontend/lowering/lower-stmts.d.ts +30 -149
  284. package/dist/frontend/lowering/lower-stmts.js +1463 -1285
  285. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  286. package/dist/frontend/lowering/lower-stream.d.ts +12 -12
  287. package/dist/frontend/lowering/lower-stream.js +300 -301
  288. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  289. package/dist/frontend/lowering/lower-test.d.ts +5 -5
  290. package/dist/frontend/lowering/lower-test.js +82 -82
  291. package/dist/frontend/lowering/lower-test.js.map +1 -1
  292. package/dist/frontend/lowering/lowerer.d.ts +134 -22
  293. package/dist/frontend/lowering/lowerer.js +1277 -126
  294. package/dist/frontend/lowering/lowerer.js.map +1 -1
  295. package/dist/frontend/lowering/pairs-snapshot.d.ts +11 -0
  296. package/dist/frontend/lowering/pairs-snapshot.js +85 -0
  297. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -0
  298. package/dist/frontend/lowering/static-this.d.ts +6 -0
  299. package/dist/frontend/lowering/static-this.js +24 -0
  300. package/dist/frontend/lowering/static-this.js.map +1 -0
  301. package/dist/frontend/lowering/surfaces.d.ts +24 -35
  302. package/dist/frontend/lowering/surfaces.js +78 -66
  303. package/dist/frontend/lowering/surfaces.js.map +1 -1
  304. package/dist/frontend/npm-static-rewrite.js +6 -28
  305. package/dist/frontend/npm-static-rewrite.js.map +1 -1
  306. package/dist/frontend/npm-static.d.ts +0 -10
  307. package/dist/frontend/npm-static.js +4 -7
  308. package/dist/frontend/npm-static.js.map +1 -1
  309. package/dist/frontend/npm.d.ts +0 -24
  310. package/dist/frontend/npm.js +11 -85
  311. package/dist/frontend/npm.js.map +1 -1
  312. package/dist/frontend/program.d.ts +3 -1
  313. package/dist/frontend/program.js +9 -4
  314. package/dist/frontend/program.js.map +1 -1
  315. package/dist/frontend/provenance-registry.d.ts +0 -2
  316. package/dist/frontend/provenance-registry.js +0 -10
  317. package/dist/frontend/provenance-registry.js.map +1 -1
  318. package/dist/frontend/provenance.js +4 -7
  319. package/dist/frontend/provenance.js.map +1 -1
  320. package/dist/frontend/resolve.d.ts +7 -2
  321. package/dist/frontend/resolve.js +12 -17
  322. package/dist/frontend/resolve.js.map +1 -1
  323. package/dist/frontend/resolve.test.d.ts +1 -0
  324. package/dist/frontend/resolve.test.js +29 -0
  325. package/dist/frontend/resolve.test.js.map +1 -0
  326. package/dist/frontend/ts7/adapter.d.ts +2 -2
  327. package/dist/frontend/ts7/adapter.js +1 -1
  328. package/dist/frontend/ts7/adapter.js.map +1 -1
  329. package/dist/frontend/ts7/checker.js +2 -36
  330. package/dist/frontend/ts7/checker.js.map +1 -1
  331. package/dist/frontend/ts7/enums.js +2 -1
  332. package/dist/frontend/ts7/enums.js.map +1 -1
  333. package/dist/frontend/ts7/{program.js → program-adapter.js} +7 -6
  334. package/dist/frontend/ts7/program-adapter.js.map +1 -0
  335. package/dist/frontend/ts7/world-check.d.ts +1 -3
  336. package/dist/frontend/ts7/world-check.js +3 -1
  337. package/dist/frontend/ts7/world-check.js.map +1 -1
  338. package/dist/frontend/tsc-codes.d.ts +8 -0
  339. package/dist/frontend/tsc-codes.js +109 -0
  340. package/dist/frontend/tsc-codes.js.map +1 -0
  341. package/dist/frontend/{types.d.ts → type-mapper.d.ts} +2 -25
  342. package/dist/frontend/{types.js → type-mapper.js} +12 -11
  343. package/dist/frontend/type-mapper.js.map +1 -0
  344. package/dist/frontend/workspace-registry.d.ts +26 -0
  345. package/dist/frontend/workspace-registry.js +71 -0
  346. package/dist/frontend/workspace-registry.js.map +1 -0
  347. package/dist/index.d.ts +113 -31
  348. package/dist/index.js +536 -128
  349. package/dist/index.js.map +1 -1
  350. package/dist/ir/analysis.d.ts +37 -0
  351. package/dist/ir/analysis.js +118 -0
  352. package/dist/ir/analysis.js.map +1 -0
  353. package/dist/ir/analysis.test.d.ts +1 -0
  354. package/dist/ir/analysis.test.js +21 -0
  355. package/dist/ir/analysis.test.js.map +1 -0
  356. package/dist/ir/build.d.ts +9 -0
  357. package/dist/ir/build.js +33 -0
  358. package/dist/ir/build.js.map +1 -0
  359. package/dist/ir/integer-loops.d.ts +1 -1
  360. package/dist/ir/{nodes.d.ts → ir.d.ts} +119 -37
  361. package/dist/ir/{nodes.js → ir.js} +170 -166
  362. package/dist/ir/ir.js.map +1 -0
  363. package/dist/ir/ir.test.d.ts +1 -0
  364. package/dist/ir/ir.test.js +17 -0
  365. package/dist/ir/ir.test.js.map +1 -0
  366. package/dist/ir/serialize.d.ts +2 -2
  367. package/dist/ir/serialize.js +3 -2
  368. package/dist/ir/serialize.js.map +1 -1
  369. package/dist/ir/validate.d.ts +1 -1
  370. package/dist/ir/validate.js +93 -41
  371. package/dist/ir/validate.js.map +1 -1
  372. package/dist/library/cache-primitives.d.ts +24 -0
  373. package/dist/library/cache-primitives.js +83 -0
  374. package/dist/library/cache-primitives.js.map +1 -0
  375. package/dist/library/cache-reset.test.d.ts +1 -0
  376. package/dist/library/cache-reset.test.js +47 -0
  377. package/dist/library/cache-reset.test.js.map +1 -0
  378. package/dist/library/{implementation-identity.js → compiler-self-identity.js} +1 -1
  379. package/dist/library/compiler-self-identity.js.map +1 -0
  380. package/dist/library/fence-eval.d.ts +3 -1
  381. package/dist/library/fence-eval.js +8 -2
  382. package/dist/library/fence-eval.js.map +1 -1
  383. package/dist/library/int-infer.d.ts +1 -36
  384. package/dist/library/int-infer.js +29 -18
  385. package/dist/library/int-infer.js.map +1 -1
  386. package/dist/library/int-infer.test.js +4 -4
  387. package/dist/library/{early-cache.d.ts → library-cache.d.ts} +1 -1
  388. package/dist/library/{early-cache.js → library-cache.js} +34 -89
  389. package/dist/library/library-cache.js.map +1 -0
  390. package/dist/library/library-cache.test.d.ts +1 -0
  391. package/dist/library/{early-cache.test.js → library-cache.test.js} +7 -7
  392. package/dist/library/library-cache.test.js.map +1 -0
  393. package/dist/library/{profile.d.ts → library-profile.d.ts} +4 -7
  394. package/dist/library/{profile.js → library-profile.js} +18 -11
  395. package/dist/library/library-profile.js.map +1 -0
  396. package/dist/library/semantic-source.js +2 -1
  397. package/dist/library/semantic-source.js.map +1 -1
  398. package/dist/library/sidecar.d.ts +5 -2
  399. package/dist/library/sidecar.js +11 -5
  400. package/dist/library/sidecar.js.map +1 -1
  401. package/dist/startup-cache.d.ts +11 -3
  402. package/dist/startup-cache.js +17 -2
  403. package/dist/startup-cache.js.map +1 -1
  404. package/package.json +19 -2
  405. package/surface-manifest.json +5 -5
  406. package/dist/backend/cc-cache.test.js.map +0 -1
  407. package/dist/backend/cc.js.map +0 -1
  408. package/dist/backend/emission/emit-async.js.map +0 -1
  409. package/dist/backend/emission/emit-exprs.d.ts +0 -13
  410. package/dist/backend/emission/emit-exprs.js +0 -7407
  411. package/dist/backend/emission/emit-exprs.js.map +0 -1
  412. package/dist/backend/emission/emit-island.js.map +0 -1
  413. package/dist/backend/emission/emit-shapes.js.map +0 -1
  414. package/dist/backend/emission/emit-stmts.js.map +0 -1
  415. package/dist/backend/emission/emit-types.js.map +0 -1
  416. package/dist/backend/emission/emit-walkers.js.map +0 -1
  417. package/dist/backend/emission/emitter.js.map +0 -1
  418. package/dist/backend/emission/may-throw.js.map +0 -1
  419. package/dist/backend/library-identity.js.map +0 -1
  420. package/dist/executable/early-cache.js.map +0 -1
  421. package/dist/executable/early-cache.test.js.map +0 -1
  422. package/dist/ffi/profile.js.map +0 -1
  423. package/dist/frontend/lowering/lower-emitter.js.map +0 -1
  424. package/dist/frontend/shared.d.ts +0 -82
  425. package/dist/frontend/shared.js +0 -308
  426. package/dist/frontend/shared.js.map +0 -1
  427. package/dist/frontend/ts7/program.js.map +0 -1
  428. package/dist/frontend/types.js.map +0 -1
  429. package/dist/ir/nodes.js.map +0 -1
  430. package/dist/library/early-cache.js.map +0 -1
  431. package/dist/library/early-cache.test.js.map +0 -1
  432. package/dist/library/implementation-identity.js.map +0 -1
  433. package/dist/library/profile.js.map +0 -1
  434. /package/dist/backend/{cc-cache.test.d.ts → c/types.test.d.ts} +0 -0
  435. /package/dist/{executable/early-cache.test.d.ts → backend/llvm/shapes.test.d.ts} +0 -0
  436. /package/dist/{library/early-cache.test.d.ts → backend/native-codegen.test.d.ts} +0 -0
  437. /package/dist/ffi/{profile.d.ts → ffi-manifest.d.ts} +0 -0
  438. /package/dist/frontend/ts7/{program.d.ts → program-adapter.d.ts} +0 -0
  439. /package/dist/library/{implementation-identity.d.ts → compiler-self-identity.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as ts from "../ts7/adapter.js";
2
2
  import type { Lowerer } from "./lowerer.js";
3
- import { IrExpr, IrLocal, IrRecordShape, IrStmt, IrType, SrcLoc } from "../../ir/nodes.js";
3
+ import { IrExpr, IrLocal, IrRecordShape, IrStmt, IrType, SrcLoc } from "../../ir/ir.js";
4
4
  import { CompoundOp } from "./surfaces.js";
5
5
  /** An assignable `obj.field` target — a class field, a record field, or a
6
6
  * class ACCESSOR property (reads become getter calls, writes setter calls;
@@ -52,15 +52,8 @@ export declare function templateRawTextOf(node: ts.NoSubstitutionTemplateLiteral
52
52
  /** True when a property access names an ABSTRACT property declaration
53
53
  * (`abstract p: number` — a PropertyDeclaration, not an accessor): the
54
54
  * named-fence test for reads/writes through abstract-typed receivers. */
55
- export declare function abstractPropertyDeclOf(L: Lowerer, expr: ts.PropertyAccessExpression): boolean;
56
- export declare function lowerExpr(L: Lowerer, expr: ts.Expression): IrExpr;
57
- /** `c ? a : b` — see the inline comments. `expected` plays the contextual
58
- * array type's role when the caller knows the slot's array type and tsc's
59
- * API doesn't surface it (a ternary as a SPREAD source — lowerArrayLiteral
60
- * threads the literal's own type in). */
61
- export declare function lowerTernary(L: Lowerer, expr: ts.ConditionalExpression, expected?: IrType & {
62
- kind: "array";
63
- }): IrExpr;
55
+ export declare function abstractPropertyDeclOf(lowerer: Lowerer, expr: ts.PropertyAccessExpression): boolean;
56
+ export declare function lowerExpr(lowerer: Lowerer, expr: ts.Expression): IrExpr;
64
57
  /** Checker-driven union narrowing. tsc's control-flow analysis narrows a
65
58
  * union-typed reference at use sites (`if (r.kind === "ok") { ...r... }`
66
59
  * types `r` as the ok-arm inside the branch); the IR value is still the
@@ -71,7 +64,7 @@ export declare function lowerTernary(L: Lowerer, expr: ts.ConditionalExpression,
71
64
  * the same union (unnarrowed use), to a SUB-union (partial narrowing —
72
65
  * unrepresentable without a re-tag), or to nothing (`never` in an
73
66
  * exhaustive default) leaves the expression union-typed. */
74
- export declare function maybeNarrow(L: Lowerer, expr: IrExpr, node: ts.Node): IrExpr;
67
+ export declare function maybeNarrow(lowerer: Lowerer, expr: IrExpr, node: ts.Node): IrExpr;
75
68
  /** `v === undefined` / `v !== null` — the narrowing tests for unit-armed
76
69
  * unions. A union operand compared with a unit literal lowers to a
77
70
  * runtime TAG test (unionIsTag); afterwards tsc's control-flow narrowing
@@ -82,20 +75,7 @@ export declare function maybeNarrow(L: Lowerer, expr: IrExpr, node: ts.Node): Ir
82
75
  * (flow narrowing applies to references, never to calls), and soundness
83
76
  * is the same trust-the-checker bet unionNarrow already makes. Null when
84
77
  * neither side is a unit literal (not a unit comparison). */
85
- export declare function lowerUnitComparison(L: Lowerer, left: IrExpr, right: IrExpr, negated: boolean, loc: SrcLoc): IrExpr | null;
86
- /** `x == null` / `x != null` — JS's idiomatic null-OR-undefined test, the
87
- * ONE loose comparison with static semantics: `== null` matches exactly
88
- * null and undefined (0, "", and false do not). Requires a syntactic
89
- * null LITERAL on either side; the other operand's unit arms become a
90
- * runtime tag test — one `unionIsTag` when the union has a single unit
91
- * arm, a short-circuit pair over both tags otherwise (that shape re-emits
92
- * the operand, so only side-effect-free reads compose; anything else
93
- * keeps the fence). A unit-literal operand folds (null and undefined are
94
- * mutually loose-equal), and a non-nullable operand folds statically —
95
- * the same trust-the-checker bet as lowerUnitComparison. Null (fence)
96
- * when this isn't a null-literal comparison or the operand has no
97
- * lowering here (dyn/jsval/void). */
98
- export declare function lowerLooseNullCompare(L: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr | null;
78
+ export declare function lowerUnitComparison(lowerer: Lowerer, left: IrExpr, right: IrExpr, negated: boolean, loc: SrcLoc): IrExpr | null;
99
79
  /** Safe to EMIT twice: plain reads with no side effects — local/global
100
80
  * reads and record/class field reads over such (accessor properties
101
81
  * lower to getter CALLS, so they never appear as field reads). Used by
@@ -123,35 +103,7 @@ export declare function pureReemittable(e: IrExpr): boolean;
123
103
  * trust-the-checker bet as lowerUnitComparison's static fold. Sub-union
124
104
  * results (several non-unit arms) and defaults that change the result
125
105
  * type are fenced with narrow-first hints. */
126
- export declare function lowerNullishCoalesce(L: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr;
127
- /** One optional-chain STEP: `a?.b`, `a?.m(...)`, `a?.[i]` (the token on
128
- * the member access) and `f?.()` (the token on the call). The receiver
129
- * lowers once; when it is a unit-armed union with ONE non-unit arm, the
130
- * member/call lowers exactly as its non-optional spelling would — the
131
- * receiver node reads back as the chain's bound narrowed value
132
- * (chainRecv) and types as its non-nullish type — and the whole thing
133
- * becomes an optChain node: tag test, undefined on the unit path (JS:
134
- * null receivers still yield undefined), the body lazily otherwise,
135
- * argument side effects included. A receiver the checker types
136
- * never-nullish makes `?.` behave exactly like `.` — the guard folds
137
- * away and the plain lowering is the value (trust-the-checker, like
138
- * ??'s fold). Multi-step TAILS (`a?.b.c`, `x?.trim().toLowerCase()`)
139
- * short-circuit whole: the guarded member step is the chain's dot and
140
- * every later step lowers inside the guard, checker-narrowed non-nullish
141
- * (see chainTailDot); sub-union receivers are fenced with rewrite
142
- * hints. */
143
- /** The unhandled `?.`-carrying MEMBER step in this node's receiver
144
- * spine, when the node is the TAIL of an optional chain whose token sits
145
- * deeper — `x?.trim().toLowerCase()` reads nothing past the guard when x
146
- * is nullish, so the whole tail must lower inside it. Walks
147
- * property/element accesses and call steps only (parens and `!` break
148
- * the chain per the grammar: `(a?.b).c` throws on undefined in JS);
149
- * the node's OWN token — and a call's immediate callee token — are the
150
- * plain entries' cases, not tails, and handled markers make the chain
151
- * lowering's re-dispatch walk past its own step. `f?.()` steps stay out
152
- * (a call carrying the token has no member step to re-enter — the
153
- * split-it fence keeps them). */
154
- export declare function chainTailDot(L: Lowerer, expr: ts.Expression): ts.PropertyAccessExpression | ts.ElementAccessExpression | null;
106
+ export declare function lowerNullishCoalesce(lowerer: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr;
155
107
  /** True when `expr` is `require.main.filename` (either dot optional) on
156
108
  * the AMBIENT CommonJS require — the entry-module identity read. The
157
109
  * value is the ENTRY file's path, a compile-time constant like
@@ -160,57 +112,44 @@ export declare function chainTailDot(L: Lowerer, expr: ts.Expression): ts.Proper
160
112
  * lowering (the fold) and lowerStringMethodCall's receiver gate (the
161
113
  * checker types the chain `string | undefined`, but the folded receiver
162
114
  * IS a string). */
163
- export declare function isRequireMainFilename(L: Lowerer, expr: ts.Expression): boolean;
164
- /** True when `expr` is the tail of an optional chain the STATIC chain
165
- * machinery should short-circuit whole: an unhandled deeper `?.` whose
166
- * guarded receiver lowers as a unit-armed union. Dyn ('unknown') and
167
- * island ('any') receivers answer their tails through their own
168
- * undefined-propagating reads and stay out; never-nullish receivers fold
169
- * at the token's own entry. */
170
- export declare function chainTailClaimed(L: Lowerer, expr: ts.Expression): boolean;
171
- /** True when an EARLIER step of this access chain carries `?.` — JS
172
- * short-circuits the whole tail (`a?.b.c` reads nothing when a is
173
- * nullish), so a dyn tail read must answer undefined instead of
174
- * throwing. Walks the receiver spine only; the argument of the access
175
- * itself is not part of the guard. */
176
- export declare function chainGuardedByQuestionDot(expr: ts.Expression): boolean;
177
- export declare function lowerOptionalChain(L: Lowerer, expr: ts.CallExpression | ts.PropertyAccessExpression | ts.ElementAccessExpression): IrExpr;
115
+ export declare function isRequireMainFilename(lowerer: Lowerer, expr: ts.Expression): boolean;
116
+ export declare function lowerOptionalChain(lowerer: Lowerer, expr: ts.CallExpression | ts.PropertyAccessExpression | ts.ElementAccessExpression): IrExpr;
178
117
  /** The optChain node around a lowered chain body: void bodies keep the
179
118
  * statement form (`cb?.();` — the checker's `void | undefined` result IS
180
119
  * void here); value bodies wrap into the checker's undefined-armed
181
120
  * result union. */
182
- export declare function finishOptionalChain(L: Lowerer, expr: ts.Expression, id: string, receiver: IrExpr, body: IrExpr, loc: SrcLoc): IrExpr;
121
+ export declare function finishOptionalChain(lowerer: Lowerer, expr: ts.Expression, id: string, receiver: IrExpr, body: IrExpr, loc: SrcLoc): IrExpr;
183
122
  /** A CONDITION-position expression: the result is consumed as a bool
184
123
  * only, so `&&`/`||` descend recursively over ToBoolean'd operands —
185
124
  * JS-exact (`ToBoolean(a && b)` ≡ `ToBoolean(a) && ToBoolean(b)`), still
186
125
  * short-circuiting, and mixed operand kinds that have no VALUE
187
126
  * representation (`u && flag` — a union and a bool) test fine here. */
188
- export declare function lowerCondition(L: Lowerer, expr: ts.Expression): IrExpr;
189
- export declare function runtimeOptionalTrueIds(L: Lowerer, node: ts.Expression): IrLocal[];
190
- export declare function withRuntimeOptionalNarrowed<T>(L: Lowerer, locals: readonly IrLocal[], fn: () => T): T;
127
+ export declare function lowerCondition(lowerer: Lowerer, expr: ts.Expression): IrExpr;
128
+ export declare function runtimeOptionalTrueIds(lowerer: Lowerer, node: ts.Expression): IrLocal[];
129
+ export declare function withRuntimeOptionalNarrowed<T>(lowerer: Lowerer, locals: readonly IrLocal[], fn: () => T): T;
191
130
  /** JS ToBoolean: bool passes through; f64/string get a `toBool` wrapper
192
131
  * (falsy: 0, -0, NaN, ""); unions get the same wrapper answered by a
193
132
  * per-union interned helper (unit arms falsy; scalar/string arms by
194
133
  * value; ref arms always truthy). Anything else (void) cannot be
195
134
  * tested. */
196
- export declare function ensureBool(L: Lowerer, e: IrExpr, node: ts.Expression): IrExpr;
135
+ export declare function ensureBool(lowerer: Lowerer, e: IrExpr, node: ts.Expression): IrExpr;
197
136
  /** Truthiness needs a ToBoolean per arm: dyn/caught arms have none (a
198
137
  * dynamic ToBoolean over the checked-dynamic tree / the snapshot box) — fence those
199
138
  * unions; every other arm kind is answerable (units false, scalars and
200
139
  * strings by value, refs true, jsval by the engine). */
201
- export declare function requireTruthyUnion(L: Lowerer, unionId: string, node: ts.Expression): void;
140
+ export declare function requireTruthyUnion(lowerer: Lowerer, unionId: string, node: ts.Expression): void;
202
141
  /** Strict equality needs a per-arm comparison: units, scalars, strings,
203
142
  * and ref kinds (pointer identity) all have one; dyn/caught arms have no
204
143
  * static equality and jsval arms would need the engine's `===` — those
205
144
  * unions keep the narrow-first fence. */
206
- export declare function eqComparableUnion(L: Lowerer, unionId: string): boolean;
145
+ export declare function eqComparableUnion(lowerer: Lowerer, unionId: string): boolean;
207
146
  /** Property access on a string or array receiver: `.length` lowers to the
208
147
  * matching intrinsic; a bare method reference (`const f = s.slice` — a
209
148
  * function value) is rejected with a specific message. Returns null for
210
149
  * other receivers (the generic property-access rejection applies). Both
211
150
  * the receiver type AND the ambient-file provenance of the member are
212
151
  * verified — the name alone proves nothing. */
213
- export declare function lowerIntrinsicProperty(L: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
152
+ export declare function lowerIntrinsicProperty(lowerer: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
214
153
  /** `[a, b, c]`. The element type comes from the contextual type when tsc
215
154
  * has one (`const a: number[] = []`, arguments, nested literals) and from
216
155
  * the literal's own inferred type otherwise. A bare `[]` with no context
@@ -219,12 +158,12 @@ export declare function lowerIntrinsicProperty(L: Lowerer, expr: ts.PropertyAcce
219
158
  * tsc's API doesn't surface it (ternary arms under an array context —
220
159
  * tsc accepts the arm covariantly, but a tagged element representation
221
160
  * must be BUILT as the slot's element type). */
222
- export declare function lowerArrayLiteral(L: Lowerer, expr: ts.ArrayLiteralExpression, expected?: (IrType & {
161
+ export declare function lowerArrayLiteral(lowerer: Lowerer, expr: ts.ArrayLiteralExpression, expected?: (IrType & {
223
162
  kind: "array";
224
163
  }) | (IrType & {
225
164
  kind: "record";
226
165
  })): IrExpr;
227
- export declare function foldedStringKeyOf(L: Lowerer, expr: ts.Expression): string | null;
166
+ export declare function foldedStringKeyOf(lowerer: Lowerer, expr: ts.Expression): string | null;
228
167
  /** The runtime-keyed JS object literal (a computed key that doesn't fold):
229
168
  * builds a dyn object member-by-member. Keys evaluate before their values,
230
169
  * properties in source order — JS's object-literal evaluation exactly.
@@ -236,8 +175,12 @@ export declare function foldedStringKeyOf(L: Lowerer, expr: ts.Expression): stri
236
175
  * (dynFrom's domain, functions box); a value with no dyn representation
237
176
  * fences per property. Spreads copy through dyn.assign in source order;
238
177
  * accessors stay fenced. */
239
- export declare function lowerDynObjectLiteral(L: Lowerer, expr: ts.ObjectLiteralExpression, boxValue?: (node: ts.Expression, value: IrExpr) => IrExpr): IrExpr;
240
- export declare function lowerObjectLiteral(L: Lowerer, expr: ts.ObjectLiteralExpression): IrExpr;
178
+ export declare function lowerDynObjectLiteral(lowerer: Lowerer, expr: ts.ObjectLiteralExpression, boxValue?: (node: ts.Expression, value: IrExpr) => IrExpr): IrExpr;
179
+ /** Convert an undefined-armed numeric value at an arithmetic use. Ordinary
180
+ * reads preserve their tagged value; JavaScript's ToNumber(undefined) is NaN,
181
+ * so compounds and binary arithmetic use this checked one-time extraction. */
182
+ export declare function lowerOptionalNumber(lowerer: Lowerer, operand: IrExpr, loc: SrcLoc, narrowedNode?: ts.Expression): IrExpr;
183
+ export declare function lowerObjectLiteral(lowerer: Lowerer, expr: ts.ObjectLiteralExpression): IrExpr;
241
184
  /** A conditional spread's carrier property: `name: value` or shorthand,
242
185
  * with an identifier/string-literal name. */
243
186
  export type CondSpreadProp = (ts.PropertyAssignment | ts.ShorthandPropertyAssignment) & {
@@ -259,23 +202,16 @@ export declare function conditionalSpreadOf(expr: ts.Expression): {
259
202
  /** The value of a shorthand property (`{ x }`): the binding `x` refers to.
260
203
  * The property name's own symbol is the PROPERTY, so resolution goes
261
204
  * through getShorthandAssignmentValueSymbol. */
262
- export declare function lowerShorthandValue(L: Lowerer, prop: ts.ShorthandPropertyAssignment): IrExpr;
205
+ export declare function lowerShorthandValue(lowerer: Lowerer, prop: ts.ShorthandPropertyAssignment): IrExpr;
263
206
  /** Rejects any `this` inside an object-literal method body — including in
264
207
  * nested arrows, which inherit the method's `this` (nested function
265
208
  * expressions reset it, but their bare `this` is already a tsc error
266
209
  * under noImplicitThis, so over-rejecting them here changes nothing). */
267
- export declare function rejectThisInObjectMethod(L: Lowerer, node: ts.Node): void;
268
- /** The accessor twin of rejectThisInObjectMethod: a get/set accessor body
269
- * referencing `this` (`get x() { return this._x }`). The accessor lowers
270
- * as a closure stored IN the record — passing the record as a receiver
271
- * would capture the value under construction (an RC cycle), and the
272
- * generic lexical-this walk would silently bind an ENCLOSING method's
273
- * `this`; the fence names the fix (capture a binding instead). */
274
- export declare function rejectThisInObjectAccessor(L: Lowerer, node: ts.Node): void;
210
+ export declare function rejectThisInObjectMethod(lowerer: Lowerer, node: ts.Node): void;
275
211
  /** `a[i]` reads. Only f64 indices into array receivers are modeled; JS
276
212
  * string-key element access (`a["length"]`) and string indexing (`s[0]`
277
213
  * typechecks against the lib's index signature; use .charAt) stay out. */
278
- export declare function lowerElementAccess(L: Lowerer, expr: ts.ElementAccessExpression): IrExpr;
214
+ export declare function lowerElementAccess(lowerer: Lowerer, expr: ts.ElementAccessExpression): IrExpr;
279
215
  /** `r[k]` over a (non-tuple) record shape. A LITERAL key naming a declared
280
216
  * field is the bracket spelling of field access (the ONLY spelling tsc
281
217
  * permits for signature-declared fields under
@@ -290,7 +226,7 @@ export declare function lowerElementAccess(L: Lowerer, expr: ts.ElementAccessExp
290
226
  * fields outside that stay fenced. Declared-only shapes support reads
291
227
  * whose key type proves membership (tsc's keyof check): all fields must
292
228
  * share the result type, and a smuggled miss traps. */
293
- export declare function lowerRecordKeyRead(L: Lowerer, expr: ts.ElementAccessExpression, shapeId: string, shape: IrRecordShape, includeUndefined?: boolean): IrExpr;
229
+ export declare function lowerRecordKeyRead(lowerer: Lowerer, expr: ts.ElementAccessExpression, shapeId: string, shape: IrRecordShape, includeUndefined?: boolean): IrExpr;
294
230
  /** A keyed read used only to observe absence (`if (map[k])`, or the left
295
231
  * side of `||`/`??`). JavaScript answers undefined for missing record keys
296
232
  * and array indices even when noUncheckedIndexedAccess is disabled. Keep
@@ -298,29 +234,15 @@ export declare function lowerRecordKeyRead(L: Lowerer, expr: ts.ElementAccessExp
298
234
  * consumed it; ordinary unchecked reads retain the typed trap. Assertions
299
235
  * around the read are erased here because this context handles the missing
300
236
  * arm instead of consuming it as the asserted type. */
301
- export declare function lowerAbsenceProbe(L: Lowerer, node: ts.Expression): IrExpr | null;
302
- /** The compile-time string spelling of a record key literal: a string
303
- * literal's text, or a NON-NEGATIVE numeric literal's canonical JS
304
- * spelling (`1` → "1", `1e21` → "1e+21" — String(Number(text)), which is
305
- * exactly the key JS derives; negative/computed keys stay runtime
306
- * expressions and canonicalize through ensureString instead). Null for
307
- * everything else. */
308
- export declare function recordKeyLiteralText(node: ts.Expression): string | null;
309
- /** The compile-time key an IDENTIFIER's TYPE proves: a key variable whose
310
- * (narrowed) type is one string/number literal — `const k: "a" = …; o[k]`,
311
- * and the generic-body form where k's type is a keyof-constrained
312
- * parameter bound to a literal (`pick(o, "a")`'s instance reads `o[k]`
313
- * with K = "a", resolved through typeParamTsBindings). Identifier reads
314
- * are pure, so the static field read may skip evaluating the key exactly
315
- * like a syntactic literal. Null anywhere the type keeps more than one
316
- * key. */
317
- export declare function recordKeyTypeLiteralText(L: Lowerer, node: ts.Expression): string | null;
237
+ export declare function lowerAbsenceProbe(lowerer: Lowerer, node: ts.Expression): IrExpr | null;
318
238
  /** `a[i] = v` in statement position → arraySet (element writes, like local
319
239
  * assignment, produce no value in our subset). */
320
- export declare function lowerElementWrite(L: Lowerer, expr: ts.BinaryExpression): IrStmt;
321
- export declare function ensureString(L: Lowerer, e: IrExpr, node: ts.Node): IrExpr;
322
- export declare function lowerTemplate(L: Lowerer, expr: ts.TemplateExpression): IrExpr;
323
- /** `x as T`. Non-dyn inner values keep today's pure-erasure semantics.
240
+ export declare function lowerElementWrite(lowerer: Lowerer, expr: ts.BinaryExpression): IrStmt;
241
+ export declare function ensureString(lowerer: Lowerer, e: IrExpr, node: ts.Node): IrExpr;
242
+ export declare function lowerTemplate(lowerer: Lowerer, expr: ts.TemplateExpression): IrExpr;
243
+ /** `x as T`. Non-dyn inner values ordinarily erase; a record assertion
244
+ * changing monomorphic shape rebuilds through the established width-copy
245
+ * path so its represented value agrees with its asserted type.
324
246
  * A dyn ('unknown') inner value makes this THE dynamic boundary:
325
247
  * - `as unknown` (dyn → dyn) stays erasure;
326
248
  * - dyn → a JSON-representable target type T compiles to `dynCheck`, a
@@ -332,17 +254,10 @@ export declare function lowerTemplate(L: Lowerer, expr: ts.TemplateExpression):
332
254
  * those types cannot be found inside a JSON dyn. */
333
255
  /** `e as T` and the old-style assertion `<T>e` — one node shape (both
334
256
  * carry `.type` and `.expression`), one lowering. */
335
- export declare function lowerAsExpression(L: Lowerer, expr: ts.AsExpression | ts.TypeAssertion): IrExpr;
336
- export declare function lowerPrefixUnary(L: Lowerer, expr: ts.PrefixUnaryExpression): IrExpr;
337
- /** `x++`/`x--`/`++x`/`--x` in EXPRESSION position — the incDec node:
338
- * read, write ±1, yield old (postfix) or new (prefix) value. Receivers
339
- * are f64 LOCALS or module globals (captured/boxed included — the
340
- * backend reads/writes through the box); record fields and array
341
- * elements keep the fence in value position (statement-position `obj.f++`
342
- * still desugars through the compound-field path). */
343
- export declare function lowerIncDec(L: Lowerer, expr: ts.PrefixUnaryExpression | ts.PostfixUnaryExpression, prefix: boolean): IrExpr;
344
- export declare function lowerBinary(L: Lowerer, expr: ts.BinaryExpression): IrExpr;
345
- export declare function lowerCaughtTypeofTest(L: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr | null;
257
+ export declare function lowerAsExpression(lowerer: Lowerer, expr: ts.AsExpression | ts.TypeAssertion): IrExpr;
258
+ export declare function lowerPrefixUnary(lowerer: Lowerer, expr: ts.PrefixUnaryExpression): IrExpr;
259
+ export declare function lowerBinary(lowerer: Lowerer, expr: ts.BinaryExpression): IrExpr;
260
+ export declare function lowerCaughtTypeofTest(lowerer: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr | null;
346
261
  /** ALIASED-TYPEOF narrowing (npm-static JS): the narrows a condition
347
262
  * PROVES about typeof-aliased operands when it evaluates to `polarity` —
348
263
  * ms's `var type = typeof val; if (type === 'string' && val.length > 0)`
@@ -356,67 +271,19 @@ export declare function lowerCaughtTypeofTest(L: Lowerer, expr: ts.BinaryExpress
356
271
  * condition itself still lowers as the plain string comparison), the
357
272
  * operand's type maps to a union whose arms all have static typeof
358
273
  * answers, and EXACTLY ONE arm answers the literal. The result feeds
359
- * L.narrowingAliases: branch-scoped typeOf overrides, bridged by
274
+ * lowerer.narrowingAliases: branch-scoped typeOf overrides, bridged by
360
275
  * maybeNarrow's ordinary unionNarrow. */
361
- export declare function aliasTypeofNarrows(L: Lowerer, cond: ts.Expression, polarity: boolean): {
276
+ export declare function aliasTypeofNarrows(lowerer: Lowerer, cond: ts.Expression, polarity: boolean): {
362
277
  sym: ts.Symbol;
363
278
  tsArm: ts.Type;
364
279
  }[];
365
- /** `typeof v === "lit"` / `typeof v !== "lit"` where v is UNION-typed: the
366
- * arms whose static typeof answer equals the literal form a tag set, and
367
- * the test is a runtime tag test — one `unionIsTag` for a single matching
368
- * arm (the operand embeds once, so even effectful operands compose), a
369
- * short-circuit chain for several (pure reads only — the operand rides
370
- * every test, exactly the `== null` composition rule). When every arm
371
- * answers the same way the comparison is statically decided and folds to
372
- * a bool literal — dropping only a side-effect-free read, the same
373
- * trust-the-checker bet as lowerUnitComparison. tsc's control-flow
374
- * narrowing then types the branches, and reads bridge through
375
- * maybeNarrow's unionNarrow as usual. Null when neither side is a typeof
376
- * over a union-typed operand or the literal side isn't a literal (the
377
- * bare-typeof value form then composes with strEq for pure operands). */
378
- export declare function lowerUnionTypeofTest(L: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr | null;
379
- /** `typeof v === "lit"` / `typeof v !== "lit"` where v is `unknown`-typed
380
- * (dyn): the runtime kind test over the dyn node's tag. Only the kinds a
381
- * later read can bridge narrow ("string"/"number"/"boolean") plus
382
- * "undefined" (no payload to read); "object"/"function" tests keep the
383
- * fence — an object-narrowed `unknown` read has no lowering anyway (a
384
- * checked cast `v as T` is the supported extraction). Null when neither
385
- * side is a typeof over a dyn-typed operand (not this pattern). */
386
- export declare function lowerDynTypeofTest(L: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr | null;
387
- /** `exports.<name>` in a JS module whose `module.exports =` REPLACED the
388
- * export object, with no `exports.<name> =` attachment anywhere in the
389
- * file: the read observes the ORIGINAL (empty-here) exports object, so
390
- * the honest value is undefined (Node's object identity exactly; tsc's
391
- * CJS model types the read off the replacement — identity-blind). Null
392
- * everywhere else: no replacement, a real attachment of this name, a
393
- * shadowing binding named `exports`, or write position. */
394
- export declare function lowerReplacedExportsRead(L: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
395
- /** A read that resolves to a CJS export-table ACCESSOR property
396
- * (`module.exports = { get path() {...}, set path(v) {...} }`): the
397
- * getter lifts as a module-level function (module globals need no
398
- * captures) — interned per declaration so every read site calls ONE
399
- * function — and the read IS the call, Node's per-read evaluation
400
- * exactly. Null when the identifier doesn't resolve to such a property
401
- * (or it has no getter: a setter-only read answers undefined in Node —
402
- * rare enough to keep fenced). */
403
- export declare function cjsExportAccessorRead(L: Lowerer, ident: ts.Identifier): IrExpr | null;
404
- /** `this.<name>` INSIDE a CJS export-table accessor (test/common's
405
- * `get localhostIPv4() { if (this.inFreeBSDJail) ... }`): Node binds the
406
- * getter's receiver to module.exports, so the read is the SIBLING table
407
- * property — a sibling GETTER's lifted call (per-read evaluation, like
408
- * any accessor read). Only arrows inherit the binding (a nested function
409
- * expression's `this` is its own). Null everywhere else — non-getter
410
- * siblings and absent names keep their per-site fences (none of the
411
- * probed suite shapes read them). */
412
- export declare function lowerCjsExportTableThisMember(L: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
413
280
  /** Lowers an expression, converting a fence (PoisonError) into a null
414
281
  * DECLINE — the probing dispatch for shapes where only the lowered
415
282
  * value's type can say whether a lowering applies. unsupported() pushes
416
283
  * its diagnostic BEFORE throwing, so the probe runs behind a diagnostic
417
284
  * sink: a declined probe's diagnostics vanish (the sibling lowerings
418
285
  * own the site), a successful probe's flush through afterwards. */
419
- export declare function probeLower(L: Lowerer, node: ts.Expression): IrExpr | null;
286
+ export declare function probeLower(lowerer: Lowerer, node: ts.Expression): IrExpr | null;
420
287
  /** A read of a catch binding — the caught analog of maybeNarrow. Where
421
288
  * tsc's control-flow narrowing has proven a supported test (`instanceof`
422
289
  * over a hierarchy class, `typeof` over a primitive), the read bridges
@@ -424,18 +291,18 @@ export declare function probeLower(L: Lowerer, node: ts.Expression): IrExpr | nu
424
291
  * exactly like unionNarrow). Every OTHER read is the narrowness fence:
425
292
  * the binding's payload is a typed exception snapshot, not a dyn, so
426
293
  * un-narrowed uses have nothing sound to lower to. */
427
- export declare function caughtRead(L: Lowerer, node: ts.Identifier, local: IrLocal, loc: SrcLoc): IrExpr;
294
+ export declare function caughtRead(lowerer: Lowerer, node: ts.Identifier, local: IrLocal, loc: SrcLoc): IrExpr;
428
295
  /** `String(e)` / `${e}` where e is a catch binding: JS's String() over
429
296
  * the exception snapshot (scr_caught_to_string) — the one un-narrowed
430
297
  * read with a sound rendering for every payload kind. Intercepts BEFORE
431
298
  * lowerExpr like the other caught lowerings (caughtRead would fence).
432
299
  * Null when the expression isn't a catch binding. */
433
- export declare function caughtToString(L: Lowerer, node: ts.Expression): IrExpr | null;
300
+ export declare function caughtToString(lowerer: Lowerer, node: ts.Expression): IrExpr | null;
434
301
  /** The catch-binding local an expression names, or null. The dedicated
435
302
  * lowerings (instanceof, typeof tests, rethrow) intercept on this BEFORE
436
303
  * lowering the operand — a raw lowerExpr of the identifier would hit
437
304
  * caughtRead's fence. */
438
- export declare function caughtLocalOf(L: Lowerer, node: ts.Expression): IrLocal | null;
305
+ export declare function caughtLocalOf(lowerer: Lowerer, node: ts.Expression): IrLocal | null;
439
306
  /** `x instanceof C` for a program-declared class C. When x's static
440
307
  * class and C are both in extends-hierarchies the test is dynamic — the
441
308
  * O(1) preorder-interval check against the vtable (`instanceOf` node).
@@ -445,22 +312,7 @@ export declare function caughtLocalOf(L: Lowerer, node: ts.Expression): IrLocal
445
312
  * classes are unrelated (a standalone class has no other relatives).
446
313
  * Folding is limited to side-effect-free operands — dropping a computed
447
314
  * operand would skip its effects, so those are rejected instead. */
448
- export declare function lowerInstanceOf(L: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr;
449
- /** `"key" in v` — the key-presence test. Three lowered receivers:
450
- * process.env (getenv(3) presence — Node-exact, an empty value still
451
- * counts as present), and monomorphic record shapes, where the answer is
452
- * type-directed: a declared non-optional field is a compile-time `true`,
453
- * a missing field (no index signature) a compile-time `false` — both
454
- * folds limited to side-effect-free receivers, the lowerInstanceOf rule —
455
- * and an OPTIONAL field (undefined-armed union) is a runtime tag test on
456
- * the slot: present iff the arm is not undefined. That last case is the
457
- * representation's honest answer — a field explicitly assigned
458
- * `undefined` reads as absent (`"a" in {a: undefined}` is true in JS,
459
- * false here; SEMANTICS.md 55). Union receivers (the `in`-narrowing
460
- * idiom over multiple shapes), index-signature keys, class instances,
461
- * and dyn/unknown stay fenced. Keys are literal strings — a computed key
462
- * over a shape would need the runtime key table. */
463
- export declare function lowerInExpression(L: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr;
315
+ export declare function lowerInstanceOf(lowerer: Lowerer, expr: ts.BinaryExpression, loc: SrcLoc): IrExpr;
464
316
  /** A regex literal `/ab+c/gi` → regexLit (interned per (pattern, flags)
465
317
  * by the backend). The TS parser has already syntax-checked the literal;
466
318
  * what remains here is the flag-alphabet fence (d and v are
@@ -471,27 +323,7 @@ export declare function lowerInExpression(L: Lowerer, expr: ts.BinaryExpression,
471
323
  * (matchResultNamedGroupsOf). The engine validates the pattern itself
472
324
  * lazily at first use (SEMANTICS.md documents the divergence from
473
325
  * Node's parse-time SyntaxError). */
474
- export declare function lowerRegexLiteral(L: Lowerer, expr: ts.RegularExpressionLiteral): IrExpr;
475
- /** The pattern's named capture groups, in source order: each `(?<name>`
476
- * with its 1-based capture index (numbered and named groups share the
477
- * numbering — the index IS the match slice's element position). Null
478
- * when the scan can't answer confidently (an unterminated construct, a
479
- * `\u`-escaped group name) — callers fence rather than guess. Duplicate
480
- * names (ES2025 — valid across alternatives) appear once per
481
- * declaration; consumers pick the participating occurrence. The scan
482
- * only needs to track escapes, character classes, and `(` kinds; tsc
483
- * has already syntax-checked the literal, so a malformed pattern here
484
- * answers null and the engine's lazy compile reports it. */
485
- export declare function namedCaptureGroupsOfPattern(pattern: string): {
486
- name: string;
487
- index: number;
488
- }[] | null;
489
- /** The statically-known regex PATTERN behind an expression: a regex
490
- * literal, a const local initialized with one (the crypto.js
491
- * `const regexp = /(?<m>\d+)/` shape), or `new RegExp("...")` over a
492
- * string literal (the cooked text IS the pattern). Null when the regex
493
- * only exists at runtime — .groups consumers fence there. */
494
- export declare function staticRegexPatternOf(L: Lowerer, e: ts.Expression): string | null;
326
+ export declare function lowerRegexLiteral(lowerer: Lowerer, expr: ts.RegularExpressionLiteral): IrExpr;
495
327
  /** The named-group table of the regex that PRODUCED a match-result
496
328
  * expression — the `.groups` desugar's provenance question. Traces
497
329
  * (through parens, `!`, and const bindings):
@@ -501,37 +333,14 @@ export declare function staticRegexPatternOf(L: Lowerer, e: ts.Expression): stri
501
333
  * Answers null when the producing regex isn't statically known (the
502
334
  * caller keeps its fence), or the groups list (possibly empty — a
503
335
  * traced regex WITHOUT named groups is the Node-undefined case). */
504
- export declare function matchResultNamedGroupsOf(L: Lowerer, e: ts.Expression): {
336
+ export declare function matchResultNamedGroupsOf(lowerer: Lowerer, e: ts.Expression): {
505
337
  name: string;
506
338
  index: number;
507
339
  }[] | null;
508
- /** `m.groups` on a match result whose producing regex is statically
509
- * known: the honest slice already HOLDS every named group's value at
510
- * its capture index, so the groups object is a compile-time record
511
- * projection — `{ year: m[1], month: m[2] }` — built by one interned
512
- * helper per (shape, index list, receiver type). Node's exact shape
513
- * decisions:
514
- * - no named groups → `undefined` (the identifier-receiver shapes —
515
- * a call receiver would lose its own null trap, so those keep the
516
- * member fence);
517
- * - a nullable receiver (the JS `s.match(re).groups` idiom) throws
518
- * Node's exact TypeError on the unit arms;
519
- * - every declared name is a key (nonparticipating groups hold "" —
520
- * divergence 51's rule, exactly the slice elements they project);
521
- * - ES2025 duplicate names (distinct alternatives) project the first
522
- * participating occurrence: at most one participates, and a
523
- * participating-empty "" falls through to slots that are "" anyway;
524
- * - key order is group declaration order (declaredOrder), Node's own.
525
- * The record has no prototype — Node's groups object is null-prototype,
526
- * observable only through util.inspect's "[Object: null prototype]"
527
- * prefix (the Object.groupBy stance, ledgered). Null when the receiver
528
- * isn't a match slice or the regex isn't traceable — the caller's
529
- * member fence (with the groups hint) names the gap. */
530
- export declare function lowerMatchGroupsRead(L: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
531
340
  /** True when the IR type is the honest match slice — `string[]`, or a
532
341
  * union of it with unit arms only (`string[] | null`). The groups
533
342
  * projection's receiver gate, shared with the destructure interception. */
534
- export declare function isMatchSliceType(L: Lowerer, t: IrType): boolean;
343
+ export declare function isMatchSliceType(lowerer: Lowerer, t: IrType): boolean;
535
344
  /** The groups-record projection call: the result is the CHECKER'S OWN
536
345
  * shape — `{ [key: string]: string }`, the hybrid index-signature
537
346
  * record with no declared fields — holding one OVERFLOW entry per
@@ -540,7 +349,7 @@ export declare function isMatchSliceType(L: Lowerer, t: IrType): boolean;
540
349
  * wrap) meets exactly the type tsc reported. One lifted helper per
541
350
  * (index list, receiver representation) builds it; see
542
351
  * lowerMatchGroupsRead for the semantics the body encodes. */
543
- export declare function lowerGroupsProjection(L: Lowerer, recv: IrExpr, groups: {
352
+ export declare function lowerGroupsProjection(lowerer: Lowerer, recv: IrExpr, groups: {
544
353
  name: string;
545
354
  index: number;
546
355
  }[], loc: SrcLoc): IrExpr;
@@ -549,7 +358,7 @@ export declare function lowerGroupsProjection(L: Lowerer, recv: IrExpr, groups:
549
358
  * on classes are rejected specifically; func-typed record fields are
550
359
  * ordinary closure values, so bare references to them work (unlike class
551
360
  * methods, which have no bound-value form). */
552
- export declare function lowerFieldRead(L: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
361
+ export declare function lowerFieldRead(lowerer: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
553
362
  /** Shared-field read `r.f` on a UNION receiver: supported exactly when
554
363
  * every arm is a record/class possessing the field with ONE shared IR
555
364
  * type — the discriminant pattern (`r.kind`, primitive) and the
@@ -559,12 +368,12 @@ export declare function lowerFieldRead(L: Lowerer, expr: ts.PropertyAccessExpres
559
368
  * composes with existing strEq/bin/switch nodes, so `r.kind === "ok"`
560
369
  * and `switch (r.kind)` work without dedicated test nodes. Anything else
561
370
  * on a union receiver is rejected specifically (narrow first). */
562
- export declare function lowerUnionProperty(L: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
371
+ export declare function lowerUnionProperty(lowerer: Lowerer, expr: ts.PropertyAccessExpression): IrExpr | null;
563
372
  /** Recognizes `obj.field` as an assignable field target: receiver is a
564
373
  * known class instance OR a record, and the member is a field or (class
565
374
  * receivers) a declared accessor property. Returns the pieces of a
566
375
  * fieldSet/recordSet/accessor-call (minus value/kind) or null. */
567
- export declare function fieldTarget(L: Lowerer, access: ts.PropertyAccessExpression): FieldTarget | null;
376
+ export declare function fieldTarget(lowerer: Lowerer, access: ts.PropertyAccessExpression): FieldTarget | null;
568
377
  /** A STATICALLY-RESOLVABLE unique-symbol key: an identifier whose value
569
378
  * resolves (imports included) to a module-level `const k = Symbol(...)`
570
379
  * with no description or a literal one. tsc types such a const `unique
@@ -577,7 +386,7 @@ export declare function fieldTarget(L: Lowerer, access: ts.PropertyAccessExpress
577
386
  * types them as distinct unique symbols, so static slots would split
578
387
  * what JS shares), and computed descriptions (the field name below
579
388
  * must BE Node's, for inspect). */
580
- export declare function uniqueSymbolKeyOf(L: Lowerer, key: ts.Expression): {
389
+ export declare function uniqueSymbolKeyOf(lowerer: Lowerer, key: ts.Expression): {
581
390
  sym: ts.Symbol;
582
391
  fieldName: string;
583
392
  } | null;
@@ -586,23 +395,20 @@ export declare function uniqueSymbolKeyOf(L: Lowerer, key: ts.Expression): {
586
395
  * for the wiring sites (statement dispatch must not emit anything when
587
396
  * it declines). Null off class receivers, for non-static keys, and for
588
397
  * keys no class on the chain declares. */
589
- export declare function symbolFieldInfo(L: Lowerer, expr: ts.ElementAccessExpression): {
398
+ export declare function symbolFieldInfo(lowerer: Lowerer, expr: ts.ElementAccessExpression): {
590
399
  className: string;
591
400
  field: string;
592
401
  fieldType: IrType;
593
402
  } | null;
594
- /** `obj[k]` as an assignable field target — the symbol-keyed twin of
595
- * fieldTarget's class branch (the receiver lowers here, exactly once). */
596
- export declare function symbolFieldTarget(L: Lowerer, expr: ts.ElementAccessExpression): FieldTarget | null;
597
403
  /** The read expression for a field target (fieldGet / recordGet /
598
404
  * getter call). `blame` locates the rejection of a setter-only read —
599
405
  * tsc-clean (the property types as the setter's param), but Node yields
600
406
  * undefined, which these property types cannot represent. */
601
- export declare function fieldGetExpr(L: Lowerer, target: FieldTarget, loc: SrcLoc, blame: ts.Node): IrExpr;
407
+ export declare function fieldGetExpr(lowerer: Lowerer, target: FieldTarget, loc: SrcLoc, blame: ts.Node): IrExpr;
602
408
  /** The write statement for a field target (fieldSet / recordSet / setter
603
409
  * call). A write to a getter-only property never gets here in a clean
604
410
  * program (tsc's TS2540 is the fence); the rejection is the backstop. */
605
- export declare function fieldSetStmt(L: Lowerer, target: FieldTarget, value: IrExpr, loc: SrcLoc, blame: ts.Node): IrStmt;
411
+ export declare function fieldSetStmt(lowerer: Lowerer, target: FieldTarget, value: IrExpr, loc: SrcLoc, blame: ts.Node): IrStmt;
606
412
  /** `Promise.reject(reason)` on THE Promise global: a pre-rejected
607
413
  * promise. The reason is pinned to the Error hierarchy (the executor
608
414
  * reject parameter's contract — rejection payloads share the
@@ -614,7 +420,7 @@ export declare function fieldSetStmt(L: Lowerer, target: FieldTarget, value: IrE
614
420
  * result type (a declared return type, an annotated initializer, an
615
421
  * argument slot); without one no representable type exists and the
616
422
  * fence says so. Null for other members and non-Promise receivers. */
617
- export declare function lowerPromiseRejectCall(L: Lowerer, call: ts.CallExpression, access: ts.PropertyAccessExpression): IrExpr | null;
423
+ export declare function lowerPromiseRejectCall(lowerer: Lowerer, call: ts.CallExpression, access: ts.PropertyAccessExpression): IrExpr | null;
618
424
  /** `Promise.all([...])` where the literal's every entry is the SAME
619
425
  * promise type: the checker's tuple overload types the literal
620
426
  * [Promise<T>, Promise<T>] — a tuple RECORD, which the array path
@@ -624,19 +430,9 @@ export declare function lowerPromiseRejectCall(L: Lowerer, call: ts.CallExpressi
624
430
  * shape). Result Promise<T[]>; void inners collapse to Promise<void>
625
431
  * exactly like the array path. Null otherwise: heterogeneous literals
626
432
  * and non-literal arguments keep the array path and its fences. */
627
- export declare function lowerPromiseAllTupleCall(L: Lowerer, call: ts.CallExpression, access: ts.PropertyAccessExpression): IrExpr | null;
433
+ export declare function lowerPromiseAllTupleCall(lowerer: Lowerer, call: ts.CallExpression, access: ts.PropertyAccessExpression): IrExpr | null;
628
434
  /** `obj.f op= e` (and `obj.f++` with rhs null ≡ 1) — the element spelling
629
435
  * `obj[k] op= e` included when k is a declared symbol-keyed field.
630
436
  * Restricted to side-effect-free receivers (identifier or `this`)
631
437
  * because the desugar evaluates the receiver twice. */
632
- export declare function lowerFieldCompound(L: Lowerer, access: ts.PropertyAccessExpression | ts.ElementAccessExpression, op: CompoundOp, rhsNode: ts.Expression | null, loc: SrcLoc): IrStmt;
633
- /** The primitive-constructor closure (`String`/`Number`/`Boolean` as a
634
- * VALUE): interns one synthesized module function per constructor —
635
- * `%builtin.String` et al. — and returns the zero-capture closure over it.
636
- * The body IS the string-coercion the type mapping promised
637
- * (`(value: string) => primitive`): String is identity, Number the ECMA
638
- * StringToNumber (num.fromString — the same runtime call the direct
639
- * `Number(s)` lowering emits), Boolean the emptiness test. Interning makes
640
- * every reference the SAME immortal closure, so `opt.type === String`
641
- * compares like JS function identity. */
642
- export declare function primitiveCtorClosure(L: Lowerer, name: "String" | "Number" | "Boolean", loc: SrcLoc): IrExpr;
438
+ export declare function lowerFieldCompound(lowerer: Lowerer, access: ts.PropertyAccessExpression | ts.ElementAccessExpression, op: CompoundOp, rhsNode: ts.Expression | null, loc: SrcLoc): IrStmt;