@scriptc/compiler 0.1.7 → 0.2.0

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 (1032) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +73 -24
  2. package/ambient/scriptc-overrides.d.ts +10 -6
  3. package/ambient/scriptc.d.ts +15 -0
  4. package/dist/backend/build-cache.d.ts +1 -3
  5. package/dist/backend/build-cache.js +3 -22
  6. package/dist/backend/build-cache.js.map +1 -1
  7. package/dist/backend/cache-root.d.ts +3 -0
  8. package/dist/backend/cache-root.js +23 -0
  9. package/dist/backend/cache-root.js.map +1 -0
  10. package/dist/backend/cycle-analysis.d.ts +15 -0
  11. package/dist/backend/cycle-analysis.js +107 -0
  12. package/dist/backend/cycle-analysis.js.map +1 -0
  13. package/dist/backend/cycle-analysis.test.js +124 -0
  14. package/dist/backend/cycle-analysis.test.js.map +1 -0
  15. package/dist/backend/executable-features.d.ts +4 -0
  16. package/dist/backend/executable-features.js +42 -0
  17. package/dist/backend/executable-features.js.map +1 -0
  18. package/dist/backend/external-c.d.ts +5 -27
  19. package/dist/backend/external-c.js +5 -40
  20. package/dist/backend/external-c.js.map +1 -1
  21. package/dist/backend/ffi-callbacks.d.ts +2 -3
  22. package/dist/backend/ffi-callbacks.js +2 -3
  23. package/dist/backend/ffi-callbacks.js.map +1 -1
  24. package/dist/backend/library-identity-markers.d.ts +4 -9
  25. package/dist/backend/library-identity-markers.js +11 -49
  26. package/dist/backend/library-identity-markers.js.map +1 -1
  27. package/dist/backend/library-pack.d.ts +5 -0
  28. package/dist/backend/library-pack.js +123 -0
  29. package/dist/backend/library-pack.js.map +1 -0
  30. package/dist/backend/link-plan-core.d.ts +20 -0
  31. package/dist/backend/link-plan-core.js +18 -0
  32. package/dist/backend/link-plan-core.js.map +1 -0
  33. package/dist/backend/link-plan.d.ts +1 -1
  34. package/dist/backend/link-plan.js +16 -17
  35. package/dist/backend/link-plan.js.map +1 -1
  36. package/dist/backend/link-trace.d.ts +2 -0
  37. package/dist/backend/link-trace.js +24 -0
  38. package/dist/backend/link-trace.js.map +1 -0
  39. package/dist/backend/linker.js +1 -1
  40. package/dist/backend/linker.js.map +1 -1
  41. package/dist/backend/literals.d.ts +9 -0
  42. package/dist/backend/literals.js +35 -0
  43. package/dist/backend/literals.js.map +1 -0
  44. package/dist/backend/literals.test.d.ts +1 -0
  45. package/dist/backend/literals.test.js +53 -0
  46. package/dist/backend/literals.test.js.map +1 -0
  47. package/dist/backend/llvm/blocks.d.ts +2 -0
  48. package/dist/backend/llvm/blocks.js +9 -4
  49. package/dist/backend/llvm/blocks.js.map +1 -1
  50. package/dist/backend/llvm/blocks.test.d.ts +1 -0
  51. package/dist/backend/llvm/blocks.test.js +91 -0
  52. package/dist/backend/llvm/blocks.test.js.map +1 -0
  53. package/dist/backend/llvm/classes.d.ts +14 -8
  54. package/dist/backend/llvm/classes.js +70 -28
  55. package/dist/backend/llvm/classes.js.map +1 -1
  56. package/dist/backend/llvm/common.d.ts +5 -1
  57. package/dist/backend/llvm/common.js +45 -4
  58. package/dist/backend/llvm/common.js.map +1 -1
  59. package/dist/backend/llvm/debug-info.js +2 -7
  60. package/dist/backend/llvm/debug-info.js.map +1 -1
  61. package/dist/backend/llvm/debug-info.test.d.ts +1 -0
  62. package/dist/backend/llvm/debug-info.test.js +110 -0
  63. package/dist/backend/llvm/debug-info.test.js.map +1 -0
  64. package/dist/backend/llvm/dyn.d.ts +16 -2
  65. package/dist/backend/llvm/dyn.js +494 -165
  66. package/dist/backend/llvm/dyn.js.map +1 -1
  67. package/dist/backend/llvm/emitter.d.ts +596 -1
  68. package/dist/backend/llvm/emitter.js +695 -410
  69. package/dist/backend/llvm/emitter.js.map +1 -1
  70. package/dist/backend/llvm/emitter.test.d.ts +1 -0
  71. package/dist/backend/llvm/emitter.test.js +179 -0
  72. package/dist/backend/llvm/emitter.test.js.map +1 -0
  73. package/dist/backend/llvm/expr-async.js +23 -14
  74. package/dist/backend/llvm/expr-async.js.map +1 -1
  75. package/dist/backend/llvm/expr-bytes.d.ts +1 -1
  76. package/dist/backend/llvm/expr-bytes.js +32 -14
  77. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  78. package/dist/backend/llvm/expr-callbacks.d.ts +1 -1
  79. package/dist/backend/llvm/expr-callbacks.js +25 -22
  80. package/dist/backend/llvm/expr-callbacks.js.map +1 -1
  81. package/dist/backend/llvm/expr-calls.js +136 -35
  82. package/dist/backend/llvm/expr-calls.js.map +1 -1
  83. package/dist/backend/llvm/expr-containers.d.ts +1 -1
  84. package/dist/backend/llvm/expr-containers.js +43 -14
  85. package/dist/backend/llvm/expr-containers.js.map +1 -1
  86. package/dist/backend/llvm/expr-context.d.ts +5 -260
  87. package/dist/backend/llvm/expr-control.js +9 -5
  88. package/dist/backend/llvm/expr-control.js.map +1 -1
  89. package/dist/backend/llvm/expr-dispatch.d.ts +1 -1
  90. package/dist/backend/llvm/expr-dispatch.js +2 -0
  91. package/dist/backend/llvm/expr-dispatch.js.map +1 -1
  92. package/dist/backend/llvm/expr-dynamic.js +62 -74
  93. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  94. package/dist/backend/llvm/expr-island.d.ts +1 -1
  95. package/dist/backend/llvm/expr-island.js +11 -7
  96. package/dist/backend/llvm/expr-island.js.map +1 -1
  97. package/dist/backend/llvm/expr-primitives.d.ts +1 -1
  98. package/dist/backend/llvm/expr-primitives.js +51 -30
  99. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  100. package/dist/backend/llvm/expr-primitives.test.js +1 -1
  101. package/dist/backend/llvm/expr-records.d.ts +5 -1
  102. package/dist/backend/llvm/expr-records.js +43 -4
  103. package/dist/backend/llvm/expr-records.js.map +1 -1
  104. package/dist/backend/llvm/expr-stream-bridges.d.ts +4 -4
  105. package/dist/backend/llvm/expr-stream-bridges.js +102 -121
  106. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  107. package/dist/backend/llvm/expr-stream-bridges.test.d.ts +1 -0
  108. package/dist/backend/llvm/expr-stream-bridges.test.js +55 -0
  109. package/dist/backend/llvm/expr-stream-bridges.test.js.map +1 -0
  110. package/dist/backend/llvm/expr-stream-callbacks.d.ts +1 -1
  111. package/dist/backend/llvm/expr-stream-callbacks.js +12 -12
  112. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
  113. package/dist/backend/llvm/layouts.d.ts +19 -0
  114. package/dist/backend/llvm/layouts.js +12 -0
  115. package/dist/backend/llvm/layouts.js.map +1 -0
  116. package/dist/backend/llvm/lib-abi.d.ts +19 -0
  117. package/dist/backend/llvm/lib-abi.js +82 -0
  118. package/dist/backend/llvm/lib-abi.js.map +1 -0
  119. package/dist/backend/llvm/lib-connect.d.ts +2 -0
  120. package/dist/backend/llvm/lib-connect.js +51 -0
  121. package/dist/backend/llvm/lib-connect.js.map +1 -0
  122. package/dist/backend/llvm/lib-datagram.d.ts +2 -0
  123. package/dist/backend/llvm/lib-datagram.js +135 -0
  124. package/dist/backend/llvm/lib-datagram.js.map +1 -0
  125. package/dist/backend/llvm/lib-dispatch.js +50 -6
  126. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  127. package/dist/backend/llvm/lib-filesystem.js +30 -18
  128. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  129. package/dist/backend/llvm/lib-http2.d.ts +2 -0
  130. package/dist/backend/llvm/lib-http2.js +215 -0
  131. package/dist/backend/llvm/lib-http2.js.map +1 -0
  132. package/dist/backend/llvm/lib-lookup.d.ts +2 -0
  133. package/dist/backend/llvm/lib-lookup.js +39 -0
  134. package/dist/backend/llvm/lib-lookup.js.map +1 -0
  135. package/dist/backend/llvm/lib-network.js +25 -2
  136. package/dist/backend/llvm/lib-network.js.map +1 -1
  137. package/dist/backend/llvm/lib-process.js +21 -16
  138. package/dist/backend/llvm/lib-process.js.map +1 -1
  139. package/dist/backend/llvm/lib-shared.js +117 -1
  140. package/dist/backend/llvm/lib-shared.js.map +1 -1
  141. package/dist/backend/llvm/lib-stream.js +3 -2
  142. package/dist/backend/llvm/lib-stream.js.map +1 -1
  143. package/dist/backend/llvm/lib-test.d.ts +2 -0
  144. package/dist/backend/llvm/lib-test.js +34 -0
  145. package/dist/backend/llvm/lib-test.js.map +1 -0
  146. package/dist/backend/llvm/lib-tls.d.ts +2 -0
  147. package/dist/backend/llvm/lib-tls.js +82 -0
  148. package/dist/backend/llvm/lib-tls.js.map +1 -0
  149. package/dist/backend/llvm/shapes.d.ts +10 -9
  150. package/dist/backend/llvm/shapes.js +35 -130
  151. package/dist/backend/llvm/shapes.js.map +1 -1
  152. package/dist/backend/llvm/unsupported.d.ts +1 -0
  153. package/dist/backend/llvm/unsupported.js +1 -2
  154. package/dist/backend/llvm/unsupported.js.map +1 -1
  155. package/dist/backend/llvm/walkers.js +1 -7
  156. package/dist/backend/llvm/walkers.js.map +1 -1
  157. package/dist/backend/mangle.d.ts +2 -2
  158. package/dist/backend/mangle.js +16 -5
  159. package/dist/backend/mangle.js.map +1 -1
  160. package/dist/backend/{c/may-throw.d.ts → may-throw.d.ts} +1 -1
  161. package/dist/backend/{c/may-throw.js → may-throw.js} +51 -46
  162. package/dist/backend/may-throw.js.map +1 -0
  163. package/dist/backend/may-throw.test.d.ts +1 -0
  164. package/dist/backend/may-throw.test.js +58 -0
  165. package/dist/backend/may-throw.test.js.map +1 -0
  166. package/dist/backend/native-codegen-core.d.ts +22 -0
  167. package/dist/backend/native-codegen-core.js +44 -0
  168. package/dist/backend/native-codegen-core.js.map +1 -0
  169. package/dist/backend/native-codegen.d.ts +3 -19
  170. package/dist/backend/native-codegen.js +5 -44
  171. package/dist/backend/native-codegen.js.map +1 -1
  172. package/dist/backend/native-codegen.test.js +2 -2
  173. package/dist/backend/native-codegen.test.js.map +1 -1
  174. package/dist/backend/native-link-info-core.d.ts +94 -0
  175. package/dist/backend/native-link-info-core.js +62 -0
  176. package/dist/backend/native-link-info-core.js.map +1 -0
  177. package/dist/backend/native-link-info.d.ts +3 -88
  178. package/dist/backend/native-link-info.js +12 -243
  179. package/dist/backend/native-link-info.js.map +1 -1
  180. package/dist/backend/native-link-info.test.js +41 -146
  181. package/dist/backend/native-link-info.test.js.map +1 -1
  182. package/dist/backend/native-toolchain.d.ts +10 -25
  183. package/dist/backend/native-toolchain.js +31 -211
  184. package/dist/backend/native-toolchain.js.map +1 -1
  185. package/dist/backend/native-toolchain.test.js +5 -5
  186. package/dist/backend/native-toolchain.test.js.map +1 -1
  187. package/dist/backend/native-tools.d.ts +24 -0
  188. package/dist/backend/native-tools.js +33 -0
  189. package/dist/backend/native-tools.js.map +1 -0
  190. package/dist/backend/object-localize.js +19 -8
  191. package/dist/backend/object-localize.js.map +1 -1
  192. package/dist/backend/object-localize.test.js +22 -0
  193. package/dist/backend/object-localize.test.js.map +1 -1
  194. package/dist/backend/runtime-abi.d.ts +2 -2
  195. package/dist/backend/runtime-abi.js +2 -2
  196. package/dist/backend/runtime-pack-core.d.ts +101 -0
  197. package/dist/backend/runtime-pack-core.js +172 -0
  198. package/dist/backend/runtime-pack-core.js.map +1 -0
  199. package/dist/backend/runtime-pack-native.d.ts +21 -0
  200. package/dist/backend/runtime-pack-native.js +70 -0
  201. package/dist/backend/runtime-pack-native.js.map +1 -0
  202. package/dist/backend/runtime-pack-targets.test.js +1 -1
  203. package/dist/backend/runtime-pack.d.ts +3 -83
  204. package/dist/backend/runtime-pack.js +8 -151
  205. package/dist/backend/runtime-pack.js.map +1 -1
  206. package/dist/backend/runtime-pack.test.js +24 -1
  207. package/dist/backend/runtime-pack.test.js.map +1 -1
  208. package/dist/backend/target-diagnostics.d.ts +22 -0
  209. package/dist/backend/target-diagnostics.js +108 -0
  210. package/dist/backend/target-diagnostics.js.map +1 -0
  211. package/dist/backend/target-platform.d.ts +15 -0
  212. package/dist/backend/target-platform.js +72 -0
  213. package/dist/backend/target-platform.js.map +1 -0
  214. package/dist/backend/targets.d.ts +13 -4
  215. package/dist/backend/targets.js +95 -30
  216. package/dist/backend/targets.js.map +1 -1
  217. package/dist/backend/targets.test.js +65 -4
  218. package/dist/backend/targets.test.js.map +1 -1
  219. package/dist/backend/toolchain-environment.d.ts +6 -0
  220. package/dist/backend/toolchain-environment.js +99 -0
  221. package/dist/backend/toolchain-environment.js.map +1 -0
  222. package/dist/backend/vendor-archives.d.ts +1 -9
  223. package/dist/backend/vendor-archives.js +2 -9
  224. package/dist/backend/vendor-archives.js.map +1 -1
  225. package/dist/backend/vendor-inputs.d.ts +9 -0
  226. package/dist/backend/vendor-inputs.js +10 -0
  227. package/dist/backend/vendor-inputs.js.map +1 -0
  228. package/dist/backend/warm-cache.d.ts +3 -0
  229. package/dist/backend/warm-cache.js +41 -0
  230. package/dist/backend/warm-cache.js.map +1 -0
  231. package/dist/cli/command.d.ts +3 -0
  232. package/dist/cli/command.js +328 -0
  233. package/dist/cli/command.js.map +1 -0
  234. package/dist/cli/host.d.ts +24 -0
  235. package/dist/cli/host.js +2 -0
  236. package/dist/cli/host.js.map +1 -0
  237. package/dist/cli/output-options.d.ts +26 -0
  238. package/dist/cli/output-options.js +60 -0
  239. package/dist/cli/output-options.js.map +1 -0
  240. package/dist/cli/paths.d.ts +12 -0
  241. package/dist/cli/paths.js +42 -0
  242. package/dist/cli/paths.js.map +1 -0
  243. package/dist/cli/usage.d.ts +74 -0
  244. package/dist/cli/usage.js +86 -0
  245. package/dist/cli/usage.js.map +1 -0
  246. package/dist/cli/wasi-paths.d.ts +8 -0
  247. package/dist/cli/wasi-paths.js +41 -0
  248. package/dist/cli/wasi-paths.js.map +1 -0
  249. package/dist/cli/wasi-runner.d.ts +2 -0
  250. package/dist/cli/wasi-runner.js +28 -0
  251. package/dist/cli/wasi-runner.js.map +1 -0
  252. package/dist/compat/fetch-profile.js +3 -3
  253. package/dist/compat/fetch-profile.js.map +1 -1
  254. package/dist/compile-types.d.ts +162 -0
  255. package/dist/compile-types.js +2 -0
  256. package/dist/compile-types.js.map +1 -0
  257. package/dist/coverage/report.js +11 -5
  258. package/dist/coverage/report.js.map +1 -1
  259. package/dist/coverage/surface-manifest.js +5 -2
  260. package/dist/coverage/surface-manifest.js.map +1 -1
  261. package/dist/diagnostics/diagnostic.js +3 -3
  262. package/dist/diagnostics/diagnostic.js.map +1 -1
  263. package/dist/executable/executable-cache.d.ts +3 -4
  264. package/dist/executable/executable-cache.js +5 -6
  265. package/dist/executable/executable-cache.js.map +1 -1
  266. package/dist/executable/executable-cache.test.js +16 -17
  267. package/dist/executable/executable-cache.test.js.map +1 -1
  268. package/dist/executable/prepare.d.ts +14 -0
  269. package/dist/executable/prepare.js +66 -0
  270. package/dist/executable/prepare.js.map +1 -0
  271. package/dist/ffi/ffi-manifest.d.ts +11 -4
  272. package/dist/ffi/ffi-manifest.js +170 -58
  273. package/dist/ffi/ffi-manifest.js.map +1 -1
  274. package/dist/ffi/ffi-manifest.test.d.ts +1 -0
  275. package/dist/ffi/ffi-manifest.test.js +111 -0
  276. package/dist/ffi/ffi-manifest.test.js.map +1 -0
  277. package/dist/format-integer.d.ts +3 -0
  278. package/dist/format-integer.js +14 -0
  279. package/dist/format-integer.js.map +1 -0
  280. package/dist/frontend/analysis.d.ts +5 -0
  281. package/dist/frontend/analysis.js +88 -0
  282. package/dist/frontend/analysis.js.map +1 -0
  283. package/dist/frontend/arguments-usage.d.ts +1 -3
  284. package/dist/frontend/arguments-usage.js.map +1 -1
  285. package/dist/frontend/builtin-modules.d.ts +1 -1
  286. package/dist/frontend/builtin-modules.js +1 -1
  287. package/dist/frontend/builtin-modules.js.map +1 -1
  288. package/dist/frontend/cjs-lexer.d.ts +4 -25
  289. package/dist/frontend/cjs-lexer.js +6 -806
  290. package/dist/frontend/cjs-lexer.js.map +1 -1
  291. package/dist/frontend/cjs-resolve.d.ts +5 -0
  292. package/dist/frontend/cjs-resolve.js +429 -0
  293. package/dist/frontend/cjs-resolve.js.map +1 -0
  294. package/dist/frontend/cjs-syntax.d.ts +26 -0
  295. package/dist/frontend/cjs-syntax.js +806 -0
  296. package/dist/frontend/cjs-syntax.js.map +1 -0
  297. package/dist/frontend/comptime-node.d.ts +4 -0
  298. package/dist/frontend/comptime-node.js +16 -0
  299. package/dist/frontend/comptime-node.js.map +1 -0
  300. package/dist/frontend/comptime-node.test.d.ts +1 -0
  301. package/dist/frontend/comptime-node.test.js +37 -0
  302. package/dist/frontend/comptime-node.test.js.map +1 -0
  303. package/dist/frontend/dts-paths.d.ts +3 -4
  304. package/dist/frontend/dts-paths.js +15 -8
  305. package/dist/frontend/dts-paths.js.map +1 -1
  306. package/dist/frontend/fork-target.js +2 -2
  307. package/dist/frontend/fork-target.js.map +1 -1
  308. package/dist/frontend/helper-tokens.d.ts +1 -0
  309. package/dist/frontend/helper-tokens.js +147 -0
  310. package/dist/frontend/helper-tokens.js.map +1 -0
  311. package/dist/frontend/helper-tokens.test.d.ts +1 -0
  312. package/dist/frontend/helper-tokens.test.js +35 -0
  313. package/dist/frontend/helper-tokens.test.js.map +1 -0
  314. package/dist/frontend/inferred-js-diagnostics.d.ts +5 -0
  315. package/dist/frontend/inferred-js-diagnostics.js +69 -0
  316. package/dist/frontend/inferred-js-diagnostics.js.map +1 -0
  317. package/dist/frontend/inferred-js-diagnostics.test.d.ts +1 -0
  318. package/dist/frontend/inferred-js-diagnostics.test.js +58 -0
  319. package/dist/frontend/inferred-js-diagnostics.test.js.map +1 -0
  320. package/dist/frontend/input-tracker.d.ts +5 -2
  321. package/dist/frontend/input-tracker.js +24 -3
  322. package/dist/frontend/input-tracker.js.map +1 -1
  323. package/dist/frontend/input-tracker.test.js +23 -0
  324. package/dist/frontend/input-tracker.test.js.map +1 -1
  325. package/dist/frontend/lib-contract.js +32 -24
  326. package/dist/frontend/lib-contract.js.map +1 -1
  327. package/dist/frontend/literal-values.d.ts +4 -0
  328. package/dist/frontend/literal-values.js +21 -0
  329. package/dist/frontend/literal-values.js.map +1 -0
  330. package/dist/frontend/literal-values.test.d.ts +1 -0
  331. package/dist/frontend/literal-values.test.js +91 -0
  332. package/dist/frontend/literal-values.test.js.map +1 -0
  333. package/dist/frontend/lowering/abstract-equality.d.ts +1 -1
  334. package/dist/frontend/lowering/abstract-equality.js +3 -0
  335. package/dist/frontend/lowering/abstract-equality.js.map +1 -1
  336. package/dist/frontend/lowering/array-indexed-mutation.js +11 -6
  337. package/dist/frontend/lowering/array-indexed-mutation.js.map +1 -1
  338. package/dist/frontend/lowering/array-values.d.ts +4 -1
  339. package/dist/frontend/lowering/array-values.js +43 -1
  340. package/dist/frontend/lowering/array-values.js.map +1 -1
  341. package/dist/frontend/lowering/callback-arg.js +1 -0
  342. package/dist/frontend/lowering/callback-arg.js.map +1 -1
  343. package/dist/frontend/lowering/class-callbacks.d.ts +12 -0
  344. package/dist/frontend/lowering/class-callbacks.js +63 -0
  345. package/dist/frontend/lowering/class-callbacks.js.map +1 -0
  346. package/dist/frontend/lowering/class-descriptors.d.ts +9 -0
  347. package/dist/frontend/lowering/class-descriptors.js +73 -0
  348. package/dist/frontend/lowering/class-descriptors.js.map +1 -0
  349. package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +41 -0
  350. package/dist/frontend/lowering/class-dynamic-dispatch.js +803 -0
  351. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -0
  352. package/dist/frontend/lowering/class-dynamic-dispatch.test.d.ts +1 -0
  353. package/dist/frontend/lowering/class-dynamic-dispatch.test.js +92 -0
  354. package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -0
  355. package/dist/frontend/lowering/class-instance-constructor.d.ts +7 -0
  356. package/dist/frontend/lowering/class-instance-constructor.js +64 -0
  357. package/dist/frontend/lowering/class-instance-constructor.js.map +1 -0
  358. package/dist/frontend/lowering/class-method-values.d.ts +10 -0
  359. package/dist/frontend/lowering/class-method-values.js +170 -0
  360. package/dist/frontend/lowering/class-method-values.js.map +1 -0
  361. package/dist/frontend/lowering/class-prototypes.d.ts +16 -0
  362. package/dist/frontend/lowering/class-prototypes.js +134 -0
  363. package/dist/frontend/lowering/class-prototypes.js.map +1 -0
  364. package/dist/frontend/lowering/class-static-data.d.ts +6 -0
  365. package/dist/frontend/lowering/class-static-data.js +56 -0
  366. package/dist/frontend/lowering/class-static-data.js.map +1 -0
  367. package/dist/frontend/lowering/containers/buffer-numeric-methods.d.ts +4 -0
  368. package/dist/frontend/lowering/containers/buffer-numeric-methods.js +26 -0
  369. package/dist/frontend/lowering/containers/buffer-numeric-methods.js.map +1 -0
  370. package/dist/frontend/lowering/containers/bytes.d.ts +11 -7
  371. package/dist/frontend/lowering/containers/bytes.js +164 -155
  372. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  373. package/dist/frontend/lowering/containers/string-and-regexp.d.ts +2 -2
  374. package/dist/frontend/lowering/containers/string-and-regexp.js +39 -16
  375. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  376. package/dist/frontend/lowering/containers/string-replacement.d.ts +7 -0
  377. package/dist/frontend/lowering/containers/string-replacement.js +217 -0
  378. package/dist/frontend/lowering/containers/string-replacement.js.map +1 -0
  379. package/dist/frontend/lowering/error-methods.d.ts +11 -0
  380. package/dist/frontend/lowering/error-methods.js +78 -0
  381. package/dist/frontend/lowering/error-methods.js.map +1 -0
  382. package/dist/frontend/lowering/expressions/global-symbols.d.ts +6 -0
  383. package/dist/frontend/lowering/expressions/global-symbols.js +11 -0
  384. package/dist/frontend/lowering/expressions/global-symbols.js.map +1 -0
  385. package/dist/frontend/lowering/expressions/native-proxy.d.ts +7 -0
  386. package/dist/frontend/lowering/expressions/native-proxy.js +49 -0
  387. package/dist/frontend/lowering/expressions/native-proxy.js.map +1 -0
  388. package/dist/frontend/lowering/expressions/nullish-assignment.d.ts +6 -0
  389. package/dist/frontend/lowering/expressions/nullish-assignment.js +124 -0
  390. package/dist/frontend/lowering/expressions/nullish-assignment.js.map +1 -0
  391. package/dist/frontend/lowering/expressions/object-literals.d.ts +8 -8
  392. package/dist/frontend/lowering/expressions/object-literals.js +473 -178
  393. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  394. package/dist/frontend/lowering/expressions/optional-chains.js +20 -8
  395. package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
  396. package/dist/frontend/lowering/expressions/try-lower-expression.js +1 -0
  397. package/dist/frontend/lowering/expressions/try-lower-expression.js.map +1 -1
  398. package/dist/frontend/lowering/expressions/union-field-write.d.ts +8 -0
  399. package/dist/frontend/lowering/expressions/union-field-write.js +71 -0
  400. package/dist/frontend/lowering/expressions/union-field-write.js.map +1 -0
  401. package/dist/frontend/lowering/function-context.d.ts +93 -0
  402. package/dist/frontend/lowering/function-context.js +103 -0
  403. package/dist/frontend/lowering/function-context.js.map +1 -0
  404. package/dist/frontend/lowering/generator-delegation.d.ts +7 -0
  405. package/dist/frontend/lowering/generator-delegation.js +85 -0
  406. package/dist/frontend/lowering/generator-delegation.js.map +1 -0
  407. package/dist/frontend/lowering/generator-dynamic-dispatch.d.ts +10 -0
  408. package/dist/frontend/lowering/generator-dynamic-dispatch.js +105 -0
  409. package/dist/frontend/lowering/generator-dynamic-dispatch.js.map +1 -0
  410. package/dist/frontend/lowering/lib-boundary.d.ts +2 -1
  411. package/dist/frontend/lowering/lib-boundary.js +59 -20
  412. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  413. package/dist/frontend/lowering/lib-boundary.test.d.ts +1 -0
  414. package/dist/frontend/lowering/lib-boundary.test.js +45 -0
  415. package/dist/frontend/lowering/lib-boundary.test.js.map +1 -0
  416. package/dist/frontend/lowering/lower-array-sort.d.ts +1 -1
  417. package/dist/frontend/lowering/lower-assert.d.ts +1 -1
  418. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  419. package/dist/frontend/lowering/lower-async-iteration.d.ts +1 -1
  420. package/dist/frontend/lowering/lower-async-iteration.js.map +1 -1
  421. package/dist/frontend/lowering/lower-builtin-values.d.ts +12 -0
  422. package/dist/frontend/lowering/lower-builtin-values.js +139 -0
  423. package/dist/frontend/lowering/lower-builtin-values.js.map +1 -0
  424. package/dist/frontend/lowering/lower-builtins.d.ts +27 -41
  425. package/dist/frontend/lowering/lower-builtins.js +539 -343
  426. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  427. package/dist/frontend/lowering/lower-calls.d.ts +20 -17
  428. package/dist/frontend/lowering/lower-calls.js +1236 -353
  429. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  430. package/dist/frontend/lowering/lower-classes.d.ts +83 -45
  431. package/dist/frontend/lowering/lower-classes.js +952 -339
  432. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  433. package/dist/frontend/lowering/lower-comptime.d.ts +1 -1
  434. package/dist/frontend/lowering/lower-comptime.js +23 -32
  435. package/dist/frontend/lowering/lower-comptime.js.map +1 -1
  436. package/dist/frontend/lowering/lower-containers.d.ts +27 -32
  437. package/dist/frontend/lowering/lower-containers.js +796 -151
  438. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  439. package/dist/frontend/lowering/lower-dgram.d.ts +1 -1
  440. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  441. package/dist/frontend/lowering/lower-enums.d.ts +1 -1
  442. package/dist/frontend/lowering/lower-enums.js.map +1 -1
  443. package/dist/frontend/lowering/lower-event-emitter.d.ts +30 -1
  444. package/dist/frontend/lowering/lower-event-emitter.js +58 -26
  445. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
  446. package/dist/frontend/lowering/lower-expando.d.ts +7 -1
  447. package/dist/frontend/lowering/lower-expando.js +14 -6
  448. package/dist/frontend/lowering/lower-expando.js.map +1 -1
  449. package/dist/frontend/lowering/lower-exprs.d.ts +35 -11
  450. package/dist/frontend/lowering/lower-exprs.js +1674 -779
  451. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  452. package/dist/frontend/lowering/lower-generators.d.ts +2 -5
  453. package/dist/frontend/lowering/lower-generators.js +77 -46
  454. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  455. package/dist/frontend/lowering/lower-global-value.d.ts +7 -0
  456. package/dist/frontend/lowering/lower-global-value.js +17 -0
  457. package/dist/frontend/lowering/lower-global-value.js.map +1 -0
  458. package/dist/frontend/lowering/lower-inspect.d.ts +1 -1
  459. package/dist/frontend/lowering/lower-inspect.js +17 -8
  460. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  461. package/dist/frontend/lowering/lower-island.d.ts +5 -8
  462. package/dist/frontend/lowering/lower-island.js +34 -23
  463. package/dist/frontend/lowering/lower-island.js.map +1 -1
  464. package/dist/frontend/lowering/lower-mixins.d.ts +2 -2
  465. package/dist/frontend/lowering/lower-mixins.js +5 -3
  466. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  467. package/dist/frontend/lowering/lower-modules.d.ts +1 -1
  468. package/dist/frontend/lowering/lower-modules.js +233 -30
  469. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  470. package/dist/frontend/lowering/lower-namespaces.d.ts +1 -1
  471. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  472. package/dist/frontend/lowering/lower-node-module.d.ts +1 -1
  473. package/dist/frontend/lowering/lower-node-module.js +13 -10
  474. package/dist/frontend/lowering/lower-node-module.js.map +1 -1
  475. package/dist/frontend/lowering/lower-server.d.ts +1 -1
  476. package/dist/frontend/lowering/lower-server.js +6 -10
  477. package/dist/frontend/lowering/lower-server.js.map +1 -1
  478. package/dist/frontend/lowering/lower-stmts.d.ts +10 -14
  479. package/dist/frontend/lowering/lower-stmts.js +728 -496
  480. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  481. package/dist/frontend/lowering/lower-stream.d.ts +1 -1
  482. package/dist/frontend/lowering/lower-stream.js +19 -10
  483. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  484. package/dist/frontend/lowering/lower-test.d.ts +1 -1
  485. package/dist/frontend/lowering/lower-test.js.map +1 -1
  486. package/dist/frontend/lowering/lower-url.d.ts +6 -0
  487. package/dist/frontend/lowering/lower-url.js +77 -0
  488. package/dist/frontend/lowering/lower-url.js.map +1 -0
  489. package/dist/frontend/lowering/lowerer.d.ts +113 -189
  490. package/dist/frontend/lowering/lowerer.js +1031 -672
  491. package/dist/frontend/lowering/lowerer.js.map +1 -1
  492. package/dist/frontend/lowering/lowerer.test.d.ts +1 -0
  493. package/dist/frontend/lowering/lowerer.test.js +26 -0
  494. package/dist/frontend/lowering/lowerer.test.js.map +1 -0
  495. package/dist/frontend/lowering/native-ffi.d.ts +5 -0
  496. package/dist/frontend/lowering/native-ffi.js +40 -0
  497. package/dist/frontend/lowering/native-ffi.js.map +1 -0
  498. package/dist/frontend/lowering/object-enumeration-receiver.d.ts +7 -0
  499. package/dist/frontend/lowering/object-enumeration-receiver.js +33 -0
  500. package/dist/frontend/lowering/object-enumeration-receiver.js.map +1 -0
  501. package/dist/frontend/lowering/object-factory-new.d.ts +8 -0
  502. package/dist/frontend/lowering/object-factory-new.js +68 -0
  503. package/dist/frontend/lowering/object-factory-new.js.map +1 -0
  504. package/dist/frontend/lowering/optional-arguments.js +6 -1
  505. package/dist/frontend/lowering/optional-arguments.js.map +1 -1
  506. package/dist/frontend/lowering/pairs-snapshot.js +2 -1
  507. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -1
  508. package/dist/frontend/lowering/runtime-optional-locals.d.ts +14 -0
  509. package/dist/frontend/lowering/runtime-optional-locals.js +41 -0
  510. package/dist/frontend/lowering/runtime-optional-locals.js.map +1 -0
  511. package/dist/frontend/lowering/runtime-optional-locals.test.d.ts +1 -0
  512. package/dist/frontend/lowering/runtime-optional-locals.test.js +85 -0
  513. package/dist/frontend/lowering/runtime-optional-locals.test.js.map +1 -0
  514. package/dist/frontend/lowering/sanitize-class-types.d.ts +8 -0
  515. package/dist/frontend/lowering/sanitize-class-types.js +79 -0
  516. package/dist/frontend/lowering/sanitize-class-types.js.map +1 -0
  517. package/dist/frontend/lowering/sanitize-class-types.test.d.ts +1 -0
  518. package/dist/frontend/lowering/sanitize-class-types.test.js +60 -0
  519. package/dist/frontend/lowering/sanitize-class-types.test.js.map +1 -0
  520. package/dist/frontend/lowering/static-this.d.ts +5 -1
  521. package/dist/frontend/lowering/static-this.js +28 -2
  522. package/dist/frontend/lowering/static-this.js.map +1 -1
  523. package/dist/frontend/lowering/string-index.d.ts +7 -0
  524. package/dist/frontend/lowering/string-index.js +39 -0
  525. package/dist/frontend/lowering/string-index.js.map +1 -0
  526. package/dist/frontend/lowering/surfaces.d.ts +8 -3
  527. package/dist/frontend/lowering/surfaces.js +61 -29
  528. package/dist/frontend/lowering/surfaces.js.map +1 -1
  529. package/dist/frontend/lowering/symbol-fields.d.ts +22 -0
  530. package/dist/frontend/lowering/symbol-fields.js +183 -0
  531. package/dist/frontend/lowering/symbol-fields.js.map +1 -0
  532. package/dist/frontend/lowering/symbol-methods.d.ts +7 -0
  533. package/dist/frontend/lowering/symbol-methods.js +30 -0
  534. package/dist/frontend/lowering/symbol-methods.js.map +1 -0
  535. package/dist/frontend/lowering/text-decoder-encoding.d.ts +10 -0
  536. package/dist/frontend/lowering/text-decoder-encoding.js +77 -0
  537. package/dist/frontend/lowering/text-decoder-encoding.js.map +1 -0
  538. package/dist/frontend/lowering/text-decoder-encoding.test.d.ts +1 -0
  539. package/dist/frontend/lowering/text-decoder-encoding.test.js +38 -0
  540. package/dist/frontend/lowering/text-decoder-encoding.test.js.map +1 -0
  541. package/dist/frontend/lowering/union-narrow.d.ts +9 -0
  542. package/dist/frontend/lowering/union-narrow.js +59 -0
  543. package/dist/frontend/lowering/union-narrow.js.map +1 -0
  544. package/dist/frontend/lowering/union-narrow.test.d.ts +1 -0
  545. package/dist/frontend/lowering/union-narrow.test.js +72 -0
  546. package/dist/frontend/lowering/union-narrow.test.js.map +1 -0
  547. package/dist/frontend/lowering/union-retag.d.ts +43 -0
  548. package/dist/frontend/lowering/union-retag.js +259 -0
  549. package/dist/frontend/lowering/union-retag.js.map +1 -0
  550. package/dist/frontend/lowering/union-retag.test.d.ts +1 -0
  551. package/dist/frontend/lowering/union-retag.test.js +405 -0
  552. package/dist/frontend/lowering/union-retag.test.js.map +1 -0
  553. package/dist/frontend/lowering/unregistered-class-types.d.ts +14 -0
  554. package/dist/frontend/lowering/unregistered-class-types.js +94 -0
  555. package/dist/frontend/lowering/unregistered-class-types.js.map +1 -0
  556. package/dist/frontend/lowering/unregistered-class-types.test.d.ts +1 -0
  557. package/dist/frontend/lowering/unregistered-class-types.test.js +65 -0
  558. package/dist/frontend/lowering/unregistered-class-types.test.js.map +1 -0
  559. package/dist/frontend/lowering/width-lift.d.ts +40 -0
  560. package/dist/frontend/lowering/width-lift.js +2 -0
  561. package/dist/frontend/lowering/width-lift.js.map +1 -0
  562. package/dist/frontend/module-syntax.d.ts +58 -0
  563. package/dist/frontend/module-syntax.js +123 -0
  564. package/dist/frontend/module-syntax.js.map +1 -0
  565. package/dist/frontend/module-syntax.test.d.ts +1 -0
  566. package/dist/frontend/module-syntax.test.js +78 -0
  567. package/dist/frontend/module-syntax.test.js.map +1 -0
  568. package/dist/frontend/npm-fetch-analysis.d.ts +17 -0
  569. package/dist/frontend/npm-fetch-analysis.js +100 -0
  570. package/dist/frontend/npm-fetch-analysis.js.map +1 -0
  571. package/dist/frontend/npm-fetch-analysis.test.d.ts +1 -0
  572. package/dist/frontend/npm-fetch-analysis.test.js +107 -0
  573. package/dist/frontend/npm-fetch-analysis.test.js.map +1 -0
  574. package/dist/frontend/npm-fetch-node.d.ts +2 -0
  575. package/dist/frontend/npm-fetch-node.js +12 -0
  576. package/dist/frontend/npm-fetch-node.js.map +1 -0
  577. package/dist/frontend/npm-fetch-syntax.d.ts +6 -0
  578. package/dist/frontend/npm-fetch-syntax.js +207 -0
  579. package/dist/frontend/npm-fetch-syntax.js.map +1 -0
  580. package/dist/frontend/npm-node.d.ts +10 -0
  581. package/dist/frontend/npm-node.js +14 -0
  582. package/dist/frontend/npm-node.js.map +1 -0
  583. package/dist/frontend/npm-static-bundled-cjs.d.ts +8 -0
  584. package/dist/frontend/npm-static-bundled-cjs.js +236 -0
  585. package/dist/frontend/npm-static-bundled-cjs.js.map +1 -0
  586. package/dist/frontend/npm-static-bundled-cjs.test.d.ts +1 -0
  587. package/dist/frontend/npm-static-bundled-cjs.test.js +69 -0
  588. package/dist/frontend/npm-static-bundled-cjs.test.js.map +1 -0
  589. package/dist/frontend/npm-static-declaration-syntax.d.ts +57 -0
  590. package/dist/frontend/npm-static-declaration-syntax.js +944 -0
  591. package/dist/frontend/npm-static-declaration-syntax.js.map +1 -0
  592. package/dist/frontend/npm-static-declarations.d.ts +11 -39
  593. package/dist/frontend/npm-static-declarations.js +22 -561
  594. package/dist/frontend/npm-static-declarations.js.map +1 -1
  595. package/dist/frontend/npm-static-declarations.test.js +245 -6
  596. package/dist/frontend/npm-static-declarations.test.js.map +1 -1
  597. package/dist/frontend/npm-static-prune.d.ts +1 -1
  598. package/dist/frontend/npm-static-prune.js +5 -4
  599. package/dist/frontend/npm-static-prune.js.map +1 -1
  600. package/dist/frontend/npm-static-prune.test.js +1 -1
  601. package/dist/frontend/npm-static-prune.test.js.map +1 -1
  602. package/dist/frontend/npm-static-rewrite-host.d.ts +4 -0
  603. package/dist/frontend/npm-static-rewrite-host.js +179 -0
  604. package/dist/frontend/npm-static-rewrite-host.js.map +1 -0
  605. package/dist/frontend/npm-static-rewrite-syntax.d.ts +16 -0
  606. package/dist/frontend/npm-static-rewrite-syntax.js +905 -0
  607. package/dist/frontend/npm-static-rewrite-syntax.js.map +1 -0
  608. package/dist/frontend/npm-static-rewrite.d.ts +0 -5
  609. package/dist/frontend/npm-static-rewrite.js +2 -1079
  610. package/dist/frontend/npm-static-rewrite.js.map +1 -1
  611. package/dist/frontend/npm-static-subtyping.d.ts +5 -0
  612. package/dist/frontend/npm-static-subtyping.js +55 -0
  613. package/dist/frontend/npm-static-subtyping.js.map +1 -0
  614. package/dist/frontend/npm-static-subtyping.test.d.ts +1 -0
  615. package/dist/frontend/npm-static-subtyping.test.js +58 -0
  616. package/dist/frontend/npm-static-subtyping.test.js.map +1 -0
  617. package/dist/frontend/npm-static.d.ts +7 -15
  618. package/dist/frontend/npm-static.js +19 -28
  619. package/dist/frontend/npm-static.js.map +1 -1
  620. package/dist/frontend/npm.d.ts +8 -69
  621. package/dist/frontend/npm.js +21 -361
  622. package/dist/frontend/npm.js.map +1 -1
  623. package/dist/frontend/npm.test.js +2 -2
  624. package/dist/frontend/npm.test.js.map +1 -1
  625. package/dist/frontend/pipeline-native.d.ts +6 -0
  626. package/dist/frontend/pipeline-native.js +32 -0
  627. package/dist/frontend/pipeline-native.js.map +1 -0
  628. package/dist/frontend/pipeline.d.ts +54 -0
  629. package/dist/frontend/pipeline.js +382 -0
  630. package/dist/frontend/pipeline.js.map +1 -0
  631. package/dist/frontend/pipeline.test.d.ts +1 -0
  632. package/dist/frontend/pipeline.test.js +77 -0
  633. package/dist/frontend/pipeline.test.js.map +1 -0
  634. package/dist/frontend/program-analysis.d.ts +10 -0
  635. package/dist/frontend/program-analysis.js +14 -0
  636. package/dist/frontend/program-analysis.js.map +1 -0
  637. package/dist/frontend/program-node.d.ts +9 -0
  638. package/dist/frontend/program-node.js +48 -0
  639. package/dist/frontend/program-node.js.map +1 -0
  640. package/dist/frontend/program.d.ts +38 -19
  641. package/dist/frontend/program.js +344 -169
  642. package/dist/frontend/program.js.map +1 -1
  643. package/dist/frontend/program.test.js +87 -2
  644. package/dist/frontend/program.test.js.map +1 -1
  645. package/dist/frontend/provenance-core.d.ts +9 -0
  646. package/dist/frontend/provenance-core.js +435 -0
  647. package/dist/frontend/provenance-core.js.map +1 -0
  648. package/dist/frontend/provenance.d.ts +0 -4
  649. package/dist/frontend/provenance.js +4 -459
  650. package/dist/frontend/provenance.js.map +1 -1
  651. package/dist/frontend/resolve.d.ts +3 -1
  652. package/dist/frontend/resolve.js +6 -3
  653. package/dist/frontend/resolve.js.map +1 -1
  654. package/dist/frontend/runtime-resolve.d.ts +4 -3
  655. package/dist/frontend/runtime-resolve.js +22 -18
  656. package/dist/frontend/runtime-resolve.js.map +1 -1
  657. package/dist/frontend/runtime-resolve.test.js +53 -0
  658. package/dist/frontend/runtime-resolve.test.js.map +1 -1
  659. package/dist/frontend/services-node.d.ts +5 -0
  660. package/dist/frontend/services-node.js +19 -0
  661. package/dist/frontend/services-node.js.map +1 -0
  662. package/dist/frontend/services-node.test.d.ts +1 -0
  663. package/dist/frontend/services-node.test.js +70 -0
  664. package/dist/frontend/services-node.test.js.map +1 -0
  665. package/dist/frontend/services.d.ts +44 -0
  666. package/dist/frontend/services.js +90 -0
  667. package/dist/frontend/services.js.map +1 -0
  668. package/dist/frontend/services.test.d.ts +1 -0
  669. package/dist/frontend/services.test.js +174 -0
  670. package/dist/frontend/services.test.js.map +1 -0
  671. package/dist/frontend/ts7/adapter.d.ts +3 -3
  672. package/dist/frontend/ts7/adapter.js +14 -31
  673. package/dist/frontend/ts7/adapter.js.map +1 -1
  674. package/dist/frontend/ts7/api.d.ts +16 -0
  675. package/dist/frontend/ts7/api.js +24 -0
  676. package/dist/frontend/ts7/api.js.map +1 -0
  677. package/dist/frontend/ts7/ast-bytes.d.ts +31 -0
  678. package/dist/frontend/ts7/ast-bytes.js +137 -0
  679. package/dist/frontend/ts7/ast-bytes.js.map +1 -0
  680. package/dist/frontend/ts7/ast-bytes.test.d.ts +1 -0
  681. package/dist/frontend/ts7/ast-bytes.test.js +73 -0
  682. package/dist/frontend/ts7/ast-bytes.test.js.map +1 -0
  683. package/dist/frontend/ts7/ast-guards.generated.d.ts +353 -0
  684. package/dist/frontend/ts7/ast-guards.generated.js +1951 -0
  685. package/dist/frontend/ts7/ast-guards.generated.js.map +1 -0
  686. package/dist/frontend/ts7/ast-guards.test.d.ts +1 -0
  687. package/dist/frontend/ts7/ast-guards.test.js +43 -0
  688. package/dist/frontend/ts7/ast-guards.test.js.map +1 -0
  689. package/dist/frontend/ts7/ast-node.d.ts +194 -0
  690. package/dist/frontend/ts7/ast-node.js +448 -0
  691. package/dist/frontend/ts7/ast-node.js.map +1 -0
  692. package/dist/frontend/ts7/ast-node.test.d.ts +1 -0
  693. package/dist/frontend/ts7/ast-node.test.js +266 -0
  694. package/dist/frontend/ts7/ast-node.test.js.map +1 -0
  695. package/dist/frontend/ts7/ast-schema.generated.d.ts +503 -0
  696. package/dist/frontend/ts7/ast-schema.generated.js +1446 -0
  697. package/dist/frontend/ts7/ast-schema.generated.js.map +1 -0
  698. package/dist/frontend/ts7/ast-text.d.ts +6 -0
  699. package/dist/frontend/ts7/ast-text.js +124 -0
  700. package/dist/frontend/ts7/ast-text.js.map +1 -0
  701. package/dist/frontend/ts7/ast-text.test.d.ts +1 -0
  702. package/dist/frontend/ts7/ast-text.test.js +38 -0
  703. package/dist/frontend/ts7/ast-text.test.js.map +1 -0
  704. package/dist/frontend/ts7/ast-tokens.generated.d.ts +2 -0
  705. package/dist/frontend/ts7/ast-tokens.generated.js +155 -0
  706. package/dist/frontend/ts7/ast-tokens.generated.js.map +1 -0
  707. package/dist/frontend/ts7/ast-types.d.ts +42 -0
  708. package/dist/frontend/ts7/ast-types.generated.d.ts +1615 -0
  709. package/dist/frontend/ts7/ast-types.generated.js +5 -0
  710. package/dist/frontend/ts7/ast-types.generated.js.map +1 -0
  711. package/dist/frontend/ts7/ast-types.js +3 -0
  712. package/dist/frontend/ts7/ast-types.js.map +1 -0
  713. package/dist/frontend/ts7/ast-wire.d.ts +58 -0
  714. package/dist/frontend/ts7/ast-wire.js +267 -0
  715. package/dist/frontend/ts7/ast-wire.js.map +1 -0
  716. package/dist/frontend/ts7/ast-wire.test.d.ts +1 -0
  717. package/dist/frontend/ts7/ast-wire.test.js +151 -0
  718. package/dist/frontend/ts7/ast-wire.test.js.map +1 -0
  719. package/dist/frontend/ts7/ast.d.ts +14 -14
  720. package/dist/frontend/ts7/ast.js +21 -15
  721. package/dist/frontend/ts7/ast.js.map +1 -1
  722. package/dist/frontend/ts7/census-check.js +1 -0
  723. package/dist/frontend/ts7/census-check.js.map +1 -1
  724. package/dist/frontend/ts7/checker-cache.d.ts +48 -0
  725. package/dist/frontend/ts7/checker-cache.js +92 -0
  726. package/dist/frontend/ts7/checker-cache.js.map +1 -0
  727. package/dist/frontend/ts7/checker.d.ts +19 -46
  728. package/dist/frontend/ts7/checker.js +231 -161
  729. package/dist/frontend/ts7/checker.js.map +1 -1
  730. package/dist/frontend/ts7/checker.test.d.ts +1 -0
  731. package/dist/frontend/ts7/checker.test.js +335 -0
  732. package/dist/frontend/ts7/checker.test.js.map +1 -0
  733. package/dist/frontend/ts7/enums.d.ts +4 -27
  734. package/dist/frontend/ts7/enums.generated.d.ts +878 -0
  735. package/dist/frontend/ts7/enums.generated.js +1313 -0
  736. package/dist/frontend/ts7/enums.generated.js.map +1 -0
  737. package/dist/frontend/ts7/enums.js +4 -45
  738. package/dist/frontend/ts7/enums.js.map +1 -1
  739. package/dist/frontend/ts7/enums.test.d.ts +1 -0
  740. package/dist/frontend/ts7/enums.test.js +48 -0
  741. package/dist/frontend/ts7/enums.test.js.map +1 -0
  742. package/dist/frontend/ts7/native-api.d.ts +10 -0
  743. package/dist/frontend/ts7/native-api.js +10 -0
  744. package/dist/frontend/ts7/native-api.js.map +1 -0
  745. package/dist/frontend/ts7/native-host.d.ts +2 -0
  746. package/dist/frontend/ts7/native-host.js +11 -0
  747. package/dist/frontend/ts7/native-host.js.map +1 -0
  748. package/dist/frontend/ts7/native-process.d.ts +14 -0
  749. package/dist/frontend/ts7/native-process.js +62 -0
  750. package/dist/frontend/ts7/native-process.js.map +1 -0
  751. package/dist/frontend/ts7/program-adapter.d.ts +10 -98
  752. package/dist/frontend/ts7/program-adapter.js +16 -310
  753. package/dist/frontend/ts7/program-adapter.js.map +1 -1
  754. package/dist/frontend/ts7/program-host.d.ts +115 -0
  755. package/dist/frontend/ts7/program-host.js +347 -0
  756. package/dist/frontend/ts7/program-host.js.map +1 -0
  757. package/dist/frontend/ts7/program-host.test.d.ts +1 -0
  758. package/dist/frontend/ts7/program-host.test.js +207 -0
  759. package/dist/frontend/ts7/program-host.test.js.map +1 -0
  760. package/dist/frontend/ts7/rpc-api.d.ts +12 -0
  761. package/dist/frontend/ts7/rpc-api.js +23 -0
  762. package/dist/frontend/ts7/rpc-api.js.map +1 -0
  763. package/dist/frontend/ts7/rpc-client.d.ts +27 -0
  764. package/dist/frontend/ts7/rpc-client.js +102 -0
  765. package/dist/frontend/ts7/rpc-client.js.map +1 -0
  766. package/dist/frontend/ts7/rpc-client.test.d.ts +1 -0
  767. package/dist/frontend/ts7/rpc-client.test.js +133 -0
  768. package/dist/frontend/ts7/rpc-client.test.js.map +1 -0
  769. package/dist/frontend/ts7/rpc-filesystem.d.ts +16 -0
  770. package/dist/frontend/ts7/rpc-filesystem.js +42 -0
  771. package/dist/frontend/ts7/rpc-filesystem.js.map +1 -0
  772. package/dist/frontend/ts7/rpc-filesystem.test.d.ts +1 -0
  773. package/dist/frontend/ts7/rpc-filesystem.test.js +89 -0
  774. package/dist/frontend/ts7/rpc-filesystem.test.js.map +1 -0
  775. package/dist/frontend/ts7/rpc-process.d.ts +2 -0
  776. package/dist/frontend/ts7/rpc-process.js +148 -0
  777. package/dist/frontend/ts7/rpc-process.js.map +1 -0
  778. package/dist/frontend/ts7/rpc-process.test.d.ts +1 -0
  779. package/dist/frontend/ts7/rpc-process.test.js +29 -0
  780. package/dist/frontend/ts7/rpc-process.test.js.map +1 -0
  781. package/dist/frontend/ts7/rpc-wire.d.ts +46 -0
  782. package/dist/frontend/ts7/rpc-wire.js +195 -0
  783. package/dist/frontend/ts7/rpc-wire.js.map +1 -0
  784. package/dist/frontend/ts7/rpc-wire.test.d.ts +1 -0
  785. package/dist/frontend/ts7/rpc-wire.test.js +168 -0
  786. package/dist/frontend/ts7/rpc-wire.test.js.map +1 -0
  787. package/dist/frontend/ts7/semantic-checker.d.ts +137 -0
  788. package/dist/frontend/ts7/semantic-checker.js +221 -0
  789. package/dist/frontend/ts7/semantic-checker.js.map +1 -0
  790. package/dist/frontend/ts7/semantic-checker.test.d.ts +1 -0
  791. package/dist/frontend/ts7/semantic-checker.test.js +119 -0
  792. package/dist/frontend/ts7/semantic-checker.test.js.map +1 -0
  793. package/dist/frontend/ts7/semantic-json.d.ts +5 -0
  794. package/dist/frontend/ts7/semantic-json.js +52 -0
  795. package/dist/frontend/ts7/semantic-json.js.map +1 -0
  796. package/dist/frontend/ts7/semantic-json.test.d.ts +1 -0
  797. package/dist/frontend/ts7/semantic-json.test.js +42 -0
  798. package/dist/frontend/ts7/semantic-json.test.js.map +1 -0
  799. package/dist/frontend/ts7/semantic-model.d.ts +222 -0
  800. package/dist/frontend/ts7/semantic-model.js +423 -0
  801. package/dist/frontend/ts7/semantic-model.js.map +1 -0
  802. package/dist/frontend/ts7/semantic-model.test.d.ts +1 -0
  803. package/dist/frontend/ts7/semantic-model.test.js +322 -0
  804. package/dist/frontend/ts7/semantic-model.test.js.map +1 -0
  805. package/dist/frontend/ts7/semantic-schema.generated.d.ts +283 -0
  806. package/dist/frontend/ts7/semantic-schema.generated.js +222 -0
  807. package/dist/frontend/ts7/semantic-schema.generated.js.map +1 -0
  808. package/dist/frontend/ts7/semantic-types.d.ts +5 -0
  809. package/dist/frontend/ts7/semantic-types.js +2 -0
  810. package/dist/frontend/ts7/semantic-types.js.map +1 -0
  811. package/dist/frontend/ts7/session-cache.d.ts +17 -0
  812. package/dist/frontend/ts7/session-cache.js +97 -0
  813. package/dist/frontend/ts7/session-cache.js.map +1 -0
  814. package/dist/frontend/ts7/session-cache.test.d.ts +1 -0
  815. package/dist/frontend/ts7/session-cache.test.js +87 -0
  816. package/dist/frontend/ts7/session-cache.test.js.map +1 -0
  817. package/dist/frontend/ts7/session-path.d.ts +18 -0
  818. package/dist/frontend/ts7/session-path.js +203 -0
  819. package/dist/frontend/ts7/session-path.js.map +1 -0
  820. package/dist/frontend/ts7/session-path.test.d.ts +1 -0
  821. package/dist/frontend/ts7/session-path.test.js +34 -0
  822. package/dist/frontend/ts7/session-path.test.js.map +1 -0
  823. package/dist/frontend/ts7/session-schema.generated.d.ts +167 -0
  824. package/dist/frontend/ts7/session-schema.generated.js +5 -0
  825. package/dist/frontend/ts7/session-schema.generated.js.map +1 -0
  826. package/dist/frontend/ts7/session-timing.d.ts +50 -0
  827. package/dist/frontend/ts7/session-timing.js +61 -0
  828. package/dist/frontend/ts7/session-timing.js.map +1 -0
  829. package/dist/frontend/ts7/session-timing.test.d.ts +1 -0
  830. package/dist/frontend/ts7/session-timing.test.js +52 -0
  831. package/dist/frontend/ts7/session-timing.test.js.map +1 -0
  832. package/dist/frontend/ts7/session.d.ts +105 -0
  833. package/dist/frontend/ts7/session.js +233 -0
  834. package/dist/frontend/ts7/session.js.map +1 -0
  835. package/dist/frontend/ts7/session.test.d.ts +1 -0
  836. package/dist/frontend/ts7/session.test.js +215 -0
  837. package/dist/frontend/ts7/session.test.js.map +1 -0
  838. package/dist/frontend/ts7/source-parser-node.d.ts +6 -0
  839. package/dist/frontend/ts7/source-parser-node.js +15 -0
  840. package/dist/frontend/ts7/source-parser-node.js.map +1 -0
  841. package/dist/frontend/ts7/source-parser.d.ts +25 -0
  842. package/dist/frontend/ts7/source-parser.js +96 -0
  843. package/dist/frontend/ts7/source-parser.js.map +1 -0
  844. package/dist/frontend/ts7/source-parser.test.d.ts +1 -0
  845. package/dist/frontend/ts7/source-parser.test.js +151 -0
  846. package/dist/frontend/ts7/source-parser.test.js.map +1 -0
  847. package/dist/frontend/ts7/syntax.d.ts +3 -0
  848. package/dist/frontend/ts7/syntax.js +4 -0
  849. package/dist/frontend/ts7/syntax.js.map +1 -0
  850. package/dist/frontend/tsc-codes.js +3 -0
  851. package/dist/frontend/tsc-codes.js.map +1 -1
  852. package/dist/frontend/type-mapper.d.ts +25 -17
  853. package/dist/frontend/type-mapper.js +465 -121
  854. package/dist/frontend/type-mapper.js.map +1 -1
  855. package/dist/frontend/type-mapper.test.js +123 -2
  856. package/dist/frontend/type-mapper.test.js.map +1 -1
  857. package/dist/frontend/union-discriminants.d.ts +16 -0
  858. package/dist/frontend/union-discriminants.js +98 -0
  859. package/dist/frontend/union-discriminants.js.map +1 -0
  860. package/dist/frontend/union-discriminants.test.d.ts +1 -0
  861. package/dist/frontend/union-discriminants.test.js +182 -0
  862. package/dist/frontend/union-discriminants.test.js.map +1 -0
  863. package/dist/index.d.ts +7 -198
  864. package/dist/index.js +369 -1572
  865. package/dist/index.js.map +1 -1
  866. package/dist/ir/analysis.d.ts +16 -4
  867. package/dist/ir/analysis.js +21 -4
  868. package/dist/ir/analysis.js.map +1 -1
  869. package/dist/ir/analysis.test.js +15 -2
  870. package/dist/ir/analysis.test.js.map +1 -1
  871. package/dist/ir/constant-tables.js +67 -49
  872. package/dist/ir/constant-tables.js.map +1 -1
  873. package/dist/ir/constant-tables.test.js +1 -1
  874. package/dist/ir/control-flow.d.ts +6 -0
  875. package/dist/ir/control-flow.js +142 -0
  876. package/dist/ir/control-flow.js.map +1 -0
  877. package/dist/ir/control-flow.test.d.ts +1 -0
  878. package/dist/ir/control-flow.test.js +113 -0
  879. package/dist/ir/control-flow.test.js.map +1 -0
  880. package/dist/ir/integer-loops.js +7 -18
  881. package/dist/ir/integer-loops.js.map +1 -1
  882. package/dist/ir/integer-ranges.js +53 -27
  883. package/dist/ir/integer-ranges.js.map +1 -1
  884. package/dist/ir/ir.d.ts +291 -152
  885. package/dist/ir/ir.js +588 -881
  886. package/dist/ir/ir.js.map +1 -1
  887. package/dist/ir/ir.test.js +127 -1
  888. package/dist/ir/ir.test.js.map +1 -1
  889. package/dist/ir/scalar-records.js +165 -134
  890. package/dist/ir/scalar-records.js.map +1 -1
  891. package/dist/ir/scalar-records.test.js +1 -1
  892. package/dist/ir/serialize.d.ts +4 -2
  893. package/dist/ir/serialize.js +19 -12
  894. package/dist/ir/serialize.js.map +1 -1
  895. package/dist/ir/serialize.test.d.ts +1 -0
  896. package/dist/ir/serialize.test.js +53 -0
  897. package/dist/ir/serialize.test.js.map +1 -0
  898. package/dist/ir/traverse.d.ts +41 -0
  899. package/dist/ir/traverse.js +660 -0
  900. package/dist/ir/traverse.js.map +1 -0
  901. package/dist/ir/traverse.test.d.ts +1 -0
  902. package/dist/ir/traverse.test.js +242 -0
  903. package/dist/ir/traverse.test.js.map +1 -0
  904. package/dist/ir/validate.js +1942 -1491
  905. package/dist/ir/validate.js.map +1 -1
  906. package/dist/ir/validate.test.js +476 -2
  907. package/dist/ir/validate.test.js.map +1 -1
  908. package/dist/library/cache-primitives.d.ts +2 -3
  909. package/dist/library/cache-primitives.js +4 -6
  910. package/dist/library/cache-primitives.js.map +1 -1
  911. package/dist/library/fence-eval.js +2 -2
  912. package/dist/library/fence-eval.js.map +1 -1
  913. package/dist/library/int-infer.js +7 -6
  914. package/dist/library/int-infer.js.map +1 -1
  915. package/dist/library/int-infer.test.js +4 -4
  916. package/dist/library/library-cache.d.ts +3 -2
  917. package/dist/library/library-cache.js +5 -17
  918. package/dist/library/library-cache.js.map +1 -1
  919. package/dist/library/library-cache.test.js +54 -41
  920. package/dist/library/library-cache.test.js.map +1 -1
  921. package/dist/library/library-profile.d.ts +3 -1
  922. package/dist/library/library-profile.js +15 -6
  923. package/dist/library/library-profile.js.map +1 -1
  924. package/dist/library/prepare.d.ts +15 -0
  925. package/dist/library/prepare.js +584 -0
  926. package/dist/library/prepare.js.map +1 -0
  927. package/dist/library/semantic-source.d.ts +1 -1
  928. package/dist/library/semantic-source.js +8 -6
  929. package/dist/library/semantic-source.js.map +1 -1
  930. package/dist/library/sidecar-validate.js +4 -4
  931. package/dist/library/sidecar-validate.js.map +1 -1
  932. package/dist/library/sidecar.d.ts +2 -0
  933. package/dist/library/sidecar.js +10 -3
  934. package/dist/library/sidecar.js.map +1 -1
  935. package/dist/native/cache.d.ts +11 -0
  936. package/dist/native/cache.js +113 -0
  937. package/dist/native/cache.js.map +1 -0
  938. package/dist/native/cache.test.d.ts +1 -0
  939. package/dist/native/cache.test.js +66 -0
  940. package/dist/native/cache.test.js.map +1 -0
  941. package/dist/native/cli.d.ts +1 -0
  942. package/dist/native/cli.js +112 -0
  943. package/dist/native/cli.js.map +1 -0
  944. package/dist/native/compiler.d.ts +15 -0
  945. package/dist/native/compiler.js +336 -0
  946. package/dist/native/compiler.js.map +1 -0
  947. package/dist/native/compiler.test.d.ts +1 -0
  948. package/dist/native/compiler.test.js +174 -0
  949. package/dist/native/compiler.test.js.map +1 -0
  950. package/dist/native/comptime.d.ts +5 -0
  951. package/dist/native/comptime.js +73 -0
  952. package/dist/native/comptime.js.map +1 -0
  953. package/dist/native/comptime.test.d.ts +1 -0
  954. package/dist/native/comptime.test.js +65 -0
  955. package/dist/native/comptime.test.js.map +1 -0
  956. package/dist/native/executable-cache.d.ts +26 -0
  957. package/dist/native/executable-cache.js +228 -0
  958. package/dist/native/executable-cache.js.map +1 -0
  959. package/dist/native/executable-cache.test.d.ts +1 -0
  960. package/dist/native/executable-cache.test.js +151 -0
  961. package/dist/native/executable-cache.test.js.map +1 -0
  962. package/dist/native/file-identity.d.ts +4 -0
  963. package/dist/native/file-identity.js +14 -0
  964. package/dist/native/file-identity.js.map +1 -0
  965. package/dist/native/file-identity.test.d.ts +1 -0
  966. package/dist/native/file-identity.test.js +43 -0
  967. package/dist/native/file-identity.test.js.map +1 -0
  968. package/dist/native/library.d.ts +22 -0
  969. package/dist/native/library.js +83 -0
  970. package/dist/native/library.js.map +1 -0
  971. package/dist/native/prepare.d.ts +21 -0
  972. package/dist/native/prepare.js +174 -0
  973. package/dist/native/prepare.js.map +1 -0
  974. package/dist/native/prepare.test.d.ts +1 -0
  975. package/dist/native/prepare.test.js +70 -0
  976. package/dist/native/prepare.test.js.map +1 -0
  977. package/dist/native/sanitizer.d.ts +11 -0
  978. package/dist/native/sanitizer.js +135 -0
  979. package/dist/native/sanitizer.js.map +1 -0
  980. package/dist/native/sanitizer.test.d.ts +1 -0
  981. package/dist/native/sanitizer.test.js +58 -0
  982. package/dist/native/sanitizer.test.js.map +1 -0
  983. package/dist/native/task.d.ts +4 -0
  984. package/dist/native/task.js +16 -0
  985. package/dist/native/task.js.map +1 -0
  986. package/dist/native/task.test.d.ts +1 -0
  987. package/dist/native/task.test.js +17 -0
  988. package/dist/native/task.test.js.map +1 -0
  989. package/dist/native/toolchain.d.ts +45 -0
  990. package/dist/native/toolchain.js +74 -0
  991. package/dist/native/toolchain.js.map +1 -0
  992. package/dist/native/toolchain.test.d.ts +1 -0
  993. package/dist/native/toolchain.test.js +33 -0
  994. package/dist/native/toolchain.test.js.map +1 -0
  995. package/dist/startup-cache.d.ts +1 -1
  996. package/dist/startup-cache.js +2 -5
  997. package/dist/startup-cache.js.map +1 -1
  998. package/dist/timing.d.ts +4 -0
  999. package/dist/timing.js +19 -0
  1000. package/dist/timing.js.map +1 -0
  1001. package/dist/wasi-paths.js +10 -7
  1002. package/dist/wasi-paths.js.map +1 -1
  1003. package/package.json +28 -19
  1004. package/surface-manifest.json +52 -18
  1005. package/dist/backend/c/async.d.ts +0 -171
  1006. package/dist/backend/c/async.js +0 -1317
  1007. package/dist/backend/c/async.js.map +0 -1
  1008. package/dist/backend/c/c-emitter.d.ts +0 -536
  1009. package/dist/backend/c/c-emitter.js +0 -1932
  1010. package/dist/backend/c/c-emitter.js.map +0 -1
  1011. package/dist/backend/c/exprs.d.ts +0 -15
  1012. package/dist/backend/c/exprs.js +0 -8847
  1013. package/dist/backend/c/exprs.js.map +0 -1
  1014. package/dist/backend/c/island.d.ts +0 -45
  1015. package/dist/backend/c/island.js +0 -281
  1016. package/dist/backend/c/island.js.map +0 -1
  1017. package/dist/backend/c/may-throw.js.map +0 -1
  1018. package/dist/backend/c/shapes.d.ts +0 -142
  1019. package/dist/backend/c/shapes.js +0 -603
  1020. package/dist/backend/c/shapes.js.map +0 -1
  1021. package/dist/backend/c/stmts.d.ts +0 -76
  1022. package/dist/backend/c/stmts.js +0 -1108
  1023. package/dist/backend/c/stmts.js.map +0 -1
  1024. package/dist/backend/c/types.d.ts +0 -71
  1025. package/dist/backend/c/types.js +0 -459
  1026. package/dist/backend/c/types.js.map +0 -1
  1027. package/dist/backend/c/types.test.js +0 -32
  1028. package/dist/backend/c/types.test.js.map +0 -1
  1029. package/dist/backend/c/walkers.d.ts +0 -134
  1030. package/dist/backend/c/walkers.js +0 -1772
  1031. package/dist/backend/c/walkers.js.map +0 -1
  1032. /package/dist/backend/{c/types.test.d.ts → cycle-analysis.test.d.ts} +0 -0
package/dist/ir/ir.d.ts CHANGED
@@ -4,10 +4,11 @@ export interface SrcLoc {
4
4
  start: number;
5
5
  end: number;
6
6
  }
7
- /** Typed-array element kinds with a runtime representation: Uint8Array/Buffer,
8
- * Uint32Array, Int32Array, Float32Array, and Float64Array. Other flavors stay
9
- * frontend-fenced. */
10
- export type IrBytesElem = "u8" | "u32" | "i32" | "f32" | "f64";
7
+ /** Numeric typed-array element kinds with a native representation. Float16
8
+ * and BigInt typed arrays remain frontend-fenced. */
9
+ export type IrBytesElem = "u8" | "u8c" | "i8" | "u16" | "i16" | "u32" | "i32" | "f32" | "f64";
10
+ export declare const BYTES_ELEMENT_SIZE: Record<IrBytesElem, number>;
11
+ export declare const BYTES_ELEMENT_NAME: Record<IrBytesElem, string>;
11
12
  export type IrType = {
12
13
  kind: "f64";
13
14
  }
@@ -36,10 +37,10 @@ export type IrType = {
36
37
  }
37
38
  /** ES `Map<K, V>` — heap, refcounted, insertion-ordered hash map with ONE
38
39
  * runtime representation (ScrMap) and type-directed key/value handling,
39
- * exactly the array pattern (never per-instantiation structs). Keys are
40
- * f64 or string (SameValueZero); values are f64, string, bool, record,
41
- * object, union, or array — anything isRefCounted or scalar EXCEPT
42
- * func/promise/dyn/jsval/map (frontend-fenced, validator-checked). */
40
+ * exactly the array pattern (never per-instantiation structs). Keys use
41
+ * numeric SameValueZero, string content, or reference identity, including
42
+ * payload identity for unions of reference keys. isSupportedMapKey and
43
+ * isSupportedMapValue define the frontend/validator storage fences. */
43
44
  | {
44
45
  kind: "map";
45
46
  key: IrType;
@@ -48,10 +49,8 @@ export type IrType = {
48
49
  /** ES `Set<T>` — heap, refcounted, insertion-ordered. Map's sibling with
49
50
  * the value slot removed: ONE runtime representation (the backend lowers
50
51
  * sets onto the map runtime with a constant unit value), elements are
51
- * exactly Map's KEY types — f64 or string, SameValueZero. Same container
52
- * fences as map (no union arms, no array elements, no map values, no sets
53
- * of sets, not JSON-safe) and never cycle-capable: elements are scalars
54
- * or strings, which cannot point back. */
52
+ * exactly Map's KEY types and use the same equality. Reference elements
53
+ * carry retain/release and, when cycle-capable, tracing adapters. */
55
54
  | {
56
55
  kind: "set";
57
56
  elem: IrType;
@@ -293,11 +292,9 @@ export type IrType = {
293
292
  }
294
293
  /** The class STATIC side as a value — `typeof C`, the type of the class
295
294
  * name itself and of `new (…) => T` constructor-typed slots. Runtime
296
- * representation is the per-class IMMORTAL class object (ScrClassObj:
297
- * preorder interval, construct thunk, .name string) emitted once per
298
- * classRef-referenced class — so identity `===` is one pointer compare
299
- * and retains/releases are no-ops on the immortal (the regex-literal
300
- * discipline; isRefCounted says true for container/RC uniformity).
295
+ * representation is ScrClassObj: an immortal top-level template or a fresh
296
+ * function-local object owning captured binding boxes. Identity is one
297
+ * pointer comparison; local instances retain their constructor object.
301
298
  * Values of `classval:C` are C's class object or a STRICT DESCENDANT's —
302
299
  * the object kind's nominal, upcast-only story — and every legal flow
303
300
  * preserves the constructor ABI (upcast requires the descendant's
@@ -305,7 +302,8 @@ export type IrType = {
305
302
  * completion against C's one signature sound. Allowed in locals,
306
303
  * globals, params, returns, class/record fields, capture boxes, array
307
304
  * elements, Map VALUES, and union arms; fenced out of Map keys, Set
308
- * elements, JSON, dyn/jsval conversion, and ToString. */
305
+ * elements, JSON, jsval conversion, and ToString. Unknown slots retain
306
+ * class identity and allow an exact typed constructor round trip. */
309
307
  | {
310
308
  kind: "classval";
311
309
  className: string;
@@ -424,7 +422,7 @@ interface IrKindSet<K extends IrType["kind"]> extends ReadonlySet<IrType["kind"]
424
422
  declare const HANDLE_KIND_LIST: readonly ["stats", "fileHandle", "spawnRes", "child", "netServer", "netSocket", "http2Session", "http2Stream", "dgramSocket", "testCtx", "httpReq", "httpRes", "httpClientReq", "secureCtx", "cryptoHash", "cryptoHmac", "fsWatcher", "childStream", "childWriter", "procStream"];
425
423
  export type HandleKind = typeof HANDLE_KIND_LIST[number];
426
424
  export declare const HANDLE_KINDS: IrKindSet<"child" | "childStream" | "childWriter" | "cryptoHash" | "cryptoHmac" | "dgramSocket" | "fileHandle" | "fsWatcher" | "http2Session" | "http2Stream" | "httpClientReq" | "httpReq" | "httpRes" | "netServer" | "netSocket" | "procStream" | "secureCtx" | "spawnRes" | "stats" | "testCtx">;
427
- /** The IR kinds represented as pointers in both native backends. */
425
+ /** The IR kinds represented as pointers in native code. */
428
426
  declare const POINTER_KIND_LIST: readonly ["string", "bigint", "array", "map", "set", "regex", "bytes", "url", "searchParams", "symbol", "stats", "fileHandle", "spawnRes", "child", "netServer", "netSocket", "http2Session", "http2Stream", "dgramSocket", "testCtx", "httpReq", "httpRes", "httpClientReq", "secureCtx", "cryptoHash", "cryptoHmac", "fsWatcher", "childStream", "childWriter", "func", "object", "classval", "moduleNs", "record", "union", "dyn", "jsval", "caught", "promise", "generator"];
429
427
  export type PointerKind = typeof POINTER_KIND_LIST[number];
430
428
  export declare const POINTER_KINDS: IrKindSet<"array" | "bigint" | "bytes" | "caught" | "child" | "childStream" | "childWriter" | "classval" | "cryptoHash" | "cryptoHmac" | "dgramSocket" | "dyn" | "fileHandle" | "fsWatcher" | "func" | "generator" | "http2Session" | "http2Stream" | "httpClientReq" | "httpReq" | "httpRes" | "jsval" | "map" | "moduleNs" | "netServer" | "netSocket" | "object" | "promise" | "record" | "regex" | "searchParams" | "secureCtx" | "set" | "spawnRes" | "stats" | "string" | "symbol" | "testCtx" | "union" | "url">;
@@ -482,36 +480,28 @@ export declare const NULL_T: IrType;
482
480
  * wrapping allocates no payload, narrowing to a unit arm produces no value
483
481
  * (the frontend never emits it), and releasing has nothing to release. */
484
482
  export declare function isUnitType(t: IrType): boolean;
485
- /** Element kinds with a real ScrArr storage/RC representation in BOTH
486
- * backends. Array-producing lowerings can learn their result element from
483
+ /** Element kinds with a real ScrArr storage/RC representation.
484
+ * Array-producing lowerings can learn their result element from
487
485
  * a callback rather than through mapType's ordinary T[] gate, so they must
488
486
  * share this predicate instead of reconstructing an array around an
489
- * otherwise-valid standalone type (Map, Set, dyn, opaque handles, ...). */
487
+ * otherwise-valid standalone type (Date, opaque handles, ...). */
490
488
  export declare function isSupportedArrayElem(t: IrType): boolean;
491
489
  export declare function arrayOf(elem: IrType): IrType;
492
490
  export declare function bytesOf(elem: IrBytesElem): IrType;
493
491
  export declare function mapOf(key: IrType, value: IrType): IrType;
494
492
  export declare function setOf(elem: IrType): IrType;
495
- /** The Map KEY fence: string (content) or number (SameValueZero) — the two
496
- * kinds a hash of the VALUE is honest for. Booleans, objects, and the rest
497
- * of JS's anything-goes keys stay out. Shared by the frontend's
498
- * type mapping/diagnostics and the validator. Set ELEMENTS use the same
499
- * fence: a set is hashed storage of its elements exactly as a map is of
500
- * its keys (isSupportedSetElem is this predicate under its own name). */
501
- export declare function isSupportedMapKey(t: IrType): boolean;
502
- /** The Set ELEMENT fence — Map's key fence plus the refcounted HANDLE
503
- * kinds stored under identity hashing (SameValueZero for JS objects IS
504
- * reference identity, so a Set of server handles — portless's auxiliary-
505
- * server registry — is honest hashed storage; SCR_MAP_KEY_REF in the
506
- * runtime). netServer is the one handle admitted so far: it drops its
507
- * listener closures at close, so a set-in-listener cycle is temporary —
508
- * the child precedent's story. Symbols are identity values by DESIGN —
509
- * SameValueZero on a symbol IS pointer identity, so a Set of symbols (the
510
- * sentinel-registry idiom) is the same honest hashed storage with no
511
- * cycle risk at all (symbols hold only strings). */
512
- export declare function isSupportedSetElem(t: IrType): boolean;
513
- /** The Map VALUE fence: scalars plus every refcounted kind EXCEPT
514
- * func/promise/dyn/jsval (and map itself — no maps of maps).
493
+ /** Values whose native reference represents JavaScript identity. Records,
494
+ * classes and arrays can point back at their collection, so constructors
495
+ * must carry key tracing as well as retain/release adapters. */
496
+ export declare function isIdentityCollectionKey(t: IrType): boolean;
497
+ /** Numbers use SameValueZero, strings use content, and reference keys use
498
+ * identity. A union of identity arms hashes its payload, never its temporary
499
+ * wrapper. Mixed scalar/reference unions remain outside this contract. */
500
+ export declare function isSupportedMapKey(t: IrType, unionArms?: IrType[]): boolean;
501
+ /** Set elements and Map keys share storage, equality and ownership rules. */
502
+ export declare function isSupportedSetElem(t: IrType, unionArms?: IrType[]): boolean;
503
+ /** The Map VALUE fence: scalars, supported native references and checked
504
+ * values. Functions require checked-value boxing; jsval has no native slot.
515
505
  * Record/object/union values can point back at the map holding them, which
516
506
  * is exactly why ref-valued maps are cycle-capable (see the backend's
517
507
  * cycle analysis and docs/memory.md). Shared frontend/validator. */
@@ -519,28 +509,19 @@ export declare function isSupportedMapValue(t: IrType): boolean;
519
509
  /** The INDEX-SIGNATURE value fence (`{ [k: string]: V }` shapes): the map
520
510
  * VALUE kinds — the overflow portion IS a string-keyed map — plus dyn
521
511
  * (`unknown`, an unknown-valued pricing-table shape: overflow reads surface ordinary
522
- * dyn values validated by the usual checked casts) and three kinds the
523
- * overflow store carries that user Maps don't admit yet:
512
+ * dyn values validated by the usual checked casts) and callable values:
524
513
  * func — `Record<string, () => void>`, the command-registry pattern
525
514
  * (scr_closure adapters; closures are cycle-headered and traced,
526
515
  * so a handler capturing its own registry collects)
527
- * map/set — `Record<string, Map<K, V>>`/`Record<string, Set<T>>`
528
- * nested-container tables (scr_map adapters; a map value's own
529
- * cycle capability propagates through the trace fixpoint)
530
516
  * Nested index-signature RECORDS ride the record kind like any other.
531
517
  * Shared frontend (mapType) / validator. */
532
518
  export declare function isSupportedIndexValue(t: IrType): boolean;
533
519
  export declare function funcOf(params: IrType[], ret: IrType): IrType;
534
- /** The union FUNC/SET-arm sibling rule, shared by the frontend's union
535
- * builders and the validator: FUNC arms are valid beside ANY sibling —
536
- * `typeof x === "function"` narrows against data arms, unit tag tests
537
- * cover the nullable-callback shape, and between func arms closures
538
- * compare by pointer identity per tag (unionEq), so `x === String` is the
539
- * narrowing (the primitive-constructor tables' `StringConstructor |
540
- * NumberConstructor` field, and LinkOptions' `false | ((s: string) =>
541
- * string)`). A SET arm keeps the unit-only rule (no narrowing test
542
- * against data arms). */
543
- export declare function unionFuncSetArmsOk(arms: IrType[]): boolean;
520
+ /** Maps, sets and promises may share a union with null/undefined only.
521
+ * Unit tag tests can narrow nullable containers without losing identity;
522
+ * arbitrary data siblings require a separate runtime narrowing operation.
523
+ * Share this rule across checker mapping, synthesized unions and validation. */
524
+ export declare function unionContainerArmsOk(arms: IrType[]): boolean;
544
525
  /** Canonical, injective text form of an IrType — the building block of
545
526
  * shape/union identity keys, generic-function instantiation keys, and the
546
527
  * backend's per-type helper interning (jsonStringify/dynCheck walkers).
@@ -557,7 +538,7 @@ export declare function typeEquals(a: IrType, b: IrType): boolean;
557
538
  export declare function isRefCounted(t: IrType): boolean;
558
539
  export interface IrModule {
559
540
  /** Bumped on any breaking IR change; serialize.ts refuses mismatches. */
560
- irVersion: 11;
541
+ irVersion: 13;
561
542
  sourceFile: string;
562
543
  functions: IrFunction[];
563
544
  /** Class shapes. Constructors and methods are ordinary module functions
@@ -624,15 +605,15 @@ export interface IrModule {
624
605
  * and system-library inputs. Absent when the build has no FFI manifest. */
625
606
  ffiImports?: IrFfiImport[];
626
607
  /** LIBRARY mode: the profile's resolved export map plus the
627
- * mode-provided symbol names, landed ON the IR so both backends emit the
608
+ * mode-provided symbol names, landed ON the IR so the backend emits the
628
609
  * external-linkage wrappers and entries from the same facts — the two
629
610
  * emissions stay conformance-identical by construction. Absent on every
630
611
  * executable build (the backends emit main() exactly as always). */
631
612
  lib?: IrLibSection;
632
613
  }
633
- export type IrFfiValueParamClass = "f64" | "bool" | "u8" | "u32" | "i32" | "string" | "bytes";
634
- export type IrFfiCallbackParamClass = "f64" | "bool" | "u8" | "u32" | "i32" | "cstring" | "string" | "bytes";
635
- export type IrFfiReturnClass = "f64" | "bool" | "u8" | "u32" | "i32" | "void";
614
+ export type IrFfiValueParamClass = "f64" | "f32" | "bool" | "u8" | "i8" | "u16" | "i16" | "u32" | "i32" | "i64" | "u64" | "pointer" | "string" | "bytes" | "mutable-bytes";
615
+ export type IrFfiCallbackParamClass = "f64" | "f32" | "bool" | "u8" | "i8" | "u16" | "i16" | "u32" | "i32" | "i64" | "u64" | "pointer" | "cstring" | "string" | "bytes";
616
+ export type IrFfiReturnClass = "f64" | "f32" | "bool" | "u8" | "i8" | "u16" | "i16" | "u32" | "i32" | "i64" | "u64" | "pointer" | "void";
636
617
  export interface IrFfiContextParam {
637
618
  /** Manifest-local id of the callback whose ScrClosure* occupies this ABI slot. */
638
619
  context: string;
@@ -680,6 +661,10 @@ export interface IrFfiImport {
680
661
  name: string;
681
662
  /** The external C symbol. */
682
663
  symbol: string;
664
+ /** Exact node:ffi.dlopen library name when exposed as a checked callable. */
665
+ library?: string;
666
+ callbackOperation?: "register" | "release";
667
+ callbackTarget?: string;
683
668
  params: IrFfiParam[];
684
669
  returns: IrFfiReturnClass;
685
670
  }
@@ -723,7 +708,7 @@ export interface IrLibTrapOverlay {
723
708
  }
724
709
  /** One resolved host-callback channel (the profile's `callbacks` entry
725
710
  * landed on the IR): compiled call sites of the channel's ambient binding
726
- * lower as ffiCall nodes carrying the channel name, and both backends emit
711
+ * lower as ffiCall nodes carrying the channel name, and the backend emits
727
712
  * the same dispatch — fetch the slot's registered pointer through
728
713
  * scr_library_cb_require (which delivers `unregisteredTrap` through the
729
714
  * library funnel when the host never registered), then the typed indirect
@@ -735,11 +720,11 @@ export interface IrLibCallback {
735
720
  /** The runtime channel slot (profile declaration order). */
736
721
  slot: number;
737
722
  params: ("f64" | "bool" | "string" | "bytes" | "u8" | "u32" | "i32")[];
738
- returns: "f64" | "bool" | "u8" | "u32" | "i32" | "void";
723
+ returns: "f64" | "bool" | "u8" | "u32" | "i32" | "i64" | "u64" | "pointer" | "void";
739
724
  /** The unregistered-call trap text (a DETECTED trap: plain bytes the
740
725
  * library funnel classifies SC4025 and assembles with the current
741
726
  * entry's symbol — unlike the SC4012 wrapper traps, the entry is only
742
- * known at runtime). Built once at export resolution so both backends
727
+ * known at runtime). Built once at export resolution so generated wrappers
743
728
  * emit identical constants by construction. */
744
729
  unregisteredTrap: string;
745
730
  }
@@ -798,6 +783,12 @@ export interface IrLibIdentity {
798
783
  }
799
784
  export interface IrClassDef {
800
785
  name: string;
786
+ /** Present for a class evaluated inside a function. Each evaluation owns
787
+ * fresh identity and these shared binding boxes; instance layouts carry a
788
+ * private class-object pointer after their source fields. */
789
+ localCaptures?: IrParam[];
790
+ /** Capture holding the evaluated local base constructor, if any. */
791
+ localBaseCapture?: number;
801
792
  /** The JS-observable `.name` of the class (the runtime class object's
802
793
  * name string, and what `C.name` folds to). Differs from `name` because
803
794
  * IR names are program-qualified (`%m1.C`, `%cx…` for class
@@ -805,6 +796,11 @@ export interface IrClassDef {
805
796
  * binding name for `const x = class {}`, or "" for truly anonymous
806
797
  * expressions. Absent on the runtime-provided defs (never valuable). */
807
798
  jsName?: string;
799
+ /** JavaScript constructor arity, ending before the first default or rest parameter. */
800
+ jsLength?: number;
801
+ /** Zero-argument native helper returning the shared prototype data object.
802
+ * Used when materializing an instance's own-property view. */
803
+ prototypeDataHelper?: string;
808
804
  /** RUNTIME-PROVIDED class (the builtin Error hierarchy): the struct, RC
809
805
  * helpers, and vtable live in the runtime (ScrError / scr_error_*), so
810
806
  * backends emit no definitions for it — only the preorder-interval
@@ -860,7 +856,7 @@ export interface IrClassDef {
860
856
  * `class Error` can never collide). `lib` is the standard-library name the
861
857
  * frontend recognizes; `kind` is the runtime's SCR_ERR_* index (backends
862
858
  * stamp scr_error_vts[kind] and pick constructor kinds by it). Every
863
- * emitted module carries all four class defs (flagged `runtime`) so the
859
+ * emitted module carries the builtin class defs (flagged `runtime`) so the
864
860
  * program's preorder numbering always covers them — the runtime's own
865
861
  * throws (JSON/dynCheck/regex) mint instances of these classes whether or
866
862
  * not user code mentions Error. */
@@ -942,6 +938,9 @@ export interface IrRecordShape {
942
938
  * %dtype) — hidden from every key-order surface, JSON included. */
943
939
  declaredOrder?: string[];
944
940
  }
941
+ /** Codec records have private native state, not a structurally checkable
942
+ * data surface. Reserve the same '%' namespace as other internal slots. */
943
+ export declare function recordTextCodecClass(shape: IrRecordShape): "TextEncoder" | "TextDecoder" | null;
945
944
  /** Object-literal ACCESSOR properties (`{ get x() {...}, set x(v) {...} }`)
946
945
  * live on the shape as reserved '%'-fields holding closures: `%get:x` a
947
946
  * `() => T` invoked once per property READ (side effects and all — JS's
@@ -960,6 +959,16 @@ export declare function accessorSlotProp(fieldName: string): {
960
959
  * accessorSlotProp) — the predicate behind every enumeration-surface
961
960
  * fence. */
962
961
  export declare function shapeHasAccessorSlots(shape: IrRecordShape): boolean;
962
+ /** Literal fields that select a record layout at a checked-dynamic boundary.
963
+ * These are part of union identity: equal storage arms can have different
964
+ * discriminator contracts. Several source variants can share one layout. */
965
+ export interface IrUnionDiscriminant {
966
+ field: string;
967
+ cases: {
968
+ tag: number;
969
+ values: (string | number | boolean)[];
970
+ }[];
971
+ }
963
972
  export interface IrUnionDef {
964
973
  /** Frontend-assigned union id (`u0`, `u1`, ...). */
965
974
  id: string;
@@ -967,6 +976,7 @@ export interface IrUnionDef {
967
976
  * an arm's index here is its runtime tag. Never void/func/union; the
968
977
  * unit kinds (undefinedT/nullT) are payload-less arms. */
969
978
  arms: IrType[];
979
+ discriminant?: IrUnionDiscriminant;
970
980
  }
971
981
  export interface IrFunction {
972
982
  /** Original TS name (mangling is a backend concern). Lifted lambdas get
@@ -982,6 +992,12 @@ export interface IrFunction {
982
992
  * variables received through the closure environment, in caps[] order.
983
993
  * Each is also listed in `locals` (with boxed: true); it is NOT a param. */
984
994
  captures?: IrParam[];
995
+ /** Instance methods/constructors of local classes borrow captures through
996
+ * their first (`this`) parameter. The slot indexes the class object's
997
+ * capture array; no closure parameter is added to the method ABI. */
998
+ classCaptures?: (IrParam & {
999
+ slot: number;
1000
+ })[];
985
1001
  /** Async: the body runs on a fiber; `returnType` is the INNER type T (a
986
1002
  * `return v` fulfills with v) while ordinary call sites receive
987
1003
  * Promise<T>. With `generator` present, call sites receive the lazy
@@ -1014,6 +1030,10 @@ export interface IrFunction {
1014
1030
  kind: "record";
1015
1031
  };
1016
1032
  };
1033
+ /** Source function name for native error stack frames. */
1034
+ sourceName?: string;
1035
+ /** Ordinary authored function declarations/expressions own a prototype. */
1036
+ ownsPrototype?: true;
1017
1037
  body: IrStmt[];
1018
1038
  loc: SrcLoc;
1019
1039
  }
@@ -1028,6 +1048,9 @@ export interface IrGlobal {
1028
1048
  name: string;
1029
1049
  type: IrType;
1030
1050
  mutable: boolean;
1051
+ /** Lexical record/function/checked-value bindings use their initially-null
1052
+ * pointer as a TDZ sentinel. Reads and later writes throw until initializing assign. */
1053
+ tdz?: true;
1031
1054
  /** Original declaration and lexical scope, when this is a source binding. */
1032
1055
  source?: IrBindingSource;
1033
1056
  }
@@ -1046,14 +1069,15 @@ export interface IrLocal {
1046
1069
  * (a shared binding — mutations are visible through every capture). All
1047
1070
  * access, including in the declaring function, goes through the box. */
1048
1071
  boxed?: true;
1049
- /** A forward-captured const (a function declared BEFORE the const it
1072
+ /** A forward-captured lexical binding (a function declared BEFORE the binding it
1050
1073
  * captures): the box is allocated TDZ-empty at scope entry (a `varDecl`
1051
1074
  * with `init: null`) so earlier closures can capture it, and the source
1052
- * declaration initializes it via `assign`. Every read tests the box —
1075
+ * declaration initializes it via `assign` with `initializes: true`.
1076
+ * Every read and non-initializing write tests the box —
1053
1077
  * empty throws JS's catchable ReferenceError ("Cannot access 'name'
1054
1078
  * before initialization"), exactly Node's temporal dead zone. Always
1055
- * paired with `boxed`; restricted to pointer-backed types (the NULL slot
1056
- * IS the TDZ sentinel). Capture entries inherit the flag. */
1079
+ * paired with `boxed`; scalar payloads use a one-element array cell so
1080
+ * the NULL slot remains the TDZ sentinel. Capture entries inherit the flag. */
1057
1081
  tdz?: true;
1058
1082
  }
1059
1083
  export type IrStmt =
@@ -1069,10 +1093,14 @@ export type IrStmt =
1069
1093
  localId: string;
1070
1094
  init: IrExpr | null;
1071
1095
  loc: SrcLoc;
1072
- } | {
1096
+ }
1097
+ /** `initializes` marks a TDZ binding's declaration, whose store may
1098
+ * initialize an empty box. Ordinary assignments must check it first. */
1099
+ | {
1073
1100
  kind: "assign";
1074
1101
  localId: string;
1075
1102
  value: IrExpr;
1103
+ initializes?: true;
1076
1104
  loc: SrcLoc;
1077
1105
  } | {
1078
1106
  kind: "exprStmt";
@@ -1468,7 +1496,10 @@ export type IrStrIntrinsicMethod = "length" | "charCodeAt" | "charAt" | "indexOf
1468
1496
  * constant RangeError on any bad offset; values coerce JS-exactly
1469
1497
  * (integer kinds by modular truncation, Float32 by double→float
1470
1498
  * rounding). No BIG setters exist — bigint arguments never lower. */
1471
- export type IrBytesIntrinsicMethod = "length" | "byteLength" | "get" | "slice" | "subarray"
1499
+ export type IrBytesIntrinsicMethod = "buffer" | "length" | "byteLength" | "get" | "slice" | "subarray"
1500
+ /** In-place overlapping copy, [target, start, end] relative indices;
1501
+ * returns the receiver (+1). */
1502
+ | "copyWithin"
1472
1503
  /** Fresh Uint8Array copying methods. `with` takes [index, value] and
1473
1504
  * throws a catchable RangeError for an invalid relative index. */
1474
1505
  | "toReversed" | "with"
@@ -1477,7 +1508,7 @@ export type IrBytesIntrinsicMethod = "length" | "byteLength" | "get" | "slice" |
1477
1508
  | "join"
1478
1509
  /** Drain numeric typed-array elements into a fresh number[]. Used by
1479
1510
  * array spread and typed-array destructuring rest. */
1480
- | "toArray" | "setFrom" | "toString"
1511
+ | "toArray" | "setFrom" | "setFromDyn" | "toString"
1481
1512
  /** Buffer.toString with a runtime-valued encoding. Same signature as
1482
1513
  * toString, but canonicalizes aliases/case and may throw
1483
1514
  * ERR_UNKNOWN_ENCODING. */
@@ -1543,24 +1574,25 @@ export type IrRegexIntrinsicMethod = "test" | "match"
1543
1574
  * neither reads nor writes lastIndex (a fresh exec from position 0), so
1544
1575
  * no g/y fence applies: /g is irrelevant and /y anchors at 0 — exactly
1545
1576
  * Node. Never throws. */
1546
- | "search" | "source" | "flags" | "replace" | "replaceAll" | "split";
1577
+ | "search" | "source" | "flags" | "toString" | "replace" | "replaceAll" | "split";
1547
1578
  /** The complete standard-library surface (mirrors ambient/scriptc.d.ts: the
1548
1579
  * `process` and `JSON` globals and `declare module "node:fs"`). A closed
1549
1580
  * union — every member has a signature in the validator's LIB_FN_SIGS and a
1550
1581
  * scr_* implementation in the runtime (scr_lib.c / scr_json.c). fs.*
1551
1582
  * failures and json.parse syntax errors THROW (catchable, via the runtime
1552
- * exception cell); process.* members never throw. JSON.stringify is NOT a
1553
- * libCall — it lowers to the type-directed `jsonStringify` node below.
1583
+ * exception cell); process.* members never throw. JSON.stringify without a
1584
+ * callback lowers to the type-directed `jsonStringify` node below; callback
1585
+ * forms use the shared native JSON walker through libCall.
1554
1586
  * island.eval (the internal __island_eval testing hook) exists only in
1555
1587
  * --dynamic builds — the frontend rejects it otherwise, so backends may
1556
1588
  * assume the island runtime is linked when they see it; island exceptions
1557
1589
  * bridge into the exception cell as catchable strings (may-throw). */
1558
- export type IrLibFn =
1590
+ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew" | "weakMap.is" | "weakSet.is" | "weakMap.new" | "weakSet.new" | "dyn.fromEntries" | "arrayBuffer.new" | "arrayBuffer.is" | "arrayBuffer.isView" | "arrayBuffer.byteLengthGetter" | "arrayBuffer.byteLengthDescriptor" | "arrayBuffer.viewU8C" | "arrayBuffer.viewI8" | "arrayBuffer.viewU16" | "arrayBuffer.viewI16" | "arrayBuffer.viewU8" | "arrayBuffer.viewU32" | "arrayBuffer.viewI32" | "arrayBuffer.viewF32" | "arrayBuffer.viewF64" | "arrayBuffer.viewDV"
1559
1591
  /** Native static fetch and its Web-platform companions. fetch.start
1560
1592
  * answers once the response head arrives; the response body readers
1561
1593
  * consume the native body stream. AbortSignal and ReadableStream values
1562
1594
  * are opaque checked-dynamic handles. */
1563
- "fetch.start" | "fetch.responseNew" | "fetch.responseJson" | "fetch.responseText" | "fetch.responseBytes" | "fetch.abortControllerNew" | "fetch.abortTimeout" | "fetch.abortNow" | "fetch.abortAny" | "fetch.streamNew" | "fetch.streamFrom" | "fetch.readerRead" | "island.eval"
1595
+ | "fetch.start" | "fetch.responseNew" | "fetch.responseArrayBuffer" | "fetch.responseJson" | "fetch.responseText" | "fetch.responseBytes" | "fetch.abortControllerNew" | "fetch.abortTimeout" | "fetch.abortNow" | "fetch.abortAny" | "fetch.streamNew" | "fetch.streamFrom" | "fetch.readerRead" | "island.eval"
1564
1596
  /** Load an embedded npm package's runtime entry in the island (cached by
1565
1597
  * the engine's module registry) and take one export: args are the entry
1566
1598
  * KEY (an embedded module's key, from IrModule.embedded) and the export
@@ -1586,7 +1618,7 @@ export type IrLibFn =
1586
1618
  * pending). Documented divergence: JS `as` never checks — like the dyn
1587
1619
  * boundary, a conversion that cannot happen throws instead of lying.
1588
1620
  * --dynamic only. */
1589
- | "island.castFail" | "json.parse"
1621
+ | "island.castFail" | "json.parse" | "json.parseReviver" | "json.stringifyReplacer" | "json.stringifyValue"
1590
1622
  /** Keyed WRITE on a dyn value — `h.onDone = cb` / `h["k"] = v` on a
1591
1623
  * checked-dynamic object (args: receiver, key string, value — all
1592
1624
  * borrowed; the runtime copies the key and retains the value in). An
@@ -1598,7 +1630,14 @@ export type IrLibFn =
1598
1630
  * (sloppy mode would silently ignore — suite tests are 'use strict';
1599
1631
  * SEMANTICS.md notes the sloppy divergence: loud, never silent). Void
1600
1632
  * result; in the may-throw seed set. */
1601
- | "dyn.keySet"
1633
+ | "dyn.keySet" | "dyn.keySetComputed"
1634
+ /** Delete an ordinary checked-native object's own key. Borrows both
1635
+ * arguments; other receiver representations retain a runtime refusal. */
1636
+ | "dyn.keyDelete" | "dyn.keyDeleteComputed" | "dyn.hasKeyComputed" | "dyn.hasOwnComputed" | "dyn.propertyIsEnumerableComputed"
1637
+ /** Native own properties on globalThis keyed by symbol identity. */
1638
+ | "dyn.globalSymbolGet" | "dyn.globalSymbolSet" | "dyn.globalSymbolHas" | "dyn.globalSymbolDelete"
1639
+ /** Exact native class capsule identity, without materializing its fields. */
1640
+ | "dyn.typedRefIs"
1602
1641
  /** Destructuring pack over a dyn source — `const [a, b] = d`, a
1603
1642
  * destructured dyn callback param (args: the source and the STATIC
1604
1643
  * TypeError spelling, "" when the source has none — both borrowed;
@@ -1608,7 +1647,7 @@ export type IrLibFn =
1608
1647
  * verbatim when non-empty, else the runtime kind wording ("number 5 is
1609
1648
  * not iterable (cannot read property Symbol(Symbol.iterator))"). In the
1610
1649
  * may-throw seed set. */
1611
- | "dyn.iterPack"
1650
+ | "dyn.iterPack" | "dyn.arrayFromIterator" | "dyn.iterator" | "dyn.iteratorResult" | "dyn.mapSeedEntries" | "dyn.mapSeedEntry"
1612
1651
  /** The for-of-over-dyn pack accessors — the emitted index loop drives
1613
1652
  * them over a dyn.iterPack result (ARR by construction). arrLen: the
1614
1653
  * ARR length as f64 (0 for non-ARR kinds; arg borrowed). arrAt: the
@@ -1618,17 +1657,16 @@ export type IrLibFn =
1618
1657
  /** `key in v` with a RUNTIME (string) key on a checked-dynamic
1619
1658
  * receiver (args: value dyn, key string; result bool): OBJ answers
1620
1659
  * own-member presence, ARR answers 'length'/a valid index — exactly
1621
- * the compile-time dynHasKey fold, per value. Never throws. */
1660
+ * the literal-key dynHasKey path. Proxy has traps may throw. */
1622
1661
  | "dyn.hasKey"
1623
1662
  /** Object.defineProperties over dyn values (args: target, descriptors —
1624
1663
  * both borrowed dyn; result: the target, +1 — JS's return value).
1625
- * Value descriptors become plain own properties on OBJ and FUNC targets
1626
- * (writable/enumerable/configurable accepted and IGNORED — dyn
1627
- * properties are plain data properties, SEMANTICS.md); get/set
1664
+ * Value descriptors become own properties on OBJ and FUNC targets;
1665
+ * OBJ targets preserve data attributes. get/set
1628
1666
  * descriptors and non-object targets/descriptors throw catchably
1629
1667
  * (Node's TypeError texts; accessors the loud unsupported Error). In
1630
1668
  * the may-throw seed set. */
1631
- | "dyn.defineProps"
1669
+ | "dyn.defineProps" | "dyn.defineProperty" | "dyn.getOwnPropertyDescriptor" | "dyn.arrayProtoCall"
1632
1670
  /** Bare `typeof v` on a dyn value AS A STRING (arg: the dyn value,
1633
1671
  * borrowed; result: an owned string) — the dyn kind's JS answer:
1634
1672
  * undefined→"undefined", null/object/array/bytes→"object" (JS's oldest
@@ -1636,7 +1674,7 @@ export type IrLibFn =
1636
1674
  * Never throws. */
1637
1675
  | "dyn.typeof"
1638
1676
  /** Object.prototype.toString.call on a checked-dynamic value. */
1639
- | "dyn.objectTag"
1677
+ | "dyn.objectTag" | "dyn.freeze" | "dyn.isFrozen" | "dyn.nativeSetNew" | "dyn.nativeSetIs" | "dyn.nativeMapIs" | "dyn.nativeUrlIs" | "dyn.nativeDateIs" | "date.nativeNew" | "date.checkedValue" | "dyn.nativeRegexIs"
1640
1678
  /** toString() on a checked-dynamic receiver: runtime kind dispatch
1641
1679
  * (bytes decode per the literal encoding — utf8 default; strings,
1642
1680
  * numbers, booleans, arrays, objects answer JS-exactly; undefined and
@@ -1816,7 +1854,10 @@ export type IrLibFn =
1816
1854
  * value / string) — both THROW Node's TypeErrors on non-file schemes,
1817
1855
  * encoded slashes, and non-empty hosts. url.pathToFileURL resolves the
1818
1856
  * path (getcwd) and never throws. */
1819
- | "url.new" | "url.protocol" | "url.origin" | "url.username" | "url.password" | "url.host" | "url.hostname" | "url.port" | "url.pathname" | "url.href" | "url.fileURLToPathUrl" | "url.fileURLToPathStr" | "url.pathToFileURL"
1857
+ | "url.new" | "url.newBase" | "url.protocol" | "url.origin" | "url.username" | "url.password" | "url.host" | "url.hostname" | "url.port" | "url.pathname" | "url.href" | "url.fileURLToPathUrl" | "url.fileURLToPathChecked" | "url.fileURLToPathStr" | "url.pathToFileURL"
1858
+ /** Explicit path syntax from the options.windows argument, independent
1859
+ * of the executable's host platform. Windows UNC input can throw. */
1860
+ | "url.pathToFileURLPlatform"
1820
1861
  /** pathToFileURL under a win32 TARGET: the same scr_url_from_path call
1821
1862
  * (the runtime selects the win32 arm by _WIN32), but a distinct IR name
1822
1863
  * because that arm THROWS for malformed UNC inputs — may-throw seeds on
@@ -1876,7 +1917,7 @@ export type IrLibFn =
1876
1917
  * sym.desc / sym.keyFor answer the interned `string | undefined` union
1877
1918
  * (the runtime returns +1-or-NULL; the backend builds the union arms —
1878
1919
  * the child.stdout pattern). None of these throw. */
1879
- | "sym.new" | "sym.newAnon" | "sym.for" | "sym.keyFor" | "sym.desc" | "sym.toString"
1920
+ | "sym.new" | "sym.newAnon" | "sym.for" | "sym.wellKnown" | "sym.keyFor" | "sym.desc" | "sym.toString"
1880
1921
  /** Engine-free arbitrary-precision bigint operations (scr_bigint.c).
1881
1922
  * parse accepts the ECMAScript BigInt string grammar; fromF64 accepts
1882
1923
  * finite integral Numbers. Arithmetic returns fresh immutable values.
@@ -2438,7 +2479,13 @@ export type IrLibFn =
2438
2479
  * base64 decode Node-leniently, so it never throws. concat takes ONE
2439
2480
  * bytes<u8>[] arg (the list) and returns a fresh copy. `Buffer.from(u8)`
2440
2481
  * and `Buffer.alloc(n)` need no libFn — they lower to bytesNew. */
2441
- | "buffer.fromStr" | "buffer.concat"
2482
+ | "buffer.fromStr" | "buffer.brand"
2483
+ /** Buffer.from on checked-native strings, bytes, arrays and data-only
2484
+ * array-like/Buffer-JSON objects. The encoding is a normalized literal;
2485
+ * non-string inputs ignore it. Copies the input and may throw during
2486
+ * element coercion or argument validation. Custom object valueOf and
2487
+ * opaque reference inputs retain explicit runtime refusals. */
2488
+ | "buffer.fromDyn" | "buffer.concat"
2442
2489
  /** Buffer.byteLength(string, enc) — enc a NORMALIZED literal like
2443
2490
  * fromStr's — and Buffer.isEncoding(name) over a runtime string
2444
2491
  * (case-insensitive against Node's alias set). Pure; never throw. */
@@ -2492,18 +2539,21 @@ export type IrLibFn =
2492
2539
  * naming the message slot ("setMaxListeners" for the static call,
2493
2540
  * "defaultMaxListeners" for the module-property assignment). */
2494
2541
  | "emitter.setMaxChk" | "emitter.setDefaultMaxChk"
2495
- /** The Buffer forms of the fs quartet: readFileSync(path) with NO
2496
- * encoding → bytes<u8> (+1), writeFileSync(path, bytes), and the
2542
+ /** The Buffer forms of fs: readFileSync(path) with NO
2543
+ * encoding → bytes<u8> (+1), writeFileSync/appendFileSync(path, bytes), and the
2497
2544
  * fs/promises readFile(path) no-encoding form (an already-settled
2498
2545
  * promise, rejecting on failure like the other fsp members). The sync
2499
- * pair THROWS catchably on failure exactly like the utf8 forms. */
2500
- | "fs.readFileSyncBytes" | "fs.writeFileSyncBytes" | "fsp.readFileBytes"
2546
+ * forms THROW catchably on failure exactly like the utf8 forms. */
2547
+ | "fs.readFileSyncBytes" | "fs.writeFileSyncBytes" | "fs.appendFileSyncBytes" | "fsp.readFileBytes"
2501
2548
  /** node:zlib (scr_zlib.c — native-toolchain.ts compiles/links it ONLY when these
2502
2549
  * appear on the IR, the regex/libcurl gating precedent): one-shot zlib,
2503
2550
  * raw-DEFLATE, gzip, and auto-detect codecs over u8 bytes with Node's
2504
- * default options. Compression never throws (OOM aborts); decompression
2551
+ * default options, or a validated literal compression level from -1 to 9.
2552
+ * Compression never throws (OOM aborts); decompression
2505
2553
  * of corrupt input THROWS Node's error catchably. */
2506
- | "zlib.deflateSync" | "zlib.inflateSync" | "zlib.deflateRawSync" | "zlib.inflateRawSync" | "zlib.gzipSync" | "zlib.gunzipSync" | "zlib.unzipSync"
2554
+ | "zlib.deflateSync" | "zlib.inflateSync" | "zlib.deflateRawSync"
2555
+ /** bytes, mode (0 zlib / 1 raw / 2 gzip), validated compression level. */
2556
+ | "zlib.deflateLevelSync" | "zlib.inflateRawSync" | "zlib.gzipSync" | "zlib.gunzipSync" | "zlib.unzipSync"
2507
2557
  /** The default-options callback twins run on the executable's shared
2508
2558
  * native work pool and deliver (Error | null, Buffer) on a later loop
2509
2559
  * turn. crc32 validates its optional uint32 seed synchronously. */
@@ -2570,6 +2620,9 @@ export type IrLibFn =
2570
2620
  * "x64") — Node's answer for its own build on the same machine.
2571
2621
  * Interned; +1 per read. Never throws. */
2572
2622
  | "process.arch"
2623
+ /** Stable native version dictionary. node/openssl identify compatibility
2624
+ * targets; components absent from the native runtime are omitted. */
2625
+ | "process.versions" | "process.builtinId" | "process.builtinModule" | "process.builtinUnsupported" | "process.hrtimeValue"
2573
2626
  /** process.versions.node: the runtime's Node COMPATIBILITY TARGET —
2574
2627
  * there is no Node under the binary, so this reports the version whose
2575
2628
  * semantics the runtime implements (SEMANTICS.md divergence 60, the
@@ -2598,6 +2651,8 @@ export type IrLibFn =
2598
2651
  /** realpath(3) with Node's error shape (syscall "lstat" in the message,
2599
2652
  * Node's own spelling for realpathSync failures). +1 fresh string. */
2600
2653
  | "fs.realpathSync"
2654
+ /** Native realpath with syscall "realpath" on failure. +1 fresh string. */
2655
+ | "fs.realpathNativeSync"
2601
2656
  /** kill(2) with Node's exact semantics and error shapes: the pid must be
2602
2657
  * an int32 (else the ERR_INVALID_ARG_TYPE TypeError text), the named
2603
2658
  * form resolves Node's signal-name table (unknown names throw the
@@ -2628,7 +2683,7 @@ export type IrLibFn =
2628
2683
  * shares console.log's stream, each call is submitted promptly, and
2629
2684
  * interleaved output keeps source order. No newline, no formatting,
2630
2685
  * never throws. */
2631
- | "process.stdoutWrite" | "process.stderrWrite" | "timers.setTimeout"
2686
+ | "process.stdoutWrite" | "process.stderrWrite" | "process.stdio" | "timers.setTimeout"
2632
2687
  /** The repeating timer pair. setInterval takes (callback, ms) like
2633
2688
  * setTimeout and RETURNS the f64 handle the fallback declarations
2634
2689
  * promise (ids start at 1, so truthiness narrowing works); the loop
@@ -2699,14 +2754,10 @@ export type IrLibFn =
2699
2754
  | "process.uptime"
2700
2755
  /** perf_hooks performance.now(): fractional ms since process start. */
2701
2756
  | "perf.now" | "process.availableMemory" | "process.constrainedMemory" | "process.cpuUser" | "process.cpuSystem" | "process.cpuUserDiff" | "process.cpuSystemDiff" | "process.threadCpuUser" | "process.threadCpuSystem" | "process.threadCpuUserDiff" | "process.threadCpuSystemDiff" | "process.cpuPrevValidate" | "process.rusage" | "process.activeResources"
2702
- /** Process signal events — process.on/once/off("SIGINT" | "SIGTERM").
2703
- * args: [signo f64 (the frontend bakes the POSIX number), cb, once
2704
- * bool] for on; [signo, cb] for off (cb borrowed, removed by pointer
2705
- * identity — Node's removeListener contract). Handlers run as
2706
- * macrotasks at loop turns; watching replaces the default disposition
2707
- * and removing the last listener restores it; signal listeners never
2708
- * keep the loop alive (Node). Zero-param callbacks only (the ambient
2709
- * shape). Never throw. */
2757
+ /** Named process signal events: [name string, callback dyn, once bool]
2758
+ * or [name, callback] for removal. The runtime resolves platform signal
2759
+ * numbers and delivers (name, number). Listeners do not keep the loop
2760
+ * alive. Invalid callbacks and uncatchable signals throw. */
2710
2761
  | "process.onSignal" | "process.offSignal"
2711
2762
  /** The process 'exit' event — process.on/once/off("exit"). args: [cb,
2712
2763
  * once bool] / [cb]. Listeners run SYNCHRONOUSLY at termination
@@ -2740,6 +2791,15 @@ export type IrLibFn =
2740
2791
  * field to stamp. error.toString: borrowed `%Error`-typed receiver, +1
2741
2792
  * string in Node's "name: message" shape. None of the three throws. */
2742
2793
  | "error.new"
2794
+ /** ECMAScript constructors with raw checked-dynamic message/options.
2795
+ * Options retain cause presence; constructor calls borrow their args.
2796
+ * Message coercion may throw before the cause is installed. */
2797
+ | "error.newOptions" | "error.ctorOptions"
2798
+ /** Borrowed Error receiver. cause returns an owned dyn value (undefined
2799
+ * when absent); hasCause distinguishes absence from present undefined. */
2800
+ | "error.cause" | "error.hasCause"
2801
+ /** Assignment borrows both operands and retains the new cause. */
2802
+ | "error.setCause" | "error.deleteCause"
2743
2803
  /** The compiler-resolved Node-parity throw for always-throwing lowered
2744
2804
  * arms (ERR_INVALID_THIS receivers, ERR_MISSING_ARGS arity ladders,
2745
2805
  * the symbol-to-string TypeError): args are [error-kind f64 (the
@@ -2753,24 +2813,26 @@ export type IrLibFn =
2753
2813
  * exhaustion throws "Cannot convert object to primitive value"; units
2754
2814
  * render "null"/"undefined") — the WHATWG USVString conversions
2755
2815
  * (URLSearchParams names/values). Borrowed dyn; +1 string. May-throw. */
2756
- | "dyn.toStringCoerce"
2816
+ | "dyn.toStringCoerce" | "dyn.stringConstructor" | "dyn.propertyKey" | "dyn.toNumeric" | "dyn.increment"
2757
2817
  /** JS ToNumber over a dyn value WITH the object protocol (number-hint
2758
2818
  * valueOf/toString ordering; user throws propagate). Borrowed dyn;
2759
2819
  * f64 result, or a throw. Used by statically lowered numeric coercions
2760
2820
  * whose checker type remained any. */
2761
- | "dyn.toNumberCoerce"
2821
+ | "dyn.numberConstructor" | "dyn.toNumberCoerce" | "dyn.add" | "dyn.arithmetic" | "dyn.bitwise" | "dyn.proxyNew"
2762
2822
  /** A read of a `declare`d const NOTHING defines (the bundler-define
2763
2823
  * pattern — __VERSION__): always throws the catchable ReferenceError
2764
2824
  * Node raises at the access ("<name> is not defined"). args[0] is the
2765
2825
  * name; the result type is the read's declared type (a typed dummy the
2766
2826
  * unwind abandons — the value never exists). */
2767
2827
  | "global.undefRead"
2828
+ /** A native reference to the global object; known names retain value fences. */
2829
+ | "global.native" | "console.native"
2768
2830
  /** `X.name` through a class VALUE (scr_object.c): args[0] is a borrowed
2769
2831
  * classval; the result is the class object's stored .name string,
2770
2832
  * retained (+1 — the string is an interned immortal, so the retain is a
2771
2833
  * no-op, kept for ownership uniformity). Never throws. A direct
2772
2834
  * `C.name` on the class name itself folds to a strLit instead. */
2773
- | "class.name" | "error.ctor" | "error.toString"
2835
+ | "class.name" | "error.ctor" | "error.toString" | "error.stack" | "error.stackLimitGet" | "error.stackLimitSet"
2774
2836
  /** `new DOMException(message?, nameOrOptions?)` (scr_error.c): both args
2775
2837
  * are borrowed dyn values (the lowering passes the dyn undefined for an
2776
2838
  * absent argument, so WebIDL's optionality lives in one place). The
@@ -2813,7 +2875,7 @@ export type IrLibFn =
2813
2875
  * JS). Strings/arrays/bytes answer their index keys; other scalars an
2814
2876
  * empty array; null/undefined throw Node's catchable TypeError
2815
2877
  * ("Cannot convert undefined or null to object"). */
2816
- | "dyn.objKeys" | "dyn.hasOwn" | "dyn.assign"
2878
+ | "dyn.objKeys" | "dyn.forInKeys" | "dyn.hasOwn" | "dyn.propertyIsEnumerable" | "dyn.assign" | "dyn.copyDataProperties"
2817
2879
  /** Variadic Object.assign over CHECKED-DYNAMIC targets (`Object.assign(
2818
2880
  * {}, ...arr.map(f), tail)` — the option-table merge): the lowering
2819
2881
  * builds one fresh dyn pack of sources (packPush retains a plain source
@@ -2838,7 +2900,7 @@ export type IrLibFn =
2838
2900
  * that SEE the prototype: inspect's "[Object: null prototype]" prefix
2839
2901
  * and deepStrictEqual's prototype gate. Never throws. Static builds
2840
2902
  * only; --dynamic routes Object.create through the engine instead. */
2841
- | "dyn.objCreateNullProto" | "dyn.objValues" | "dyn.objEntries"
2903
+ | "dyn.objCreateNullProto" | "dyn.arrayPrototype" | "dyn.classPrototype" | "dyn.classBasePrototype" | "dyn.classSuper" | "dyn.assignPrototype" | "dyn.objCreate" | "dyn.objCreateWithProperties" | "dyn.getPrototype" | "dyn.setPrototype" | "dyn.getOwnPropertyNames" | "dyn.getOwnPropertySymbols" | "dyn.getOwnPropertyDescriptors" | "dyn.preventExtensions" | "dyn.isExtensible" | "dyn.seal" | "dyn.isSealed" | "dyn.objValues" | "dyn.objEntries"
2842
2904
  /** structuredClone over the checked-dynamic tree (scr_json.c): the JSON-safe subset plus
2843
2905
  * bytes (a fresh copy — a Buffer clones as a plain Uint8Array, like
2844
2906
  * Node), deep. Functions and handle kinds throw the spec's catchable
@@ -2859,7 +2921,7 @@ export type IrLibFn =
2859
2921
  * strings (the lowering completes an absent flags to ""); result +1.
2860
2922
  * The result TYPE is the regex kind, so the link switch pulls the
2861
2923
  * engine exactly like a literal. */
2862
- | "regex.new"
2924
+ | "regex.new" | "regex.newChecked"
2863
2925
  /** structuredClone with a NON-EMPTY transfer array of static values:
2864
2926
  * nothing static is transferable, so the call always throws Node's
2865
2927
  * catchable DataCloneError ("Found invalid value in transferList.") —
@@ -2885,7 +2947,7 @@ export type IrLibFn =
2885
2947
  * the had-listeners bool. emitter.emitError: emit('error', err) —
2886
2948
  * throws err when unhandled. count/countFn/names/listeners/getMax/
2887
2949
  * setMax/setDefaultMax/getDefaultMax are the introspection surface. */
2888
- | "emitter.new" | "emitter.ctor" | "emitter.on" | "emitter.off" | "emitter.checkListener" | "emitter.onDyn" | "emitter.onFlex" | "emitter.offDyn" | "emitter.removeAll" | "emitter.emit" | "emitter.emitFlex" | "emitter.emitError" | "emitter.count" | "emitter.countFn" | "emitter.names" | "emitter.listeners" | "emitter.setMax" | "emitter.getMax"
2950
+ | "emitter.new" | "emitter.ctor" | "emitter.on" | "emitter.off" | "emitter.checkListener" | "emitter.onDyn" | "emitter.onFlex" | "emitter.offDyn" | "emitter.removeAll" | "emitter.emit" | "emitter.emitFlex" | "emitter.emitError" | "emitter.count" | "emitter.countFn" | "emitter.countDyn" | "emitter.names" | "emitter.listeners" | "emitter.setMax" | "emitter.getMax"
2889
2951
  /** Stream-'data' registration twins of emitter.on/onDyn (same args):
2890
2952
  * chosen at registration sites whose receiver is stream-rooted, so the
2891
2953
  * backend emits DATA thunks — the runtime's 'data' emission carries
@@ -3179,7 +3241,8 @@ export type IrLibFn =
3179
3241
  * Node's once); off/removeListener remove by closure identity, the
3180
3242
  * offWarning stance. Throws Node's ERR_INVALID_ARG_TYPE on a
3181
3243
  * non-function. */
3182
- | "process.onUnhandledRejection" | "process.offUnhandledRejection"
3244
+ /** Uncaught exception handlers and monitors: [callback dyn, once, monitor]. */
3245
+ | "process.onUncaughtException" | "process.offUncaughtException" | "process.onUnhandledRejection" | "process.offUnhandledRejection"
3183
3246
  /** process.on/once/off('rejectionHandled', fn): the sibling registry.
3184
3247
  * A handler attached after unhandledRejection delivery fires the event
3185
3248
  * once. Dispatch is synchronous at the attach, with the promise,
@@ -3265,6 +3328,9 @@ export type IrLibFn =
3265
3328
  * from UTF-16 code units. Adjacent surrogate pairs combine; lone
3266
3329
  * surrogates follow the runtime's replacement policy. */
3267
3330
  | "string.fromCharCode"
3331
+ /** Numeric code points, with catchable RangeError for non-integers or
3332
+ * values outside 0..0x10ffff. Uses the same UTF-8 surrogate policy. */
3333
+ | "string.fromCodePoint"
3268
3334
  /** lastIndexOf returns the last UTF-16 start index, or -1. The two-arg
3269
3335
  * form searches at or before its numeric position; NaN starts at the end.
3270
3336
  * String arguments are borrowed and neither form throws. */
@@ -3279,10 +3345,9 @@ export type IrLibFn =
3279
3345
  /** WHATWG TextDecoder.decode over u8 bytes (scr_bytes.c): utf-8 with
3280
3346
  * default options — the same maximal-subpart replacement decode as
3281
3347
  * Buffer.toString("utf8"), with the leading BOM stripped (the one
3282
- * behavioral difference; ignoreBOM defaults to false). The composed
3283
- * `new TextDecoder().decode(bytes)` form and its same-scope const
3284
- * store-then-call twin lower — decoder values still have no general
3285
- * representation. TextEncoder.encode needs no libFn: its matching forms
3348
+ * behavioral difference; ignoreBOM defaults to false). Inline calls
3349
+ * lower directly; stored decoder records dispatch by encoding id.
3350
+ * TextEncoder.encode needs no libFn: its matching forms
3286
3351
  * lower to buffer.fromStr(s, "utf8") (identical bytes — ScrStr storage
3287
3352
  * is well-formed UTF-8). Borrowed arg; owned (+1) string; never throws. */
3288
3353
  | "text.decode"
@@ -3446,8 +3511,7 @@ export type IrExpr =
3446
3511
  /** Numeric operands; comparisons yield bool. `===`/`!==` additionally
3447
3512
  * accept two same-typed arrays: reference identity (pointer compare),
3448
3513
  * matching JS object equality — and two same-typed CLASS VALUES, where
3449
- * the pointer compare IS class identity (one immortal object per
3450
- * class). */
3514
+ * the pointer compare IS class identity. */
3451
3515
  | {
3452
3516
  kind: "bin";
3453
3517
  op: IrNumBinOp;
@@ -3629,11 +3693,11 @@ export type IrExpr =
3629
3693
  loc: SrcLoc;
3630
3694
  }
3631
3695
  /** Optional chaining `a?.b` / `a?.m(...)` / `f?.()` / `a?.[i]` — the
3632
- * `nullish` test inverted: `receiver` is a unit-armed union with exactly
3633
- * ONE non-unit arm, evaluated exactly once; when its runtime tag is a
3696
+ * `nullish` test inverted: `receiver` is a unit-armed union with at least
3697
+ * one non-unit arm, evaluated exactly once; when its runtime tag is a
3634
3698
  * unit arm the result is the interned undefined arm of `type` (JS-exact:
3635
3699
  * a null receiver still yields undefined) and `body` never evaluates —
3636
- * argument side effects included. Otherwise the narrowed receiver binds
3700
+ * argument side effects included. Otherwise the receiver binds
3637
3701
  * to `id` (read via chainRecv inside `body`, +1 per read for ref kinds)
3638
3702
  * and `body` produces the result: `type` when non-void (an
3639
3703
  * undefined-armed union; the frontend pre-wraps the member value into
@@ -3648,7 +3712,9 @@ export type IrExpr =
3648
3712
  loc: SrcLoc;
3649
3713
  }
3650
3714
  /** The narrowed receiver inside an enclosing optChain's `body`, by the
3651
- * chain's `id` — typed as the union's single non-unit arm; each read is
3715
+ * chain's `id` — typed as the single non-unit arm when there is one,
3716
+ * or as the original union when there are several (the body can retag
3717
+ * it to the present sub-union). Each read is
3652
3718
  * +1 for ref kinds (a borrowed bind temp backs it). Valid nowhere else
3653
3719
  * (validated against the active-chain stack). */
3654
3720
  | {
@@ -3818,14 +3884,17 @@ export type IrExpr =
3818
3884
  * truncate; a negative/huge result THROWS Node's "Invalid typed array
3819
3885
  * length" RangeError catchably — backends' may-throw analyses seed on
3820
3886
  * bytesNew with a non-bytes, non-array source).
3821
- * - bytes (same elem — frontend-fenced) — an independent COPY. Never
3822
- * throws.
3887
+ * - bytes — an independent, element-coerced COPY. Never throws.
3823
3888
  * - array of f64 — a per-element-coerced copy (ToUint8/ToUint32/float).
3824
3889
  * Never throws.
3890
+ * - dyn — checked native input; can throw on invalid lengths/coercion.
3891
+ * `from` selects TypedArray.from's iterable/array-like semantics instead
3892
+ * of constructor length coercion (notably for strings and numbers).
3825
3893
  * The source is BORROWED; the result is owned (+1). */
3826
3894
  | {
3827
3895
  kind: "bytesNew";
3828
3896
  source: IrExpr | null;
3897
+ from?: true;
3829
3898
  type: IrType;
3830
3899
  loc: SrcLoc;
3831
3900
  }
@@ -3951,10 +4020,13 @@ export type IrExpr =
3951
4020
  }
3952
4021
  /** Indirect call of a func-typed value. Args follow `call`'s convention
3953
4022
  * (callee owns its params, callers pass +1). The callee expression is an
3954
- * ordinary owned temp, released at statement end. */
4023
+ * ordinary owned temp, released at statement end. receiver supplies the
4024
+ * call-time this value; absence means undefined. Evaluate callee, receiver,
4025
+ * then args, and restore the ambient receiver before unwinding. */
3955
4026
  | {
3956
4027
  kind: "callValue";
3957
4028
  callee: IrExpr;
4029
+ receiver?: IrExpr;
3958
4030
  args: IrExpr[];
3959
4031
  type: IrType;
3960
4032
  loc: SrcLoc;
@@ -3983,6 +4055,9 @@ export type IrExpr =
3983
4055
  kind: "yieldExpr";
3984
4056
  value: IrExpr | null;
3985
4057
  awaited?: true;
4058
+ captureCompletion?: {
4059
+ returnType: IrType;
4060
+ };
3986
4061
  type: IrType;
3987
4062
  loc: SrcLoc;
3988
4063
  }
@@ -4066,16 +4141,16 @@ export type IrExpr =
4066
4141
  type: IrType;
4067
4142
  loc: SrcLoc;
4068
4143
  }
4069
- /** The class itself as a value: a pointer to `className`'s immortal
4070
- * class object (type `classval:className`, +1 — a no-op retain on the
4071
- * immortal, kept for the uniform owned-temp discipline, the regexLit
4072
- * pattern). The frontend notes an edge to `%className.constructor` at
4144
+ /** The class itself as an owned value. `captures` creates fresh identity
4145
+ * and retains the named boxes; absent captures use an immortal template.
4146
+ * The frontend notes an edge to `%className.constructor` at
4073
4147
  * every classRef, so a value's construct thunk always has a constructor
4074
4148
  * to call; backends emit class objects (and thunks) for exactly the
4075
4149
  * classes some classRef in the module names. */
4076
4150
  | {
4077
4151
  kind: "classRef";
4078
4152
  className: string;
4153
+ captures?: string[];
4079
4154
  type: IrType;
4080
4155
  loc: SrcLoc;
4081
4156
  }
@@ -4341,6 +4416,7 @@ export type IrExpr =
4341
4416
  | {
4342
4417
  kind: "dynCall";
4343
4418
  callee: IrExpr;
4419
+ receiver?: IrExpr;
4344
4420
  calleeName: string;
4345
4421
  args: IrExpr[];
4346
4422
  spreads?: {
@@ -4381,10 +4457,8 @@ export type IrExpr =
4381
4457
  type: IrType;
4382
4458
  loc: SrcLoc;
4383
4459
  }
4384
- /** A dyn OBJECT built member-by-member. With no `fields` it is the empty
4385
- * object (the JS stand-in for opaque container values — `new WeakMap()`
4386
- * in harness code: the value exists for identity; every reached METHOD
4387
- * use meets its own fence). With `fields` it is a JS object literal whose
4460
+ /** A dyn OBJECT built member-by-member. With no `fields` it is an empty
4461
+ * object. With `fields` it is a JS object literal whose
4388
4462
  * keys are RUNTIME values (the computed-key idiom `{ [field]: criteria,
4389
4463
  * actual: 0 }` in test/common's _mustCallInner): each entry's key is a
4390
4464
  * string-typed expression (identifier/string keys lower to strLits;
@@ -4407,9 +4481,9 @@ export type IrExpr =
4407
4481
  * control flow understands on `unknown`: `typeof v === "string" |
4408
4482
  * "number" | "boolean" | "undefined"` and the unit comparisons `v ===
4409
4483
  * undefined` / `v === null` (`"nullish"` is the LOOSE `v == null` pair —
4410
- * undefined or null in one test), and `v instanceof Uint8Array`
4411
- * (`"bytes"` — the checked-dynamic tree's bytes kind; Node's Buffer IS a Uint8Array
4412
- * subclass and both worlds answer true for it, SEMANTICS.md 45), plus
4484
+ * undefined or null in one test), and `v instanceof TypedArray`
4485
+ * (`"bytes"` plus bytesElem, default u8; Node's Buffer is a Uint8Array
4486
+ * subclass), plus
4413
4487
  * the two object-family tests: `"object"` is `typeof v === "object"`
4414
4488
  * exactly (true for the checked-dynamic tree's object, array, bytes, AND null kinds —
4415
4489
  * JS's oldest wart preserved), `"array"` is `Array.isArray(v)` (the
@@ -4433,7 +4507,8 @@ export type IrExpr =
4433
4507
  * `"object"` test, JS-exact. */
4434
4508
  | {
4435
4509
  kind: "dynTest";
4436
- test: "string" | "number" | "boolean" | "undefined" | "null" | "nullish" | "bytes" | "object" | "array" | "truthy" | "error" | "function";
4510
+ test: "promise" | "bigint" | "symbol" | "string" | "number" | "boolean" | "undefined" | "null" | "nullish" | "bytes" | "buffer" | "object" | "array" | "truthy" | "error" | "function";
4511
+ bytesElem?: IrBytesElem;
4437
4512
  negated?: true;
4438
4513
  value: IrExpr;
4439
4514
  type: IrType;
@@ -4501,13 +4576,16 @@ export type IrExpr =
4501
4576
  * forms whose statement lowering needs temps and writes (destructuring
4502
4577
  * assignments in value position, keyed dyn writes yielding the RHS).
4503
4578
  * `type` IS result's type. Restricted on purpose: stmts must be
4504
- * straight-line (varDecl/assign/exprStmt/field-and-record writes — no
4505
- * control flow, no jumps; the validator enforces the subset), and any
4506
- * varDecl-introduced local is a function local like every hidden temp. */
4579
+ * local statements (including blocks, branches, and loops, but no jumps;
4580
+ * the validator enforces the subset). Hidden locals retain function-wide
4581
+ * ids, but their owned values live through the enclosing expression's
4582
+ * frame: later call arguments may reuse a saved operand. Release them
4583
+ * on the same path that initialized them, not an outer lexical scope. */
4507
4584
  | {
4508
4585
  kind: "seqExpr";
4509
4586
  stmts: IrStmt[];
4510
4587
  result: IrExpr;
4588
+ generatorDelegate?: true;
4511
4589
  type: IrType;
4512
4590
  loc: SrcLoc;
4513
4591
  }
@@ -4560,6 +4638,18 @@ export type IrExpr =
4560
4638
  type: IrType;
4561
4639
  loc: SrcLoc;
4562
4640
  }
4641
+ /** Own-key presence in an index-signature record's overflow map. Unlike
4642
+ * a keyed read, this distinguishes a missing key from a stored undefined
4643
+ * value. Declared fields are handled separately by the lowering. Both
4644
+ * operands are borrowed, the key is string, the result is bool. */
4645
+ | {
4646
+ kind: "recordOvfHas";
4647
+ obj: IrExpr;
4648
+ shapeId: string;
4649
+ key: IrExpr;
4650
+ type: IrType;
4651
+ loc: SrcLoc;
4652
+ }
4563
4653
  /** Union construction: wrap an arm value into a fresh tagged box (the
4564
4654
  * frontend inserts these wherever a `B` flows into an `A | B` slot).
4565
4655
  * `tag` is the arm's index in the union's canonical arm list; `value` has
@@ -4807,6 +4897,7 @@ export type IrExpr =
4807
4897
  | {
4808
4898
  kind: "jsonStringify";
4809
4899
  value: IrExpr;
4900
+ indent?: string;
4810
4901
  type: IrType;
4811
4902
  loc: SrcLoc;
4812
4903
  }
@@ -4998,6 +5089,12 @@ export declare function isJsonSafeType(t: IrType, getRecord: (shapeId: string) =
4998
5089
  * root remains outside the domain because JSON.stringify returns the
4999
5090
  * undefined value instead of a string. */
5000
5091
  export declare function isJsonStringifySafeType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
5092
+ /** A JSON-shaped container with unknown payloads needs the runtime JSON
5093
+ * traversal. Its declared structure can be boxed, but payloads may carry
5094
+ * omitted values, toJSON methods, or cycles. This predicate does not widen
5095
+ * the type-directed serializer, checked-island boundary, or root-undefined
5096
+ * contract; callers must select the checked runtime traversal explicitly. */
5097
+ export declare function isJsonStringifyDynamicType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
5001
5098
  /** THE island boundary predicate: true when a static type can cross into
5002
5099
  * the island (jsMarshal — primitives by value, composites as deep JSON
5003
5100
  * copies) and back out (jsExit — strict primitive extraction, composites
@@ -5019,7 +5116,8 @@ export declare const MAX_ISLAND_CALLBACK_ARITY = 16;
5019
5116
  export declare function canMarshalFuncIntoIsland(t: IrType): boolean;
5020
5117
  /** Parameter types a TYPED closure may declare when it crosses INTO the
5021
5118
  * island as a host function: jsval params take the engine argument as a
5022
- * handle (the all-'any' shape above); every other admitted type converts
5119
+ * handle (the all-'any' shape above); dyn params normalize scalars or retain
5120
+ * engine objects by reference. Every other admitted type converts
5023
5121
  * AT CALL TIME through the validated-exit machinery — strict primitives,
5024
5122
  * JSON round-trip composites (the dynCheck walker: width-tolerant records,
5025
5123
  * path-annotated failures). On top of the jsExit set, a bare `T | undefined`
@@ -5045,8 +5143,8 @@ export declare function islandCallbackRet(t: IrType, getRecord: (shapeId: string
5045
5143
  * closures whose params are per-argument-convertible at call time
5046
5144
  * (isIslandCallbackParamType) and whose return classifies
5047
5145
  * (islandCallbackRet). Same arity cap — the runtime's host-call argument
5048
- * buffer. Closures taking closures and 'unknown'-typed params stay fenced
5049
- * (no per-type extraction exists for them inside a host call). */
5146
+ * buffer. Statically typed closure parameters stay fenced; unknown values
5147
+ * enter as checked-dynamic values and are validated at each typed use. */
5050
5148
  export declare function canMarshalTypedFuncIntoIsland(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
5051
5149
  /** The runtime HANDLE kinds that cross the checked-dynamic boundary as
5052
5150
  * the checked-dynamic tree's HANDLE kind (SCR_DYN_HANDLE): boxed by REFERENCE (identity —
@@ -5074,13 +5172,22 @@ export declare function isDynTypedRefType(t: IrType): t is Extract<IrType, {
5074
5172
  * layout; TypeScript `private`/`protected` fields keep ordinary names and are
5075
5173
  * observable properties at runtime. */
5076
5174
  export declare function isClassOwnEnumerableFieldName(name: string): boolean;
5175
+ /** Compiler-owned storage for properties added through untyped references. */
5176
+ export declare const DYN_CLASS_PROPERTIES = "%dynProperties";
5177
+ /** A class capsule can always preserve its exact native identity. Its
5178
+ * optional property view additionally needs converters in both directions;
5179
+ * fields such as Maps may remain opaque without preventing the round trip. */
5180
+ export declare function classDynViewSupported(fields: readonly {
5181
+ name: string;
5182
+ type: IrType;
5183
+ }[], getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
5077
5184
  /** A static type that CONVERTS into a dyn value — the dynFrom domain:
5078
- * JSON-safe data, bytes<u8> (payload copied), identity-preserving class
5185
+ * JSON-safe data, numeric typed arrays (retained views), identity-preserving class
5079
5186
  * references, undefined-armed unions of those arms, boxable function types,
5080
5187
  * and the runtime HANDLE kinds (boxed by reference — DYN_HANDLE_KINDS). */
5081
5188
  export declare function canConvertToDyn(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
5082
5189
  /** A type a dyn value can be VALIDATED into — the dynCheck domain:
5083
- * JSON-safe data, bytes<u8> (a fresh copy out), the %Error extraction,
5190
+ * JSON-safe data, numeric typed arrays (retained views), the %Error extraction,
5084
5191
  * undefined-armed unions of JSON-safe arms, adaptable function types,
5085
5192
  * and the runtime HANDLE kinds (a tag-checked reference unwrap —
5086
5193
  * DYN_HANDLE_KINDS). */
@@ -5115,12 +5222,44 @@ export declare function canMarshalIntoIsland(t: IrType, getRecord: (shapeId: str
5115
5222
  * Promise.all arm). Null = outside the domain (the boundary fence). */
5116
5223
  export declare function islandPromisePayloadTag(inner: IrType): "void" | "f64" | "bool" | "string" | "jsval" | "jsvalArr" | null;
5117
5224
  export declare function canExitIslandToType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
5225
+ export interface RuntimeFeatures {
5226
+ regex: boolean;
5227
+ copying: boolean;
5228
+ legacyTextDecoder: boolean;
5229
+ fileHandle: boolean;
5230
+ fetch: boolean;
5231
+ processEvents: boolean;
5232
+ emitter: boolean;
5233
+ stream: boolean;
5234
+ zlib: boolean;
5235
+ dc: boolean;
5236
+ assert: boolean;
5237
+ dynInvoke: boolean;
5238
+ dynAsync: boolean;
5239
+ inspect: boolean;
5240
+ childProcess: boolean;
5241
+ net: boolean;
5242
+ symbol: boolean;
5243
+ bigint: boolean;
5244
+ searchParams: boolean;
5245
+ qs: boolean;
5246
+ parseArgs: boolean;
5247
+ fsWatch: boolean;
5248
+ nodeTest: boolean;
5249
+ dgram: boolean;
5250
+ http: boolean;
5251
+ http2: boolean;
5252
+ tls: boolean;
5253
+ tlsCa: boolean;
5254
+ }
5255
+ /** Inspect types and expressions together in one traversal. This is a fresh
5256
+ * snapshot: callers may mutate an IR module between compilation passes. */
5257
+ export declare function moduleRuntimeFeatures(mod: IrModule): RuntimeFeatures;
5118
5258
  /** True when the module contains any regex construct — a regexLit /
5119
5259
  * regexIntrinsic node or a regex-typed slot anywhere. This is the link
5120
5260
  * switch that pulls scr_regex.c + the vendored libregexp into the binary
5121
- * (native-toolchain.ts); regex-free programs keep the historical command line. A generic
5122
- * JSON walk: `kind` discriminants live only on IR objects, so user string
5123
- * VALUES can never false-positive. */
5261
+ * (native-toolchain.ts); regex-free programs keep the historical command line. The
5262
+ * typed traversal visits type slots as well as executable nodes. */
5124
5263
  export declare function moduleUsesRegex(mod: IrModule): boolean;
5125
5264
  /** True when the module contains an intrinsic whose implementation lives
5126
5265
  * in scr_copying.c. This is the link switch that keeps the optional
@@ -5171,7 +5310,7 @@ export declare function moduleUsesStream(mod: IrModule): boolean;
5171
5310
  * the first; the emitted main installs it before any island entry). */
5172
5311
  export declare function moduleEmbedsBuiltin(mod: IrModule, builtin: string): boolean;
5173
5312
  /** Embedded module texts at least this long are DEFLATE-compressed into
5174
- * the emitted C (island.ts; each stays plain when deflate does not
5313
+ * the emitted LLVM (island.ts; each stays plain when deflate does not
5175
5314
  * shrink it) and inflated lazily by the island's module loader at first
5176
5315
  * load. Below it the zlib round trip cannot pay for itself. */
5177
5316
  export declare const NPM_COMPRESS_MIN = 1024;
@@ -5305,8 +5444,8 @@ export declare function moduleUsesTls(mod: IrModule): boolean;
5305
5444
  export declare function moduleUsesTlsCa(mod: IrModule): boolean;
5306
5445
  /** First async/event-loop/ambient-process surface the module graph
5307
5446
  * reaches, or null when the graph is async_free (the v1 library requirement).
5308
- * The generic-walk shape of moduleUsesRegex, tracking the nearest
5309
- * enclosing `loc` so the refusal anchors at the reaching construct; the
5447
+ * Typed slots use their declaration location and executable nodes use their
5448
+ * own location, so the refusal anchors at the reaching construct; the
5310
5449
  * coarse moduleUses* predicates are the safety net behind the fine-grained
5311
5450
  * table (a surface reached only through a spelling the table misses still
5312
5451
  * refuses, anchored at the entry). */