@scriptc/compiler 0.2.4 → 0.2.5

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 (1104) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +915 -215
  2. package/ambient/scriptc-overrides.d.ts +5 -1
  3. package/ambient/scriptc.d.ts +22 -2
  4. package/dist/backend/build-cache.d.ts +4 -0
  5. package/dist/backend/build-cache.js +16 -2
  6. package/dist/backend/build-cache.js.map +1 -1
  7. package/dist/backend/cycle-analysis.js +17 -5
  8. package/dist/backend/cycle-analysis.js.map +1 -1
  9. package/dist/backend/cycle-analysis.test.js +50 -11
  10. package/dist/backend/cycle-analysis.test.js.map +1 -1
  11. package/dist/backend/debug-symbols.js.map +1 -1
  12. package/dist/backend/executable-features.js +2 -1
  13. package/dist/backend/executable-features.js.map +1 -1
  14. package/dist/backend/external-c.d.ts +13 -6
  15. package/dist/backend/external-c.js +15 -3
  16. package/dist/backend/external-c.js.map +1 -1
  17. package/dist/backend/ffi-callbacks.js +6 -9
  18. package/dist/backend/ffi-callbacks.js.map +1 -1
  19. package/dist/backend/library-identity-markers.js.map +1 -1
  20. package/dist/backend/library-pack.d.ts +1 -1
  21. package/dist/backend/library-pack.js +81 -24
  22. package/dist/backend/library-pack.js.map +1 -1
  23. package/dist/backend/link-plan-core.js +9 -2
  24. package/dist/backend/link-plan-core.js.map +1 -1
  25. package/dist/backend/link-plan.d.ts +1 -1
  26. package/dist/backend/link-plan.js +4 -5
  27. package/dist/backend/link-plan.js.map +1 -1
  28. package/dist/backend/linker.d.ts +1 -1
  29. package/dist/backend/linker.js +42 -23
  30. package/dist/backend/linker.js.map +1 -1
  31. package/dist/backend/literals.js +5 -4
  32. package/dist/backend/literals.js.map +1 -1
  33. package/dist/backend/literals.test.js +30 -5
  34. package/dist/backend/literals.test.js.map +1 -1
  35. package/dist/backend/llvm/blocks.test.js +5 -2
  36. package/dist/backend/llvm/blocks.test.js.map +1 -1
  37. package/dist/backend/llvm/borrowed-inputs.js.map +1 -1
  38. package/dist/backend/llvm/borrowed-receivers.js +43 -19
  39. package/dist/backend/llvm/borrowed-receivers.js.map +1 -1
  40. package/dist/backend/llvm/byte-numbers.js +6 -1
  41. package/dist/backend/llvm/byte-numbers.js.map +1 -1
  42. package/dist/backend/llvm/bytes-bounds.js +73 -22
  43. package/dist/backend/llvm/bytes-bounds.js.map +1 -1
  44. package/dist/backend/llvm/call-lifetimes.d.ts +3 -0
  45. package/dist/backend/llvm/call-lifetimes.js +60 -17
  46. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  47. package/dist/backend/llvm/call-lifetimes.test.js +159 -28
  48. package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
  49. package/dist/backend/llvm/checked-value-lifetimes.d.ts +4 -0
  50. package/dist/backend/llvm/checked-value-lifetimes.js +14 -4
  51. package/dist/backend/llvm/checked-value-lifetimes.js.map +1 -1
  52. package/dist/backend/llvm/classes.js +16 -12
  53. package/dist/backend/llvm/classes.js.map +1 -1
  54. package/dist/backend/llvm/common.js +4 -1
  55. package/dist/backend/llvm/common.js.map +1 -1
  56. package/dist/backend/llvm/counted-loops.js +10 -3
  57. package/dist/backend/llvm/counted-loops.js.map +1 -1
  58. package/dist/backend/llvm/debug-info.js +33 -13
  59. package/dist/backend/llvm/debug-info.js.map +1 -1
  60. package/dist/backend/llvm/debug-info.test.js +28 -6
  61. package/dist/backend/llvm/debug-info.test.js.map +1 -1
  62. package/dist/backend/llvm/dyn.js +68 -22
  63. package/dist/backend/llvm/dyn.js.map +1 -1
  64. package/dist/backend/llvm/emitter.d.ts +9 -3
  65. package/dist/backend/llvm/emitter.js +238 -105
  66. package/dist/backend/llvm/emitter.js.map +1 -1
  67. package/dist/backend/llvm/emitter.test.js +233 -42
  68. package/dist/backend/llvm/emitter.test.js.map +1 -1
  69. package/dist/backend/llvm/expr-async.js +25 -6
  70. package/dist/backend/llvm/expr-async.js.map +1 -1
  71. package/dist/backend/llvm/expr-bytes.js +13 -4
  72. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  73. package/dist/backend/llvm/expr-callbacks.js +10 -4
  74. package/dist/backend/llvm/expr-callbacks.js.map +1 -1
  75. package/dist/backend/llvm/expr-calls.js +20 -9
  76. package/dist/backend/llvm/expr-calls.js.map +1 -1
  77. package/dist/backend/llvm/expr-containers.d.ts +2 -0
  78. package/dist/backend/llvm/expr-containers.js +92 -33
  79. package/dist/backend/llvm/expr-containers.js.map +1 -1
  80. package/dist/backend/llvm/expr-control.js +1 -3
  81. package/dist/backend/llvm/expr-control.js.map +1 -1
  82. package/dist/backend/llvm/expr-dispatch.js +3 -1
  83. package/dist/backend/llvm/expr-dispatch.js.map +1 -1
  84. package/dist/backend/llvm/expr-dynamic.js +19 -4
  85. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  86. package/dist/backend/llvm/expr-island.js +26 -6
  87. package/dist/backend/llvm/expr-island.js.map +1 -1
  88. package/dist/backend/llvm/expr-primitives.js +88 -19
  89. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  90. package/dist/backend/llvm/expr-primitives.test.js +43 -1
  91. package/dist/backend/llvm/expr-primitives.test.js.map +1 -1
  92. package/dist/backend/llvm/expr-records.js +10 -9
  93. package/dist/backend/llvm/expr-records.js.map +1 -1
  94. package/dist/backend/llvm/expr-stream-bridges.js +44 -26
  95. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  96. package/dist/backend/llvm/expr-stream-bridges.test.js +51 -14
  97. package/dist/backend/llvm/expr-stream-bridges.test.js.map +1 -1
  98. package/dist/backend/llvm/expr-stream-callbacks.js +34 -14
  99. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
  100. package/dist/backend/llvm/integer-values.js +15 -4
  101. package/dist/backend/llvm/integer-values.js.map +1 -1
  102. package/dist/backend/llvm/integer-views.js +23 -7
  103. package/dist/backend/llvm/integer-views.js.map +1 -1
  104. package/dist/backend/llvm/integer-views.test.js +42 -7
  105. package/dist/backend/llvm/integer-views.test.js.map +1 -1
  106. package/dist/backend/llvm/lib-abi.js +13 -4
  107. package/dist/backend/llvm/lib-abi.js.map +1 -1
  108. package/dist/backend/llvm/lib-connect.js +7 -1
  109. package/dist/backend/llvm/lib-connect.js.map +1 -1
  110. package/dist/backend/llvm/lib-datagram.js +35 -10
  111. package/dist/backend/llvm/lib-datagram.js.map +1 -1
  112. package/dist/backend/llvm/lib-dispatch.js +35 -16
  113. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  114. package/dist/backend/llvm/lib-filesystem.js +33 -18
  115. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  116. package/dist/backend/llvm/lib-http2.js +60 -15
  117. package/dist/backend/llvm/lib-http2.js.map +1 -1
  118. package/dist/backend/llvm/lib-lookup.js +12 -5
  119. package/dist/backend/llvm/lib-lookup.js.map +1 -1
  120. package/dist/backend/llvm/lib-network.js +97 -31
  121. package/dist/backend/llvm/lib-network.js.map +1 -1
  122. package/dist/backend/llvm/lib-process.js +57 -14
  123. package/dist/backend/llvm/lib-process.js.map +1 -1
  124. package/dist/backend/llvm/lib-shared.js +107 -31
  125. package/dist/backend/llvm/lib-shared.js.map +1 -1
  126. package/dist/backend/llvm/lib-stream.js +33 -14
  127. package/dist/backend/llvm/lib-stream.js.map +1 -1
  128. package/dist/backend/llvm/lib-test.js +21 -7
  129. package/dist/backend/llvm/lib-test.js.map +1 -1
  130. package/dist/backend/llvm/lib-tls.js +69 -20
  131. package/dist/backend/llvm/lib-tls.js.map +1 -1
  132. package/dist/backend/llvm/local-array-reads.d.ts +1 -0
  133. package/dist/backend/llvm/local-array-reads.js +96 -30
  134. package/dist/backend/llvm/local-array-reads.js.map +1 -1
  135. package/dist/backend/llvm/local-array-reads.test.js +368 -60
  136. package/dist/backend/llvm/local-array-reads.test.js.map +1 -1
  137. package/dist/backend/llvm/local-union-storage.d.ts +25 -0
  138. package/dist/backend/llvm/local-union-storage.js +109 -0
  139. package/dist/backend/llvm/local-union-storage.js.map +1 -0
  140. package/dist/backend/llvm/local-union-storage.test.d.ts +1 -0
  141. package/dist/backend/llvm/local-union-storage.test.js +210 -0
  142. package/dist/backend/llvm/local-union-storage.test.js.map +1 -0
  143. package/dist/backend/llvm/map-read-lifetimes.d.ts +6 -2
  144. package/dist/backend/llvm/map-read-lifetimes.js +44 -14
  145. package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
  146. package/dist/backend/llvm/map-read-lifetimes.test.js +89 -17
  147. package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
  148. package/dist/backend/llvm/reference-effects.d.ts +3 -2
  149. package/dist/backend/llvm/reference-effects.js +67 -36
  150. package/dist/backend/llvm/reference-effects.js.map +1 -1
  151. package/dist/backend/llvm/reference-effects.test.js +92 -9
  152. package/dist/backend/llvm/reference-effects.test.js.map +1 -1
  153. package/dist/backend/llvm/shapes.js +60 -17
  154. package/dist/backend/llvm/shapes.js.map +1 -1
  155. package/dist/backend/llvm/shapes.test.js +3 -1
  156. package/dist/backend/llvm/shapes.test.js.map +1 -1
  157. package/dist/backend/llvm/split.js +4 -4
  158. package/dist/backend/llvm/split.js.map +1 -1
  159. package/dist/backend/llvm/split.test.js +14 -6
  160. package/dist/backend/llvm/split.test.js.map +1 -1
  161. package/dist/backend/llvm/stack-unions.js +14 -5
  162. package/dist/backend/llvm/stack-unions.js.map +1 -1
  163. package/dist/backend/llvm/stack-unions.test.js +151 -32
  164. package/dist/backend/llvm/stack-unions.test.js.map +1 -1
  165. package/dist/backend/llvm/string-construction.js.map +1 -1
  166. package/dist/backend/llvm/string-construction.test.js +32 -7
  167. package/dist/backend/llvm/string-construction.test.js.map +1 -1
  168. package/dist/backend/llvm/string-lifetimes.js +14 -8
  169. package/dist/backend/llvm/string-lifetimes.js.map +1 -1
  170. package/dist/backend/llvm/string-lifetimes.test.js +112 -26
  171. package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
  172. package/dist/backend/llvm/switch-dispatch.d.ts +9 -0
  173. package/dist/backend/llvm/switch-dispatch.js +114 -0
  174. package/dist/backend/llvm/switch-dispatch.js.map +1 -0
  175. package/dist/backend/llvm/switch-dispatch.test.d.ts +1 -0
  176. package/dist/backend/llvm/switch-dispatch.test.js +83 -0
  177. package/dist/backend/llvm/switch-dispatch.test.js.map +1 -0
  178. package/dist/backend/llvm/unsupported.js.map +1 -1
  179. package/dist/backend/llvm/walkers.js +6 -3
  180. package/dist/backend/llvm/walkers.js.map +1 -1
  181. package/dist/backend/mangle.js +9 -3
  182. package/dist/backend/mangle.js.map +1 -1
  183. package/dist/backend/may-throw.js +18 -8
  184. package/dist/backend/may-throw.js.map +1 -1
  185. package/dist/backend/may-throw.test.js +118 -22
  186. package/dist/backend/may-throw.test.js.map +1 -1
  187. package/dist/backend/native/artifact-stamps.d.ts +39 -0
  188. package/dist/backend/native/artifact-stamps.js +371 -0
  189. package/dist/backend/native/artifact-stamps.js.map +1 -0
  190. package/dist/backend/native/cache-warm.d.ts +24 -0
  191. package/dist/backend/native/cache-warm.js +80 -0
  192. package/dist/backend/native/cache-warm.js.map +1 -0
  193. package/dist/backend/native/compiler-fingerprint.d.ts +19 -0
  194. package/dist/backend/native/compiler-fingerprint.js +357 -0
  195. package/dist/backend/native/compiler-fingerprint.js.map +1 -0
  196. package/dist/backend/native/contracts.d.ts +314 -0
  197. package/dist/backend/native/contracts.js +2 -0
  198. package/dist/backend/native/contracts.js.map +1 -0
  199. package/dist/backend/native/dependency-files.d.ts +5 -0
  200. package/dist/backend/native/dependency-files.js +83 -0
  201. package/dist/backend/native/dependency-files.js.map +1 -0
  202. package/dist/backend/native/driver.d.ts +50 -0
  203. package/dist/backend/native/driver.js +294 -0
  204. package/dist/backend/native/driver.js.map +1 -0
  205. package/dist/backend/native/executable.d.ts +18 -0
  206. package/dist/backend/native/executable.js +1267 -0
  207. package/dist/backend/native/executable.js.map +1 -0
  208. package/dist/backend/native/library.d.ts +2 -0
  209. package/dist/backend/native/library.js +614 -0
  210. package/dist/backend/native/library.js.map +1 -0
  211. package/dist/backend/native/linker-fingerprint.d.ts +8 -0
  212. package/dist/backend/native/linker-fingerprint.js +174 -0
  213. package/dist/backend/native/linker-fingerprint.js.map +1 -0
  214. package/dist/backend/native/object-merge.d.ts +2 -0
  215. package/dist/backend/native/object-merge.js +154 -0
  216. package/dist/backend/native/object-merge.js.map +1 -0
  217. package/dist/backend/native/process.d.ts +17 -0
  218. package/dist/backend/native/process.js +42 -0
  219. package/dist/backend/native/process.js.map +1 -0
  220. package/dist/backend/native/program-shards.d.ts +21 -0
  221. package/dist/backend/native/program-shards.js +99 -0
  222. package/dist/backend/native/program-shards.js.map +1 -0
  223. package/dist/backend/native/runtime-inputs.d.ts +12 -0
  224. package/dist/backend/native/runtime-inputs.js +163 -0
  225. package/dist/backend/native/runtime-inputs.js.map +1 -0
  226. package/dist/backend/native/runtime-inputs.test.d.ts +1 -0
  227. package/dist/backend/native/runtime-inputs.test.js +64 -0
  228. package/dist/backend/native/runtime-inputs.test.js.map +1 -0
  229. package/dist/backend/native/runtime-objects.d.ts +16 -0
  230. package/dist/backend/native/runtime-objects.js +122 -0
  231. package/dist/backend/native/runtime-objects.js.map +1 -0
  232. package/dist/backend/native/session.d.ts +12 -0
  233. package/dist/backend/native/session.js +31 -0
  234. package/dist/backend/native/session.js.map +1 -0
  235. package/dist/backend/native/tool-identity.d.ts +37 -0
  236. package/dist/backend/native/tool-identity.js +310 -0
  237. package/dist/backend/native/tool-identity.js.map +1 -0
  238. package/dist/backend/native/trace-paths.d.ts +12 -0
  239. package/dist/backend/native/trace-paths.js +73 -0
  240. package/dist/backend/native/trace-paths.js.map +1 -0
  241. package/dist/backend/native/vendor.d.ts +1 -0
  242. package/dist/backend/native/vendor.js +12 -0
  243. package/dist/backend/native/vendor.js.map +1 -0
  244. package/dist/backend/native-codegen-core.js +2 -1
  245. package/dist/backend/native-codegen-core.js.map +1 -1
  246. package/dist/backend/native-codegen.d.ts +1 -1
  247. package/dist/backend/native-codegen.js +24 -13
  248. package/dist/backend/native-codegen.js.map +1 -1
  249. package/dist/backend/native-codegen.test.js +12 -9
  250. package/dist/backend/native-codegen.test.js.map +1 -1
  251. package/dist/backend/native-link-info-core.js +9 -5
  252. package/dist/backend/native-link-info-core.js.map +1 -1
  253. package/dist/backend/native-link-info.js +14 -5
  254. package/dist/backend/native-link-info.js.map +1 -1
  255. package/dist/backend/native-link-info.test.js +58 -13
  256. package/dist/backend/native-link-info.test.js.map +1 -1
  257. package/dist/backend/native-toolchain.d.ts +17 -450
  258. package/dist/backend/native-toolchain.js +17 -3971
  259. package/dist/backend/native-toolchain.js.map +1 -1
  260. package/dist/backend/native-toolchain.test.js +103 -72
  261. package/dist/backend/native-toolchain.test.js.map +1 -1
  262. package/dist/backend/native-tools.js +27 -8
  263. package/dist/backend/native-tools.js.map +1 -1
  264. package/dist/backend/object-localize.js +17 -14
  265. package/dist/backend/object-localize.js.map +1 -1
  266. package/dist/backend/object-localize.test.js +59 -12
  267. package/dist/backend/object-localize.test.js.map +1 -1
  268. package/dist/backend/runtime-pack-core.js +96 -49
  269. package/dist/backend/runtime-pack-core.js.map +1 -1
  270. package/dist/backend/runtime-pack-native.js +5 -3
  271. package/dist/backend/runtime-pack-native.js.map +1 -1
  272. package/dist/backend/runtime-pack-targets.test.js +87 -15
  273. package/dist/backend/runtime-pack-targets.test.js.map +1 -1
  274. package/dist/backend/runtime-pack.d.ts +1 -1
  275. package/dist/backend/runtime-pack.js +11 -12
  276. package/dist/backend/runtime-pack.js.map +1 -1
  277. package/dist/backend/runtime-pack.test.js +40 -24
  278. package/dist/backend/runtime-pack.test.js.map +1 -1
  279. package/dist/backend/source-locations.js.map +1 -1
  280. package/dist/backend/source-locations.test.js +7 -2
  281. package/dist/backend/source-locations.test.js.map +1 -1
  282. package/dist/backend/target-diagnostics.js +44 -14
  283. package/dist/backend/target-diagnostics.js.map +1 -1
  284. package/dist/backend/target-diagnostics.test.js +93 -20
  285. package/dist/backend/target-diagnostics.test.js.map +1 -1
  286. package/dist/backend/targets.js +230 -86
  287. package/dist/backend/targets.js.map +1 -1
  288. package/dist/backend/targets.test.js +32 -18
  289. package/dist/backend/targets.test.js.map +1 -1
  290. package/dist/backend/toolchain-environment.js +5 -1
  291. package/dist/backend/toolchain-environment.js.map +1 -1
  292. package/dist/backend/vendor-archives.d.ts +2 -2
  293. package/dist/backend/vendor-archives.js +84 -35
  294. package/dist/backend/vendor-archives.js.map +1 -1
  295. package/dist/backend/vendor-inputs.js +13 -1
  296. package/dist/backend/vendor-inputs.js.map +1 -1
  297. package/dist/backend/warm-cache.d.ts +1 -1
  298. package/dist/backend/warm-cache.js +33 -9
  299. package/dist/backend/warm-cache.js.map +1 -1
  300. package/dist/cli/command.js +39 -9
  301. package/dist/cli/command.js.map +1 -1
  302. package/dist/cli/output-options.js +14 -4
  303. package/dist/cli/output-options.js.map +1 -1
  304. package/dist/cli/paths.js.map +1 -1
  305. package/dist/cli/wasi-runner.js.map +1 -1
  306. package/dist/compat/fetch-profile.js +36 -35
  307. package/dist/compat/fetch-profile.js.map +1 -1
  308. package/dist/coverage/report.js +16 -17
  309. package/dist/coverage/report.js.map +1 -1
  310. package/dist/coverage/surface-manifest.js +112 -26
  311. package/dist/coverage/surface-manifest.js.map +1 -1
  312. package/dist/diagnostics/diagnostic.js +55 -16
  313. package/dist/diagnostics/diagnostic.js.map +1 -1
  314. package/dist/executable/executable-cache.d.ts +1 -1
  315. package/dist/executable/executable-cache.js +78 -48
  316. package/dist/executable/executable-cache.js.map +1 -1
  317. package/dist/executable/executable-cache.test.js +75 -26
  318. package/dist/executable/executable-cache.test.js.map +1 -1
  319. package/dist/executable/prepare.js +2 -2
  320. package/dist/executable/prepare.js.map +1 -1
  321. package/dist/ffi/ffi-manifest.js +78 -20
  322. package/dist/ffi/ffi-manifest.js.map +1 -1
  323. package/dist/ffi/ffi-manifest.test.js +96 -16
  324. package/dist/ffi/ffi-manifest.test.js.map +1 -1
  325. package/dist/format-integer.js.map +1 -1
  326. package/dist/frontend/analysis.js +12 -2
  327. package/dist/frontend/analysis.js.map +1 -1
  328. package/dist/frontend/arguments-usage.js.map +1 -1
  329. package/dist/frontend/binding-source.js +9 -3
  330. package/dist/frontend/binding-source.js.map +1 -1
  331. package/dist/frontend/builtin-modules.js +46 -2
  332. package/dist/frontend/builtin-modules.js.map +1 -1
  333. package/dist/frontend/cjs-resolve.js +40 -17
  334. package/dist/frontend/cjs-resolve.js.map +1 -1
  335. package/dist/frontend/cjs-syntax.js +31 -10
  336. package/dist/frontend/cjs-syntax.js.map +1 -1
  337. package/dist/frontend/comptime-node.test.js +10 -11
  338. package/dist/frontend/comptime-node.test.js.map +1 -1
  339. package/dist/frontend/dts-paths.js +7 -3
  340. package/dist/frontend/dts-paths.js.map +1 -1
  341. package/dist/frontend/fork-target.js +17 -12
  342. package/dist/frontend/fork-target.js.map +1 -1
  343. package/dist/frontend/function-completion.js +11 -6
  344. package/dist/frontend/function-completion.js.map +1 -1
  345. package/dist/frontend/helper-tokens.js +53 -6
  346. package/dist/frontend/helper-tokens.js.map +1 -1
  347. package/dist/frontend/helper-tokens.test.js +18 -2
  348. package/dist/frontend/helper-tokens.test.js.map +1 -1
  349. package/dist/frontend/inferred-js-diagnostics.js +32 -12
  350. package/dist/frontend/inferred-js-diagnostics.js.map +1 -1
  351. package/dist/frontend/inferred-js-diagnostics.test.js +11 -15
  352. package/dist/frontend/inferred-js-diagnostics.test.js.map +1 -1
  353. package/dist/frontend/input-tracker.js +11 -11
  354. package/dist/frontend/input-tracker.js.map +1 -1
  355. package/dist/frontend/input-tracker.test.js +4 -1
  356. package/dist/frontend/input-tracker.test.js.map +1 -1
  357. package/dist/frontend/lib-contract.js +38 -9
  358. package/dist/frontend/lib-contract.js.map +1 -1
  359. package/dist/frontend/literal-values.js.map +1 -1
  360. package/dist/frontend/literal-values.test.js +28 -8
  361. package/dist/frontend/literal-values.test.js.map +1 -1
  362. package/dist/frontend/lowering/abstract-equality.js +53 -10
  363. package/dist/frontend/lowering/abstract-equality.js.map +1 -1
  364. package/dist/frontend/lowering/array-indexed-mutation.d.ts +1 -1
  365. package/dist/frontend/lowering/array-indexed-mutation.js +108 -106
  366. package/dist/frontend/lowering/array-indexed-mutation.js.map +1 -1
  367. package/dist/frontend/lowering/array-values.js +37 -14
  368. package/dist/frontend/lowering/array-values.js.map +1 -1
  369. package/dist/frontend/lowering/binding-analysis.d.ts +50 -0
  370. package/dist/frontend/lowering/binding-analysis.js +376 -0
  371. package/dist/frontend/lowering/binding-analysis.js.map +1 -0
  372. package/dist/frontend/lowering/builtin-calls.d.ts +9 -0
  373. package/dist/frontend/lowering/builtin-calls.js +60 -0
  374. package/dist/frontend/lowering/builtin-calls.js.map +1 -0
  375. package/dist/frontend/lowering/builtins/arguments.d.ts +43 -0
  376. package/dist/frontend/lowering/builtins/arguments.js +247 -0
  377. package/dist/frontend/lowering/builtins/arguments.js.map +1 -0
  378. package/dist/frontend/lowering/builtins/async-context.d.ts +52 -0
  379. package/dist/frontend/lowering/builtins/async-context.js +436 -0
  380. package/dist/frontend/lowering/builtins/async-context.js.map +1 -0
  381. package/dist/frontend/lowering/builtins/atomics.d.ts +15 -0
  382. package/dist/frontend/lowering/builtins/atomics.js +46 -0
  383. package/dist/frontend/lowering/builtins/atomics.js.map +1 -0
  384. package/dist/frontend/lowering/builtins/callable-aliases.d.ts +13 -0
  385. package/dist/frontend/lowering/builtins/callable-aliases.js +87 -0
  386. package/dist/frontend/lowering/builtins/callable-aliases.js.map +1 -0
  387. package/dist/frontend/lowering/builtins/child-process-async.d.ts +18 -0
  388. package/dist/frontend/lowering/builtins/child-process-async.js +245 -0
  389. package/dist/frontend/lowering/builtins/child-process-async.js.map +1 -0
  390. package/dist/frontend/lowering/builtins/child-process-methods.d.ts +21 -0
  391. package/dist/frontend/lowering/builtins/child-process-methods.js +362 -0
  392. package/dist/frontend/lowering/builtins/child-process-methods.js.map +1 -0
  393. package/dist/frontend/lowering/builtins/child-process-sync.d.ts +4 -0
  394. package/dist/frontend/lowering/builtins/child-process-sync.js +639 -0
  395. package/dist/frontend/lowering/builtins/child-process-sync.js.map +1 -0
  396. package/dist/frontend/lowering/builtins/child-process.d.ts +55 -0
  397. package/dist/frontend/lowering/builtins/child-process.js +669 -0
  398. package/dist/frontend/lowering/builtins/child-process.js.map +1 -0
  399. package/dist/frontend/lowering/builtins/compression.d.ts +7 -0
  400. package/dist/frontend/lowering/builtins/compression.js +115 -0
  401. package/dist/frontend/lowering/builtins/compression.js.map +1 -0
  402. package/dist/frontend/lowering/builtins/console.d.ts +10 -0
  403. package/dist/frontend/lowering/builtins/console.js +38 -0
  404. package/dist/frontend/lowering/builtins/console.js.map +1 -0
  405. package/dist/frontend/lowering/builtins/constants.d.ts +24 -0
  406. package/dist/frontend/lowering/builtins/constants.js +141 -0
  407. package/dist/frontend/lowering/builtins/constants.js.map +1 -0
  408. package/dist/frontend/lowering/builtins/crypto.d.ts +22 -0
  409. package/dist/frontend/lowering/builtins/crypto.js +517 -0
  410. package/dist/frontend/lowering/builtins/crypto.js.map +1 -0
  411. package/dist/frontend/lowering/builtins/dates.d.ts +7 -0
  412. package/dist/frontend/lowering/builtins/dates.js +101 -0
  413. package/dist/frontend/lowering/builtins/dates.js.map +1 -0
  414. package/dist/frontend/lowering/builtins/environment.d.ts +34 -0
  415. package/dist/frontend/lowering/builtins/environment.js +95 -0
  416. package/dist/frontend/lowering/builtins/environment.js.map +1 -0
  417. package/dist/frontend/lowering/builtins/errors.d.ts +14 -0
  418. package/dist/frontend/lowering/builtins/errors.js +83 -0
  419. package/dist/frontend/lowering/builtins/errors.js.map +1 -0
  420. package/dist/frontend/lowering/builtins/filesystem-calls.d.ts +32 -0
  421. package/dist/frontend/lowering/builtins/filesystem-calls.js +678 -0
  422. package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -0
  423. package/dist/frontend/lowering/builtins/filesystem.d.ts +108 -0
  424. package/dist/frontend/lowering/builtins/filesystem.js +1061 -0
  425. package/dist/frontend/lowering/builtins/filesystem.js.map +1 -0
  426. package/dist/frontend/lowering/builtins/ipc.d.ts +8 -0
  427. package/dist/frontend/lowering/builtins/ipc.js +76 -0
  428. package/dist/frontend/lowering/builtins/ipc.js.map +1 -0
  429. package/dist/frontend/lowering/builtins/json.d.ts +12 -0
  430. package/dist/frontend/lowering/builtins/json.js +387 -0
  431. package/dist/frontend/lowering/builtins/json.js.map +1 -0
  432. package/dist/frontend/lowering/builtins/module-bindings.d.ts +85 -0
  433. package/dist/frontend/lowering/builtins/module-bindings.js +346 -0
  434. package/dist/frontend/lowering/builtins/module-bindings.js.map +1 -0
  435. package/dist/frontend/lowering/builtins/module-calls.d.ts +8 -0
  436. package/dist/frontend/lowering/builtins/module-calls.js +303 -0
  437. package/dist/frontend/lowering/builtins/module-calls.js.map +1 -0
  438. package/dist/frontend/lowering/builtins/module-resolution.d.ts +38 -0
  439. package/dist/frontend/lowering/builtins/module-resolution.js +344 -0
  440. package/dist/frontend/lowering/builtins/module-resolution.js.map +1 -0
  441. package/dist/frontend/lowering/builtins/numbers.d.ts +15 -0
  442. package/dist/frontend/lowering/builtins/numbers.js +124 -0
  443. package/dist/frontend/lowering/builtins/numbers.js.map +1 -0
  444. package/dist/frontend/lowering/builtins/operating-system.d.ts +13 -0
  445. package/dist/frontend/lowering/builtins/operating-system.js +148 -0
  446. package/dist/frontend/lowering/builtins/operating-system.js.map +1 -0
  447. package/dist/frontend/lowering/builtins/performance.d.ts +13 -0
  448. package/dist/frontend/lowering/builtins/performance.js +100 -0
  449. package/dist/frontend/lowering/builtins/performance.js.map +1 -0
  450. package/dist/frontend/lowering/builtins/process.d.ts +50 -0
  451. package/dist/frontend/lowering/builtins/process.js +1138 -0
  452. package/dist/frontend/lowering/builtins/process.js.map +1 -0
  453. package/dist/frontend/lowering/builtins/promises.d.ts +14 -0
  454. package/dist/frontend/lowering/builtins/promises.js +356 -0
  455. package/dist/frontend/lowering/builtins/promises.js.map +1 -0
  456. package/dist/frontend/lowering/builtins/properties.d.ts +11 -0
  457. package/dist/frontend/lowering/builtins/properties.js +186 -0
  458. package/dist/frontend/lowering/builtins/properties.js.map +1 -0
  459. package/dist/frontend/lowering/builtins/querystring.d.ts +19 -0
  460. package/dist/frontend/lowering/builtins/querystring.js +150 -0
  461. package/dist/frontend/lowering/builtins/querystring.js.map +1 -0
  462. package/dist/frontend/lowering/builtins/readline.d.ts +13 -0
  463. package/dist/frontend/lowering/builtins/readline.js +138 -0
  464. package/dist/frontend/lowering/builtins/readline.js.map +1 -0
  465. package/dist/frontend/lowering/builtins/receiver-types.d.ts +5 -0
  466. package/dist/frontend/lowering/builtins/receiver-types.js +15 -0
  467. package/dist/frontend/lowering/builtins/receiver-types.js.map +1 -0
  468. package/dist/frontend/lowering/builtins/reflection.d.ts +13 -0
  469. package/dist/frontend/lowering/builtins/reflection.js +95 -0
  470. package/dist/frontend/lowering/builtins/reflection.js.map +1 -0
  471. package/dist/frontend/lowering/builtins/strings.d.ts +14 -0
  472. package/dist/frontend/lowering/builtins/strings.js +121 -0
  473. package/dist/frontend/lowering/builtins/strings.js.map +1 -0
  474. package/dist/frontend/lowering/builtins/text-codecs.d.ts +29 -0
  475. package/dist/frontend/lowering/builtins/text-codecs.js +590 -0
  476. package/dist/frontend/lowering/builtins/text-codecs.js.map +1 -0
  477. package/dist/frontend/lowering/builtins/timers.d.ts +22 -0
  478. package/dist/frontend/lowering/builtins/timers.js +180 -0
  479. package/dist/frontend/lowering/builtins/timers.js.map +1 -0
  480. package/dist/frontend/lowering/builtins/url.d.ts +37 -0
  481. package/dist/frontend/lowering/builtins/url.js +596 -0
  482. package/dist/frontend/lowering/builtins/url.js.map +1 -0
  483. package/dist/frontend/lowering/builtins/util-types.d.ts +7 -0
  484. package/dist/frontend/lowering/builtins/util-types.js +31 -0
  485. package/dist/frontend/lowering/builtins/util-types.js.map +1 -0
  486. package/dist/frontend/lowering/call-arguments.d.ts +72 -0
  487. package/dist/frontend/lowering/call-arguments.js +618 -0
  488. package/dist/frontend/lowering/call-arguments.js.map +1 -0
  489. package/dist/frontend/lowering/call-signatures.d.ts +115 -0
  490. package/dist/frontend/lowering/call-signatures.js +719 -0
  491. package/dist/frontend/lowering/call-signatures.js.map +1 -0
  492. package/dist/frontend/lowering/callback-arg.js.map +1 -1
  493. package/dist/frontend/lowering/checked-iterable-spread.js +53 -10
  494. package/dist/frontend/lowering/checked-iterable-spread.js.map +1 -1
  495. package/dist/frontend/lowering/checked-promise-all.js +41 -9
  496. package/dist/frontend/lowering/checked-promise-all.js.map +1 -1
  497. package/dist/frontend/lowering/class-callbacks.d.ts +1 -1
  498. package/dist/frontend/lowering/class-callbacks.js +130 -27
  499. package/dist/frontend/lowering/class-callbacks.js.map +1 -1
  500. package/dist/frontend/lowering/class-construction.d.ts +1 -1
  501. package/dist/frontend/lowering/class-construction.js +247 -50
  502. package/dist/frontend/lowering/class-construction.js.map +1 -1
  503. package/dist/frontend/lowering/class-descriptors.js +109 -29
  504. package/dist/frontend/lowering/class-descriptors.js.map +1 -1
  505. package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +6 -1
  506. package/dist/frontend/lowering/class-dynamic-dispatch.js +2471 -465
  507. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  508. package/dist/frontend/lowering/class-dynamic-dispatch.test.js +284 -44
  509. package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -1
  510. package/dist/frontend/lowering/class-instance-constructor.js +17 -5
  511. package/dist/frontend/lowering/class-instance-constructor.js.map +1 -1
  512. package/dist/frontend/lowering/class-method-values.js +199 -51
  513. package/dist/frontend/lowering/class-method-values.js.map +1 -1
  514. package/dist/frontend/lowering/class-prototypes.js +345 -86
  515. package/dist/frontend/lowering/class-prototypes.js.map +1 -1
  516. package/dist/frontend/lowering/class-runtime-statics.d.ts +1 -1
  517. package/dist/frontend/lowering/class-runtime-statics.js +80 -17
  518. package/dist/frontend/lowering/class-runtime-statics.js.map +1 -1
  519. package/dist/frontend/lowering/class-static-data.js +76 -16
  520. package/dist/frontend/lowering/class-static-data.js.map +1 -1
  521. package/dist/frontend/lowering/coercions/builders.d.ts +13 -0
  522. package/dist/frontend/lowering/coercions/builders.js +77 -0
  523. package/dist/frontend/lowering/coercions/builders.js.map +1 -0
  524. package/dist/frontend/lowering/coercions/function-adapters.d.ts +58 -0
  525. package/dist/frontend/lowering/coercions/function-adapters.js +430 -0
  526. package/dist/frontend/lowering/coercions/function-adapters.js.map +1 -0
  527. package/dist/frontend/lowering/coercions/island.d.ts +37 -0
  528. package/dist/frontend/lowering/coercions/island.js +350 -0
  529. package/dist/frontend/lowering/coercions/island.js.map +1 -0
  530. package/dist/frontend/lowering/coercions/state.d.ts +14 -0
  531. package/dist/frontend/lowering/coercions/state.js +16 -0
  532. package/dist/frontend/lowering/coercions/state.js.map +1 -0
  533. package/dist/frontend/lowering/coercions/structural-plans.d.ts +40 -0
  534. package/dist/frontend/lowering/coercions/structural-plans.js +447 -0
  535. package/dist/frontend/lowering/coercions/structural-plans.js.map +1 -0
  536. package/dist/frontend/lowering/coercions/structural.d.ts +63 -0
  537. package/dist/frontend/lowering/coercions/structural.js +616 -0
  538. package/dist/frontend/lowering/coercions/structural.js.map +1 -0
  539. package/dist/frontend/lowering/coercions/unions.d.ts +65 -0
  540. package/dist/frontend/lowering/coercions/unions.js +318 -0
  541. package/dist/frontend/lowering/coercions/unions.js.map +1 -0
  542. package/dist/frontend/lowering/collection-ingestion.js +355 -72
  543. package/dist/frontend/lowering/collection-ingestion.js.map +1 -1
  544. package/dist/frontend/lowering/containers/array-callbacks.d.ts +92 -0
  545. package/dist/frontend/lowering/containers/array-callbacks.js +1646 -0
  546. package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -0
  547. package/dist/frontend/lowering/containers/array-construction.d.ts +42 -0
  548. package/dist/frontend/lowering/containers/array-construction.js +1044 -0
  549. package/dist/frontend/lowering/containers/array-construction.js.map +1 -0
  550. package/dist/frontend/lowering/containers/array-iteration.d.ts +16 -0
  551. package/dist/frontend/lowering/containers/array-iteration.js +95 -0
  552. package/dist/frontend/lowering/containers/array-iteration.js.map +1 -0
  553. package/dist/frontend/lowering/containers/array-methods.d.ts +27 -0
  554. package/dist/frontend/lowering/containers/array-methods.js +1854 -0
  555. package/dist/frontend/lowering/containers/array-methods.js.map +1 -0
  556. package/dist/frontend/lowering/containers/bytes.d.ts +17 -17
  557. package/dist/frontend/lowering/containers/bytes.js +419 -105
  558. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  559. package/dist/frontend/lowering/containers/callback-arguments.d.ts +26 -0
  560. package/dist/frontend/lowering/containers/callback-arguments.js +179 -0
  561. package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -0
  562. package/dist/frontend/lowering/containers/collection-grouping.d.ts +19 -0
  563. package/dist/frontend/lowering/containers/collection-grouping.js +297 -0
  564. package/dist/frontend/lowering/containers/collection-grouping.js.map +1 -0
  565. package/dist/frontend/lowering/containers/collection-methods.d.ts +57 -0
  566. package/dist/frontend/lowering/containers/collection-methods.js +1314 -0
  567. package/dist/frontend/lowering/containers/collection-methods.js.map +1 -0
  568. package/dist/frontend/lowering/containers/dynamic-receivers.d.ts +18 -0
  569. package/dist/frontend/lowering/containers/dynamic-receivers.js +114 -0
  570. package/dist/frontend/lowering/containers/dynamic-receivers.js.map +1 -0
  571. package/dist/frontend/lowering/containers/for-of.d.ts +60 -0
  572. package/dist/frontend/lowering/containers/for-of.js +643 -0
  573. package/dist/frontend/lowering/containers/for-of.js.map +1 -0
  574. package/dist/frontend/lowering/containers/indexed-objects.d.ts +132 -0
  575. package/dist/frontend/lowering/containers/indexed-objects.js +1743 -0
  576. package/dist/frontend/lowering/containers/indexed-objects.js.map +1 -0
  577. package/dist/frontend/lowering/containers/iterator-helpers.d.ts +20 -0
  578. package/dist/frontend/lowering/containers/iterator-helpers.js +809 -0
  579. package/dist/frontend/lowering/containers/iterator-helpers.js.map +1 -0
  580. package/dist/frontend/lowering/containers/string-and-regexp.js +580 -158
  581. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  582. package/dist/frontend/lowering/containers/string-replacement.js +213 -63
  583. package/dist/frontend/lowering/containers/string-replacement.js.map +1 -1
  584. package/dist/frontend/lowering/crypto-tables.js +263 -64
  585. package/dist/frontend/lowering/crypto-tables.js.map +1 -1
  586. package/dist/frontend/lowering/deferred-module-initializers.js +172 -68
  587. package/dist/frontend/lowering/deferred-module-initializers.js.map +1 -1
  588. package/dist/frontend/lowering/deferred-module-initializers.test.js +41 -8
  589. package/dist/frontend/lowering/deferred-module-initializers.test.js.map +1 -1
  590. package/dist/frontend/lowering/error-methods.js +339 -65
  591. package/dist/frontend/lowering/error-methods.js.map +1 -1
  592. package/dist/frontend/lowering/expressions/evaluation-safety.js +3 -2
  593. package/dist/frontend/lowering/expressions/evaluation-safety.js.map +1 -1
  594. package/dist/frontend/lowering/expressions/global-symbols.js +2 -1
  595. package/dist/frontend/lowering/expressions/global-symbols.js.map +1 -1
  596. package/dist/frontend/lowering/expressions/native-proxy.js +11 -5
  597. package/dist/frontend/lowering/expressions/native-proxy.js.map +1 -1
  598. package/dist/frontend/lowering/expressions/nullish-assignment.js +67 -13
  599. package/dist/frontend/lowering/expressions/nullish-assignment.js.map +1 -1
  600. package/dist/frontend/lowering/expressions/object-literals.js +589 -162
  601. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  602. package/dist/frontend/lowering/expressions/optional-chains.d.ts +1 -1
  603. package/dist/frontend/lowering/expressions/optional-chains.js +68 -17
  604. package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
  605. package/dist/frontend/lowering/expressions/union-field-write.js +45 -18
  606. package/dist/frontend/lowering/expressions/union-field-write.js.map +1 -1
  607. package/dist/frontend/lowering/function-context.js +5 -1
  608. package/dist/frontend/lowering/function-context.js.map +1 -1
  609. package/dist/frontend/lowering/function-returns.d.ts +67 -0
  610. package/dist/frontend/lowering/function-returns.js +392 -0
  611. package/dist/frontend/lowering/function-returns.js.map +1 -0
  612. package/dist/frontend/lowering/generator-delegation.d.ts +1 -1
  613. package/dist/frontend/lowering/generator-delegation.js +171 -39
  614. package/dist/frontend/lowering/generator-delegation.js.map +1 -1
  615. package/dist/frontend/lowering/generator-dynamic-dispatch.d.ts +1 -1
  616. package/dist/frontend/lowering/generator-dynamic-dispatch.js +176 -36
  617. package/dist/frontend/lowering/generator-dynamic-dispatch.js.map +1 -1
  618. package/dist/frontend/lowering/generic-functions.d.ts +274 -0
  619. package/dist/frontend/lowering/generic-functions.js +1727 -0
  620. package/dist/frontend/lowering/generic-functions.js.map +1 -0
  621. package/dist/frontend/lowering/import-meta.d.ts +1 -1
  622. package/dist/frontend/lowering/import-meta.js +37 -14
  623. package/dist/frontend/lowering/import-meta.js.map +1 -1
  624. package/dist/frontend/lowering/indexed-comparison.js +6 -2
  625. package/dist/frontend/lowering/indexed-comparison.js.map +1 -1
  626. package/dist/frontend/lowering/iterator-consumption.d.ts +9 -0
  627. package/dist/frontend/lowering/iterator-consumption.js +91 -0
  628. package/dist/frontend/lowering/iterator-consumption.js.map +1 -0
  629. package/dist/frontend/lowering/lib-boundary.js +40 -17
  630. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  631. package/dist/frontend/lowering/lib-boundary.test.js +49 -11
  632. package/dist/frontend/lowering/lib-boundary.test.js.map +1 -1
  633. package/dist/frontend/lowering/lower-array-sort.d.ts +0 -19
  634. package/dist/frontend/lowering/lower-array-sort.js +331 -566
  635. package/dist/frontend/lowering/lower-array-sort.js.map +1 -1
  636. package/dist/frontend/lowering/lower-assert.js +248 -43
  637. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  638. package/dist/frontend/lowering/lower-async-iteration.js +71 -16
  639. package/dist/frontend/lowering/lower-async-iteration.js.map +1 -1
  640. package/dist/frontend/lowering/lower-builtin-values.js +420 -71
  641. package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
  642. package/dist/frontend/lowering/lower-calls.d.ts +39 -558
  643. package/dist/frontend/lowering/lower-calls.js +2593 -5667
  644. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  645. package/dist/frontend/lowering/lower-classes.d.ts +243 -242
  646. package/dist/frontend/lowering/lower-classes.js +1701 -724
  647. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  648. package/dist/frontend/lowering/lower-comptime.d.ts +35 -35
  649. package/dist/frontend/lowering/lower-comptime.js +39 -37
  650. package/dist/frontend/lowering/lower-comptime.js.map +1 -1
  651. package/dist/frontend/lowering/lower-dgram.js +59 -31
  652. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  653. package/dist/frontend/lowering/lower-enums.js +5 -2
  654. package/dist/frontend/lowering/lower-enums.js.map +1 -1
  655. package/dist/frontend/lowering/lower-event-emitter.js +322 -85
  656. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
  657. package/dist/frontend/lowering/lower-expando.js +19 -7
  658. package/dist/frontend/lowering/lower-expando.js.map +1 -1
  659. package/dist/frontend/lowering/lower-exprs.d.ts +194 -194
  660. package/dist/frontend/lowering/lower-exprs.js +3446 -1154
  661. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  662. package/dist/frontend/lowering/lower-functions.d.ts +23 -0
  663. package/dist/frontend/lowering/lower-functions.js +449 -0
  664. package/dist/frontend/lowering/lower-functions.js.map +1 -0
  665. package/dist/frontend/lowering/lower-generators.js +121 -32
  666. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  667. package/dist/frontend/lowering/lower-global-value.js +15 -4
  668. package/dist/frontend/lowering/lower-global-value.js.map +1 -1
  669. package/dist/frontend/lowering/lower-inspect.js +479 -89
  670. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  671. package/dist/frontend/lowering/lower-island.d.ts +79 -79
  672. package/dist/frontend/lowering/lower-island.js +365 -273
  673. package/dist/frontend/lowering/lower-island.js.map +1 -1
  674. package/dist/frontend/lowering/lower-island.test.js +7 -2
  675. package/dist/frontend/lowering/lower-island.test.js.map +1 -1
  676. package/dist/frontend/lowering/lower-mixins.js +17 -8
  677. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  678. package/dist/frontend/lowering/lower-modules.d.ts +94 -94
  679. package/dist/frontend/lowering/lower-modules.js +612 -321
  680. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  681. package/dist/frontend/lowering/lower-modules.test.js +91 -20
  682. package/dist/frontend/lowering/lower-modules.test.js.map +1 -1
  683. package/dist/frontend/lowering/lower-namespaces.js +25 -8
  684. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  685. package/dist/frontend/lowering/lower-node-module.js +115 -34
  686. package/dist/frontend/lowering/lower-node-module.js.map +1 -1
  687. package/dist/frontend/lowering/lower-server.js +1210 -290
  688. package/dist/frontend/lowering/lower-server.js.map +1 -1
  689. package/dist/frontend/lowering/lower-stmts.d.ts +148 -148
  690. package/dist/frontend/lowering/lower-stmts.js +2312 -984
  691. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  692. package/dist/frontend/lowering/lower-stmts.test.js +13 -5
  693. package/dist/frontend/lowering/lower-stmts.test.js.map +1 -1
  694. package/dist/frontend/lowering/lower-stream.js +362 -90
  695. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  696. package/dist/frontend/lowering/lower-system-errors.js +30 -8
  697. package/dist/frontend/lowering/lower-system-errors.js.map +1 -1
  698. package/dist/frontend/lowering/lower-test.js +40 -13
  699. package/dist/frontend/lowering/lower-test.js.map +1 -1
  700. package/dist/frontend/lowering/lower-timers.d.ts +31 -0
  701. package/dist/frontend/lowering/lower-timers.js +336 -0
  702. package/dist/frontend/lowering/lower-timers.js.map +1 -0
  703. package/dist/frontend/lowering/lower-url.d.ts +1 -1
  704. package/dist/frontend/lowering/lower-url.js +46 -13
  705. package/dist/frontend/lowering/lower-url.js.map +1 -1
  706. package/dist/frontend/lowering/lowerer.d.ts +21 -351
  707. package/dist/frontend/lowering/lowerer.js +1024 -2704
  708. package/dist/frontend/lowering/lowerer.js.map +1 -1
  709. package/dist/frontend/lowering/lowerer.test.js +85 -17
  710. package/dist/frontend/lowering/lowerer.test.js.map +1 -1
  711. package/dist/frontend/lowering/module-namespace-elements.js +43 -8
  712. package/dist/frontend/lowering/module-namespace-elements.js.map +1 -1
  713. package/dist/frontend/lowering/native-ffi.d.ts +21 -1
  714. package/dist/frontend/lowering/native-ffi.js +487 -18
  715. package/dist/frontend/lowering/native-ffi.js.map +1 -1
  716. package/dist/frontend/lowering/object-enumeration-receiver.js +55 -10
  717. package/dist/frontend/lowering/object-enumeration-receiver.js.map +1 -1
  718. package/dist/frontend/lowering/object-factory-new.d.ts +1 -1
  719. package/dist/frontend/lowering/object-factory-new.js +36 -11
  720. package/dist/frontend/lowering/object-factory-new.js.map +1 -1
  721. package/dist/frontend/lowering/optional-arguments.js +49 -20
  722. package/dist/frontend/lowering/optional-arguments.js.map +1 -1
  723. package/dist/frontend/lowering/pairs-snapshot.js +66 -14
  724. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -1
  725. package/dist/frontend/lowering/runtime-optional-locals.js +3 -1
  726. package/dist/frontend/lowering/runtime-optional-locals.js.map +1 -1
  727. package/dist/frontend/lowering/runtime-optional-locals.test.js.map +1 -1
  728. package/dist/frontend/lowering/sanitize-class-types.js +4 -1
  729. package/dist/frontend/lowering/sanitize-class-types.js.map +1 -1
  730. package/dist/frontend/lowering/sanitize-class-types.test.js +86 -18
  731. package/dist/frontend/lowering/sanitize-class-types.test.js.map +1 -1
  732. package/dist/frontend/lowering/static-this.js +13 -6
  733. package/dist/frontend/lowering/static-this.js.map +1 -1
  734. package/dist/frontend/lowering/string-index.js +32 -10
  735. package/dist/frontend/lowering/string-index.js.map +1 -1
  736. package/dist/frontend/lowering/surfaces.d.ts +42 -42
  737. package/dist/frontend/lowering/surfaces.js +1094 -249
  738. package/dist/frontend/lowering/surfaces.js.map +1 -1
  739. package/dist/frontend/lowering/symbol-fields.js +40 -15
  740. package/dist/frontend/lowering/symbol-fields.js.map +1 -1
  741. package/dist/frontend/lowering/symbol-methods.js.map +1 -1
  742. package/dist/frontend/lowering/text-decoder-encoding.js +236 -24
  743. package/dist/frontend/lowering/text-decoder-encoding.js.map +1 -1
  744. package/dist/frontend/lowering/text-decoder-encoding.test.js +84 -12
  745. package/dist/frontend/lowering/text-decoder-encoding.test.js.map +1 -1
  746. package/dist/frontend/lowering/union-narrow.js +59 -16
  747. package/dist/frontend/lowering/union-narrow.js.map +1 -1
  748. package/dist/frontend/lowering/union-narrow.test.js +24 -7
  749. package/dist/frontend/lowering/union-narrow.test.js.map +1 -1
  750. package/dist/frontend/lowering/union-retag.js +155 -40
  751. package/dist/frontend/lowering/union-retag.js.map +1 -1
  752. package/dist/frontend/lowering/union-retag.test.js +131 -33
  753. package/dist/frontend/lowering/union-retag.test.js.map +1 -1
  754. package/dist/frontend/lowering/unregistered-class-types.js.map +1 -1
  755. package/dist/frontend/lowering/unregistered-class-types.test.js +34 -8
  756. package/dist/frontend/lowering/unregistered-class-types.test.js.map +1 -1
  757. package/dist/frontend/module-syntax.js +21 -8
  758. package/dist/frontend/module-syntax.js.map +1 -1
  759. package/dist/frontend/module-syntax.test.js +37 -13
  760. package/dist/frontend/module-syntax.test.js.map +1 -1
  761. package/dist/frontend/npm-fetch-analysis.js +13 -4
  762. package/dist/frontend/npm-fetch-analysis.js.map +1 -1
  763. package/dist/frontend/npm-fetch-analysis.test.js +33 -10
  764. package/dist/frontend/npm-fetch-analysis.test.js.map +1 -1
  765. package/dist/frontend/npm-fetch-node.js.map +1 -1
  766. package/dist/frontend/npm-fetch-syntax.js +4 -9
  767. package/dist/frontend/npm-fetch-syntax.js.map +1 -1
  768. package/dist/frontend/npm-node.js +3 -1
  769. package/dist/frontend/npm-node.js.map +1 -1
  770. package/dist/frontend/npm-static-bundled-cjs.js +88 -29
  771. package/dist/frontend/npm-static-bundled-cjs.js.map +1 -1
  772. package/dist/frontend/npm-static-bundled-cjs.test.js +29 -10
  773. package/dist/frontend/npm-static-bundled-cjs.test.js.map +1 -1
  774. package/dist/frontend/npm-static-declaration-syntax.js +148 -56
  775. package/dist/frontend/npm-static-declaration-syntax.js.map +1 -1
  776. package/dist/frontend/npm-static-declarations.d.ts +1 -1
  777. package/dist/frontend/npm-static-declarations.js.map +1 -1
  778. package/dist/frontend/npm-static-declarations.test.js +33 -7
  779. package/dist/frontend/npm-static-declarations.test.js.map +1 -1
  780. package/dist/frontend/npm-static-prune.js +26 -12
  781. package/dist/frontend/npm-static-prune.js.map +1 -1
  782. package/dist/frontend/npm-static-prune.test.js +17 -3
  783. package/dist/frontend/npm-static-prune.test.js.map +1 -1
  784. package/dist/frontend/npm-static-rewrite-host.js +2 -3
  785. package/dist/frontend/npm-static-rewrite-host.js.map +1 -1
  786. package/dist/frontend/npm-static-rewrite-syntax.js +64 -21
  787. package/dist/frontend/npm-static-rewrite-syntax.js.map +1 -1
  788. package/dist/frontend/npm-static-rewrite.js.map +1 -1
  789. package/dist/frontend/npm-static-subtyping.js +9 -4
  790. package/dist/frontend/npm-static-subtyping.js.map +1 -1
  791. package/dist/frontend/npm-static-subtyping.test.js +30 -6
  792. package/dist/frontend/npm-static-subtyping.test.js.map +1 -1
  793. package/dist/frontend/npm-static.js +15 -4
  794. package/dist/frontend/npm-static.js.map +1 -1
  795. package/dist/frontend/npm.js +122 -36
  796. package/dist/frontend/npm.js.map +1 -1
  797. package/dist/frontend/npm.test.js +30 -10
  798. package/dist/frontend/npm.test.js.map +1 -1
  799. package/dist/frontend/pipeline-native.js.map +1 -1
  800. package/dist/frontend/pipeline.js +25 -8
  801. package/dist/frontend/pipeline.js.map +1 -1
  802. package/dist/frontend/pipeline.test.js +21 -7
  803. package/dist/frontend/pipeline.test.js.map +1 -1
  804. package/dist/frontend/program-node.js +5 -3
  805. package/dist/frontend/program-node.js.map +1 -1
  806. package/dist/frontend/program.d.ts +2 -2
  807. package/dist/frontend/program.js +234 -101
  808. package/dist/frontend/program.js.map +1 -1
  809. package/dist/frontend/program.test.js +27 -27
  810. package/dist/frontend/program.test.js.map +1 -1
  811. package/dist/frontend/provenance-core.js +8 -4
  812. package/dist/frontend/provenance-core.js.map +1 -1
  813. package/dist/frontend/provenance-registry.js +1 -4
  814. package/dist/frontend/provenance-registry.js.map +1 -1
  815. package/dist/frontend/resolve.js +32 -20
  816. package/dist/frontend/resolve.js.map +1 -1
  817. package/dist/frontend/resolve.test.js +1 -1
  818. package/dist/frontend/resolve.test.js.map +1 -1
  819. package/dist/frontend/runtime-resolve.js +13 -4
  820. package/dist/frontend/runtime-resolve.js.map +1 -1
  821. package/dist/frontend/runtime-resolve.test.js +25 -9
  822. package/dist/frontend/runtime-resolve.test.js.map +1 -1
  823. package/dist/frontend/services-node.js +6 -2
  824. package/dist/frontend/services-node.js.map +1 -1
  825. package/dist/frontend/services-node.test.js +18 -6
  826. package/dist/frontend/services-node.test.js.map +1 -1
  827. package/dist/frontend/services.js +8 -4
  828. package/dist/frontend/services.js.map +1 -1
  829. package/dist/frontend/services.test.js +6 -2
  830. package/dist/frontend/services.test.js.map +1 -1
  831. package/dist/frontend/ts7/api.js +12 -4
  832. package/dist/frontend/ts7/api.js.map +1 -1
  833. package/dist/frontend/ts7/ast-bytes.js +10 -3
  834. package/dist/frontend/ts7/ast-bytes.js.map +1 -1
  835. package/dist/frontend/ts7/ast-bytes.test.js +23 -4
  836. package/dist/frontend/ts7/ast-bytes.test.js.map +1 -1
  837. package/dist/frontend/ts7/ast-guards.test.js +14 -5
  838. package/dist/frontend/ts7/ast-guards.test.js.map +1 -1
  839. package/dist/frontend/ts7/ast-node.d.ts +6 -1
  840. package/dist/frontend/ts7/ast-node.js +484 -164
  841. package/dist/frontend/ts7/ast-node.js.map +1 -1
  842. package/dist/frontend/ts7/ast-node.test.js +109 -36
  843. package/dist/frontend/ts7/ast-node.test.js.map +1 -1
  844. package/dist/frontend/ts7/ast-text.js +13 -3
  845. package/dist/frontend/ts7/ast-text.js.map +1 -1
  846. package/dist/frontend/ts7/ast-text.test.js.map +1 -1
  847. package/dist/frontend/ts7/ast-types.js.map +1 -1
  848. package/dist/frontend/ts7/ast-wire.d.ts +1 -1
  849. package/dist/frontend/ts7/ast-wire.js +55 -20
  850. package/dist/frontend/ts7/ast-wire.js.map +1 -1
  851. package/dist/frontend/ts7/ast-wire.test.js +53 -8
  852. package/dist/frontend/ts7/ast-wire.test.js.map +1 -1
  853. package/dist/frontend/ts7/ast.js +47 -28
  854. package/dist/frontend/ts7/ast.js.map +1 -1
  855. package/dist/frontend/ts7/census-check.js +1 -1
  856. package/dist/frontend/ts7/census-check.js.map +1 -1
  857. package/dist/frontend/ts7/checker-cache.js.map +1 -1
  858. package/dist/frontend/ts7/checker.js +5 -3
  859. package/dist/frontend/ts7/checker.js.map +1 -1
  860. package/dist/frontend/ts7/checker.test.js +54 -17
  861. package/dist/frontend/ts7/checker.test.js.map +1 -1
  862. package/dist/frontend/ts7/enums.test.js +9 -4
  863. package/dist/frontend/ts7/enums.test.js.map +1 -1
  864. package/dist/frontend/ts7/native-api.js.map +1 -1
  865. package/dist/frontend/ts7/native-host.js.map +1 -1
  866. package/dist/frontend/ts7/native-process.js +9 -3
  867. package/dist/frontend/ts7/native-process.js.map +1 -1
  868. package/dist/frontend/ts7/program-adapter.js +1 -1
  869. package/dist/frontend/ts7/program-adapter.js.map +1 -1
  870. package/dist/frontend/ts7/program-host.js +7 -4
  871. package/dist/frontend/ts7/program-host.js.map +1 -1
  872. package/dist/frontend/ts7/program-host.test.js +43 -11
  873. package/dist/frontend/ts7/program-host.test.js.map +1 -1
  874. package/dist/frontend/ts7/rpc-api.js +3 -1
  875. package/dist/frontend/ts7/rpc-api.js.map +1 -1
  876. package/dist/frontend/ts7/rpc-client.js +15 -5
  877. package/dist/frontend/ts7/rpc-client.js.map +1 -1
  878. package/dist/frontend/ts7/rpc-client.test.js +26 -8
  879. package/dist/frontend/ts7/rpc-client.test.js.map +1 -1
  880. package/dist/frontend/ts7/rpc-filesystem.js.map +1 -1
  881. package/dist/frontend/ts7/rpc-filesystem.test.js +43 -10
  882. package/dist/frontend/ts7/rpc-filesystem.test.js.map +1 -1
  883. package/dist/frontend/ts7/rpc-process.js +16 -6
  884. package/dist/frontend/ts7/rpc-process.js.map +1 -1
  885. package/dist/frontend/ts7/rpc-process.test.js.map +1 -1
  886. package/dist/frontend/ts7/rpc-wire.d.ts +1 -0
  887. package/dist/frontend/ts7/rpc-wire.js +41 -14
  888. package/dist/frontend/ts7/rpc-wire.js.map +1 -1
  889. package/dist/frontend/ts7/rpc-wire.test.js +36 -6
  890. package/dist/frontend/ts7/rpc-wire.test.js.map +1 -1
  891. package/dist/frontend/ts7/semantic-checker.js +209 -68
  892. package/dist/frontend/ts7/semantic-checker.js.map +1 -1
  893. package/dist/frontend/ts7/semantic-checker.test.js +29 -14
  894. package/dist/frontend/ts7/semantic-checker.test.js.map +1 -1
  895. package/dist/frontend/ts7/semantic-json.js +7 -1
  896. package/dist/frontend/ts7/semantic-json.js.map +1 -1
  897. package/dist/frontend/ts7/semantic-json.test.js +17 -3
  898. package/dist/frontend/ts7/semantic-json.test.js.map +1 -1
  899. package/dist/frontend/ts7/semantic-model.js +147 -51
  900. package/dist/frontend/ts7/semantic-model.js.map +1 -1
  901. package/dist/frontend/ts7/semantic-model.test.js +72 -19
  902. package/dist/frontend/ts7/semantic-model.test.js.map +1 -1
  903. package/dist/frontend/ts7/semantic-types.d.ts +2 -2
  904. package/dist/frontend/ts7/session-cache.js +10 -3
  905. package/dist/frontend/ts7/session-cache.js.map +1 -1
  906. package/dist/frontend/ts7/session-cache.test.js +13 -4
  907. package/dist/frontend/ts7/session-cache.test.js.map +1 -1
  908. package/dist/frontend/ts7/session-path.js +25 -10
  909. package/dist/frontend/ts7/session-path.js.map +1 -1
  910. package/dist/frontend/ts7/session-path.test.js +47 -4
  911. package/dist/frontend/ts7/session-path.test.js.map +1 -1
  912. package/dist/frontend/ts7/session-timing.js +22 -3
  913. package/dist/frontend/ts7/session-timing.js.map +1 -1
  914. package/dist/frontend/ts7/session-timing.test.js +12 -3
  915. package/dist/frontend/ts7/session-timing.test.js.map +1 -1
  916. package/dist/frontend/ts7/session.d.ts +1 -0
  917. package/dist/frontend/ts7/session.js +109 -35
  918. package/dist/frontend/ts7/session.js.map +1 -1
  919. package/dist/frontend/ts7/session.test.js +69 -15
  920. package/dist/frontend/ts7/session.test.js.map +1 -1
  921. package/dist/frontend/ts7/source-parser.js +17 -6
  922. package/dist/frontend/ts7/source-parser.js.map +1 -1
  923. package/dist/frontend/ts7/source-parser.test.js +32 -9
  924. package/dist/frontend/ts7/source-parser.test.js.map +1 -1
  925. package/dist/frontend/tsc-codes.js +56 -11
  926. package/dist/frontend/tsc-codes.js.map +1 -1
  927. package/dist/frontend/tsc-codes.test.d.ts +1 -0
  928. package/dist/frontend/tsc-codes.test.js +16 -0
  929. package/dist/frontend/tsc-codes.test.js.map +1 -0
  930. package/dist/frontend/type-mapper.js +545 -204
  931. package/dist/frontend/type-mapper.js.map +1 -1
  932. package/dist/frontend/type-mapper.test.js +108 -33
  933. package/dist/frontend/type-mapper.test.js.map +1 -1
  934. package/dist/frontend/union-discriminants.js +8 -2
  935. package/dist/frontend/union-discriminants.js.map +1 -1
  936. package/dist/frontend/union-discriminants.test.js +77 -20
  937. package/dist/frontend/union-discriminants.test.js.map +1 -1
  938. package/dist/index.d.ts +9 -8
  939. package/dist/index.js +150 -81
  940. package/dist/index.js.map +1 -1
  941. package/dist/ir/analysis.js +95 -38
  942. package/dist/ir/analysis.js.map +1 -1
  943. package/dist/ir/analysis.test.js +91 -15
  944. package/dist/ir/analysis.test.js.map +1 -1
  945. package/dist/ir/api.d.ts +4 -0
  946. package/dist/ir/api.js +6 -0
  947. package/dist/ir/api.js.map +1 -0
  948. package/dist/ir/build.d.ts +7 -0
  949. package/dist/ir/build.js +27 -1
  950. package/dist/ir/build.js.map +1 -1
  951. package/dist/ir/builtin-effects.d.ts +9 -0
  952. package/dist/ir/builtin-effects.js +631 -0
  953. package/dist/ir/builtin-effects.js.map +1 -0
  954. package/dist/ir/builtin-signatures.d.ts +15 -0
  955. package/dist/ir/builtin-signatures.js +3396 -0
  956. package/dist/ir/builtin-signatures.js.map +1 -0
  957. package/dist/ir/byte-numbers.js +67 -16
  958. package/dist/ir/byte-numbers.js.map +1 -1
  959. package/dist/ir/byte-numbers.test.js +17 -4
  960. package/dist/ir/byte-numbers.test.js.map +1 -1
  961. package/dist/ir/constant-tables.js +13 -5
  962. package/dist/ir/constant-tables.js.map +1 -1
  963. package/dist/ir/constant-tables.test.js +47 -7
  964. package/dist/ir/constant-tables.test.js.map +1 -1
  965. package/dist/ir/control-flow.js +2 -1
  966. package/dist/ir/control-flow.js.map +1 -1
  967. package/dist/ir/control-flow.test.js +35 -11
  968. package/dist/ir/control-flow.test.js.map +1 -1
  969. package/dist/ir/initializer-bindings.d.ts +9 -0
  970. package/dist/ir/initializer-bindings.js +115 -0
  971. package/dist/ir/initializer-bindings.js.map +1 -0
  972. package/dist/ir/initializer-bindings.test.d.ts +1 -0
  973. package/dist/ir/initializer-bindings.test.js +118 -0
  974. package/dist/ir/initializer-bindings.test.js.map +1 -0
  975. package/dist/ir/integer-loop-facts.d.ts +12 -0
  976. package/dist/ir/integer-loop-facts.js +137 -0
  977. package/dist/ir/integer-loop-facts.js.map +1 -0
  978. package/dist/ir/integer-loops.js +85 -30
  979. package/dist/ir/integer-loops.js.map +1 -1
  980. package/dist/ir/integer-loops.test.js +76 -13
  981. package/dist/ir/integer-loops.test.js.map +1 -1
  982. package/dist/ir/integer-ranges.js +93 -21
  983. package/dist/ir/integer-ranges.js.map +1 -1
  984. package/dist/ir/integer-ranges.test.js +199 -21
  985. package/dist/ir/integer-ranges.test.js.map +1 -1
  986. package/dist/ir/intrinsic-signatures.d.ts +20 -0
  987. package/dist/ir/intrinsic-signatures.js +57 -0
  988. package/dist/ir/intrinsic-signatures.js.map +1 -0
  989. package/dist/ir/ir.d.ts +6 -2150
  990. package/dist/ir/ir.js +160 -1396
  991. package/dist/ir/ir.js.map +1 -1
  992. package/dist/ir/ir.test.js +98 -77
  993. package/dist/ir/ir.test.js.map +1 -1
  994. package/dist/ir/runtime-features.d.ts +221 -0
  995. package/dist/ir/runtime-features.js +551 -0
  996. package/dist/ir/runtime-features.js.map +1 -0
  997. package/dist/ir/runtime-features.test.d.ts +1 -0
  998. package/dist/ir/runtime-features.test.js +98 -0
  999. package/dist/ir/runtime-features.test.js.map +1 -0
  1000. package/dist/ir/scalar-records.js +130 -40
  1001. package/dist/ir/scalar-records.js.map +1 -1
  1002. package/dist/ir/scalar-records.test.js +146 -27
  1003. package/dist/ir/scalar-records.test.js.map +1 -1
  1004. package/dist/ir/serialize.js +4 -2
  1005. package/dist/ir/serialize.js.map +1 -1
  1006. package/dist/ir/serialize.test.js +44 -9
  1007. package/dist/ir/serialize.test.js.map +1 -1
  1008. package/dist/ir/traverse.js +156 -43
  1009. package/dist/ir/traverse.js.map +1 -1
  1010. package/dist/ir/traverse.test.js +99 -24
  1011. package/dist/ir/traverse.test.js.map +1 -1
  1012. package/dist/ir/validate.d.ts +1 -31
  1013. package/dist/ir/validate.js +782 -1889
  1014. package/dist/ir/validate.js.map +1 -1
  1015. package/dist/ir/validate.test.js +610 -114
  1016. package/dist/ir/validate.test.js.map +1 -1
  1017. package/dist/library/cache-primitives.js +9 -10
  1018. package/dist/library/cache-primitives.js.map +1 -1
  1019. package/dist/library/cache-reset.test.js +2 -1
  1020. package/dist/library/cache-reset.test.js.map +1 -1
  1021. package/dist/library/compiler-self-identity.js +11 -5
  1022. package/dist/library/compiler-self-identity.js.map +1 -1
  1023. package/dist/library/compiler-self-identity.test.js +10 -3
  1024. package/dist/library/compiler-self-identity.test.js.map +1 -1
  1025. package/dist/library/fence-eval.js +24 -7
  1026. package/dist/library/fence-eval.js.map +1 -1
  1027. package/dist/library/fence-eval.test.js +31 -7
  1028. package/dist/library/fence-eval.test.js.map +1 -1
  1029. package/dist/library/int-infer.js +199 -59
  1030. package/dist/library/int-infer.js.map +1 -1
  1031. package/dist/library/int-infer.test.js +133 -57
  1032. package/dist/library/int-infer.test.js.map +1 -1
  1033. package/dist/library/ir-policy.d.ts +27 -0
  1034. package/dist/library/ir-policy.js +232 -0
  1035. package/dist/library/ir-policy.js.map +1 -0
  1036. package/dist/library/library-cache.js +40 -17
  1037. package/dist/library/library-cache.js.map +1 -1
  1038. package/dist/library/library-cache.test.js +24 -13
  1039. package/dist/library/library-cache.test.js.map +1 -1
  1040. package/dist/library/library-profile.js +68 -13
  1041. package/dist/library/library-profile.js.map +1 -1
  1042. package/dist/library/prepare.js +48 -20
  1043. package/dist/library/prepare.js.map +1 -1
  1044. package/dist/library/semantic-source.js +16 -14
  1045. package/dist/library/semantic-source.js.map +1 -1
  1046. package/dist/library/semantic-source.test.js +9 -14
  1047. package/dist/library/semantic-source.test.js.map +1 -1
  1048. package/dist/library/sidecar-validate.js +53 -12
  1049. package/dist/library/sidecar-validate.js.map +1 -1
  1050. package/dist/library/sidecar.js +85 -24
  1051. package/dist/library/sidecar.js.map +1 -1
  1052. package/dist/library/trap-teaching.js +11 -2
  1053. package/dist/library/trap-teaching.js.map +1 -1
  1054. package/dist/native/cache.js +10 -4
  1055. package/dist/native/cache.js.map +1 -1
  1056. package/dist/native/cli.js +34 -9
  1057. package/dist/native/cli.js.map +1 -1
  1058. package/dist/native/compiler.js +167 -43
  1059. package/dist/native/compiler.js.map +1 -1
  1060. package/dist/native/compiler.test.js +129 -32
  1061. package/dist/native/compiler.test.js.map +1 -1
  1062. package/dist/native/comptime.js +23 -7
  1063. package/dist/native/comptime.js.map +1 -1
  1064. package/dist/native/comptime.test.js +26 -6
  1065. package/dist/native/comptime.test.js.map +1 -1
  1066. package/dist/native/executable-cache.js +77 -27
  1067. package/dist/native/executable-cache.js.map +1 -1
  1068. package/dist/native/executable-cache.test.js +41 -6
  1069. package/dist/native/executable-cache.test.js.map +1 -1
  1070. package/dist/native/file-identity.js +9 -2
  1071. package/dist/native/file-identity.js.map +1 -1
  1072. package/dist/native/file-identity.test.js.map +1 -1
  1073. package/dist/native/library.js +50 -12
  1074. package/dist/native/library.js.map +1 -1
  1075. package/dist/native/prepare.js +119 -34
  1076. package/dist/native/prepare.js.map +1 -1
  1077. package/dist/native/prepare.test.js +22 -6
  1078. package/dist/native/prepare.test.js.map +1 -1
  1079. package/dist/native/runtime-typescript.js +24 -11
  1080. package/dist/native/runtime-typescript.js.map +1 -1
  1081. package/dist/native/runtime-typescript.test.js.map +1 -1
  1082. package/dist/native/sanitizer.js +71 -18
  1083. package/dist/native/sanitizer.js.map +1 -1
  1084. package/dist/native/sanitizer.test.js +77 -20
  1085. package/dist/native/sanitizer.test.js.map +1 -1
  1086. package/dist/native/task.js.map +1 -1
  1087. package/dist/native/task.test.js +7 -2
  1088. package/dist/native/task.test.js.map +1 -1
  1089. package/dist/native/toolchain.js +68 -26
  1090. package/dist/native/toolchain.js.map +1 -1
  1091. package/dist/native/toolchain.test.js +59 -20
  1092. package/dist/native/toolchain.test.js.map +1 -1
  1093. package/dist/startup-cache.d.ts +1 -1
  1094. package/dist/startup-cache.js +1 -1
  1095. package/dist/startup-cache.js.map +1 -1
  1096. package/dist/timing.js.map +1 -1
  1097. package/package.json +20 -20
  1098. package/surface-manifest.json +1 -1
  1099. package/dist/frontend/lowering/lower-builtins.d.ts +0 -601
  1100. package/dist/frontend/lowering/lower-builtins.js +0 -8986
  1101. package/dist/frontend/lowering/lower-builtins.js.map +0 -1
  1102. package/dist/frontend/lowering/lower-containers.d.ts +0 -382
  1103. package/dist/frontend/lowering/lower-containers.js +0 -7344
  1104. package/dist/frontend/lowering/lower-containers.js.map +0 -1
package/dist/ir/ir.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { IrLibFn } from "./builtin-signatures.js";
2
+ export type { IrLibFn } from "./builtin-signatures.js";
1
3
  /** Byte-offset span in the original source file. */
2
4
  export interface SrcLoc {
3
5
  file: string;
@@ -420,11 +422,11 @@ interface IrKindSet<K extends IrType["kind"]> extends ReadonlySet<IrType["kind"]
420
422
  /** The opaque runtime handle kinds. procStream is the one scalar handle;
421
423
  * every other handle has pointer representation. */
422
424
  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"];
423
- export type HandleKind = typeof HANDLE_KIND_LIST[number];
425
+ export type HandleKind = (typeof HANDLE_KIND_LIST)[number];
424
426
  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">;
425
427
  /** The IR kinds represented as pointers in native code. */
426
428
  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"];
427
- export type PointerKind = typeof POINTER_KIND_LIST[number];
429
+ export type PointerKind = (typeof POINTER_KIND_LIST)[number];
428
430
  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">;
429
431
  /** Runtime RC symbol stem for each IR type kind. An empty stem means the
430
432
  * kind is scalar/unit or uses an emitted per-shape helper (object/record).
@@ -1419,6 +1421,8 @@ export type IrArrIntrinsicMethod = "length"
1419
1421
  | "flatCopy" | "flatOne"
1420
1422
  /** Mutating splice with evaluated insertion items; returns removed slots. */
1421
1423
  | "spliceInsert" | "reverse"
1424
+ /** Evaluated numeric bounds; same-type fill values stay borrowed. */
1425
+ | "copyWithin" | "fill" | "fillUndefined"
1422
1426
  /** ES2023 copying methods. `toSpliced` receives [start, deleteCount,
1423
1427
  * itemsArray], with omitted arguments completed by the frontend;
1424
1428
  * `with` receives [index, value] and throws Node's catchable RangeError
@@ -1595,1899 +1599,6 @@ export type IrRegexIntrinsicMethod = "test" | "match"
1595
1599
  * no g/y fence applies: /g is irrelevant and /y anchors at 0 — exactly
1596
1600
  * Node. Never throws. */
1597
1601
  | "search" | "source" | "flags" | "toString" | "replace" | "replaceAll" | "split";
1598
- /** The complete standard-library surface (mirrors ambient/scriptc.d.ts: the
1599
- * `process` and `JSON` globals and `declare module "node:fs"`). A closed
1600
- * union — every member has a signature in the validator's LIB_FN_SIGS and a
1601
- * scr_* implementation in the runtime (scr_lib.c / scr_json.c). fs.*
1602
- * failures and json.parse syntax errors THROW (catchable, via the runtime
1603
- * exception cell); process.* members never throw. JSON.stringify without a
1604
- * callback lowers to the type-directed `jsonStringify` node below; callback
1605
- * forms use the shared native JSON walker through libCall.
1606
- * island.eval (the internal __island_eval testing hook) exists only in
1607
- * --dynamic builds — the frontend rejects it otherwise, so backends may
1608
- * assume the island runtime is linked when they see it; island exceptions
1609
- * bridge into the exception cell as catchable strings (may-throw). */
1610
- export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew" | "weakMap.is" | "weakSet.is" | "weakMap.new" | "weakSet.new" | "dyn.fromEntries" | "bytes.constructor" | "bytes.instanceOf" | "bytes.construct" | "arrayBuffer.constructor" | "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"
1611
- /** Native static fetch and its Web-platform companions. fetch.start
1612
- * answers once the response head arrives; the response body readers
1613
- * consume the native body stream. AbortSignal and ReadableStream values
1614
- * are opaque checked-dynamic handles. */
1615
- | "fetch.start" | "fetch.input" | "fetch.function" | "fetch.requestNew" | "fetch.headersNew" | "fetch.responseNew" | "fetch.responseArrayBuffer" | "fetch.responseJson" | "fetch.responseText" | "fetch.responseBytes" | "fetch.abortControllerNew" | "fetch.abortTimeout" | "fetch.abortNow" | "fetch.abortAny" | "abort.controllerNew" | "abort.timeout" | "abort.now" | "abort.any" | "fetch.webIs" | "fetch.streamIs" | "fetch.streamNew" | "fetch.streamFrom" | "fetch.readerRead" | "island.eval"
1616
- /** Load an embedded npm package's runtime entry in the island (cached by
1617
- * the engine's module registry) and take one export: args are the entry
1618
- * KEY (an embedded module's key, from IrModule.embedded) and the export
1619
- * name — "default" for default imports, "*" for the namespace object.
1620
- * --dynamic only, like island.eval; result is an owned jsval. May throw
1621
- * (a package's top-level code can), bridged catchably. */
1622
- | "island.import"
1623
- /** Dynamic `import(spec)`: load a module through the island's module
1624
- * system — an embedded module's key or a builtin shim's "node:x" key —
1625
- * and answer an ENGINE promise of its namespace object (always a
1626
- * promise, never a throw: load and evaluation failures REJECT it,
1627
- * Node's shape). The frontend wraps the result in jsBridgePromise, so
1628
- * awaiting parks the fiber and a rejection crosses catchably. --dynamic
1629
- * only; result is an owned jsval holding the engine promise. */
1630
- | "island.importDyn"
1631
- /** A checked cast the boundary can never satisfy, DEFERRED to runtime:
1632
- * `islandValue as Promise<T>` — the value is an ENGINE promise and T
1633
- * has no validated exit (Node-typed async APIs put class-shaped
1634
- * interfaces there), so instead of refusing the build the cast throws a
1635
- * catchable TypeError AT THE CAST naming the target type (args: the
1636
- * island value — evaluated, borrowed — and the type name). The result
1637
- * type is the cast's mapped target (a typed dummy; the exception is
1638
- * pending). Documented divergence: JS `as` never checks — like the dyn
1639
- * boundary, a conversion that cannot happen throws instead of lying.
1640
- * --dynamic only. */
1641
- | "island.castFail" | "json.parse" | "json.parseReviver" | "json.stringifyReplacer" | "json.stringifyValue"
1642
- /** Keyed WRITE on a dyn value — `h.onDone = cb` / `h["k"] = v` on a
1643
- * checked-dynamic object (args: receiver, key string, value — all
1644
- * borrowed; the runtime copies the key and retains the value in). An
1645
- * OBJ receiver sets the member (later writes win, insertion order
1646
- * preserved — JS exactly); undefined/null throws Node's catchable
1647
- * "Cannot set properties of undefined (setting 'k')"; every other kind
1648
- * throws Node's STRICT-mode "Cannot create property 'k' on <kind>" —
1649
- * primitives quoting their rendering, V8's "on number '5'"
1650
- * (sloppy mode would silently ignore — suite tests are 'use strict';
1651
- * SEMANTICS.md notes the sloppy divergence: loud, never silent). Void
1652
- * result; in the may-throw seed set. */
1653
- | "dyn.keySet" | "dyn.keySetComputed"
1654
- /** Delete an ordinary checked-native object's own key. Borrows both
1655
- * arguments; other receiver representations retain a runtime refusal. */
1656
- | "dyn.keyDelete" | "dyn.keyDeleteComputed" | "dyn.hasKeyComputed" | "dyn.hasOwnComputed" | "dyn.propertyIsEnumerableComputed"
1657
- /** Native own properties on globalThis keyed by symbol identity. */
1658
- | "dyn.globalSymbolGet" | "dyn.globalSymbolSet" | "dyn.globalSymbolHas" | "dyn.globalSymbolDelete"
1659
- /** Exact native class capsule identity, without materializing its fields. */
1660
- | "dyn.typedRefIs" | "dyn.classIs"
1661
- /** Destructuring pack over a dyn source — `const [a, b] = d`, a
1662
- * destructured dyn callback param (args: the source and the STATIC
1663
- * TypeError spelling, "" when the source has none — both borrowed;
1664
- * result: a fresh dyn array, +1). Iterable kinds collect like spread
1665
- * (arrays element-by-element, strings by code point, bytes by byte);
1666
- * every other kind throws V8's destructuring TypeError — the spelling
1667
- * verbatim when non-empty, else the runtime kind wording ("number 5 is
1668
- * not iterable (cannot read property Symbol(Symbol.iterator))"). In the
1669
- * may-throw seed set. */
1670
- | "dyn.iterPack" | "dyn.arrayFromIterator" | "dyn.iterator" | "dyn.iteratorResult" | "dyn.mapSeedEntries" | "dyn.mapSeedEntry"
1671
- /** The for-of-over-dyn pack accessors — the emitted index loop drives
1672
- * them over a dyn.iterPack result (ARR by construction). arrLen: the
1673
- * ARR length as f64 (0 for non-ARR kinds; arg borrowed). arrAt: the
1674
- * element at index (+1; the undefined singleton past the end). Neither
1675
- * throws. */
1676
- | "dyn.arrLen" | "dyn.arrAt"
1677
- /** `key in v` with a RUNTIME (string) key on a checked-dynamic
1678
- * receiver (args: value dyn, key string; result bool): OBJ answers
1679
- * own-member presence, ARR answers 'length'/a valid index — exactly
1680
- * the literal-key dynHasKey path. Proxy has traps may throw. */
1681
- | "dyn.hasKey"
1682
- /** Object.defineProperties over dyn values (args: target, descriptors —
1683
- * both borrowed dyn; result: the target, +1 — JS's return value).
1684
- * Value descriptors become own properties on OBJ and FUNC targets;
1685
- * OBJ targets preserve data attributes. get/set
1686
- * descriptors and non-object targets/descriptors throw catchably
1687
- * (Node's TypeError texts; accessors the loud unsupported Error). In
1688
- * the may-throw seed set. */
1689
- | "dyn.defineProps" | "dyn.defineProperty" | "dyn.getOwnPropertyDescriptor" | "dyn.arrayProtoCall" | "dyn.promiseAll"
1690
- /** Bare `typeof v` on a dyn value AS A STRING (arg: the dyn value,
1691
- * borrowed; result: an owned string) — the dyn kind's JS answer:
1692
- * undefined→"undefined", null/object/array/bytes→"object" (JS's oldest
1693
- * wart preserved), boolean/number/string by kind, function→"function".
1694
- * Never throws. */
1695
- | "dyn.typeof"
1696
- /** Object.prototype.toString.call on a checked-dynamic value. */
1697
- | "dyn.objectTag" | "dyn.freeze" | "dyn.isFrozen" | "dyn.nativeSetNew" | "dyn.nativeSetIs" | "dyn.nativeMapIs" | "dyn.nativeUrlIs" | "dyn.nativeDateIs" | "date.nativeNew" | "date.checkedValue" | "dyn.nativeRegexIs"
1698
- /** toString() on a checked-dynamic receiver: runtime kind dispatch
1699
- * (bytes decode per the literal encoding — utf8 default; strings,
1700
- * numbers, booleans, arrays, objects answer JS-exactly; undefined and
1701
- * null throw the catchable TypeError). */
1702
- | "dyn.toString"
1703
- /** Engine-free CommonJS module graph. Module values are scalar f64
1704
- * handles; generated startup defines the registry, init wrappers update
1705
- * loading/cache state, and the read surface answers Node's live metadata. */
1706
- | "module.registryInit" | "module.define" | "module.enter" | "module.link" | "module.finish" | "module.fail" | "module.filename" | "module.id" | "module.path" | "module.paths" | "module.children" | "module.parent" | "module.loaded" | "module.cacheGet" | "module.cacheHas" | "module.cacheKeys" | "fs.readFileSync"
1707
- /** readFileSync(path) — the Buffer read (+1 bytes); throws catchably
1708
- * like the utf8 form. */
1709
- | "fs.readFileSyncBuf"
1710
- /** readFileSync(path, enc) with a RUNTIME encoding (an untyped JS
1711
- * parameter): undefined/null answer Buffers, utf8 a string, other real
1712
- * encodings fence loudly, unknown names throw ERR_UNKNOWN_ENCODING. */
1713
- | "fs.readFileSyncDyn" | "fs.writeFileSync" | "fs.appendFileSync" | "fs.existsSync" | "fs.mkdirSync" | "fs.rmSync" | "fs.rmdirSync" | "fs.readdirSync"
1714
- /** node:path (scr_path.c ports BOTH of Node's implementations
1715
- * function-by-function): the `path.*` family is posix, the
1716
- * `path.win32*` family is Node v24's path.win32 byte-for-byte — the
1717
- * frontend binds the bare module to the TARGET platform's family
1718
- * (Node on Windows IS path.win32) and the path.posix / path.win32
1719
- * namespaces to their own family everywhere. join and resolve take ONE
1720
- * string[] arg — the frontend packs the variadic call's arguments into
1721
- * an array literal. basename always receives its suffix (the frontend
1722
- * completes an omitted one with "", a Node no-op). toNamespacedPath is
1723
- * the posix identity and the win32 \\?\-prefixer. None of these throw;
1724
- * the resolves consult the process cwd like Node's. */
1725
- | "path.join" | "path.resolve" | "path.normalize" | "path.dirname" | "path.basename" | "path.extname" | "path.isAbsolute" | "path.relative" | "path.toNamespacedPath" | "path.win32Join" | "path.win32Resolve" | "path.win32Normalize" | "path.win32Dirname" | "path.win32Basename" | "path.win32Extname" | "path.win32IsAbsolute" | "path.win32Relative" | "path.win32ToNamespacedPath"
1726
- /** node:os: homedir is $HOME else getpwuid(3); tmpdir is Node's env
1727
- * cascade ($TMPDIR/$TMP/$TEMP else /tmp, one trailing slash trimmed).
1728
- * os.platform() lowers to process.platform — one implementation. */
1729
- | "os.homedir"
1730
- /** os.release(): uname(2)'s release field — Node's own implementation
1731
- * (the kernel version string, e.g. "24.6.0" on macOS 15). Interned; +1
1732
- * per read. Never throws. */
1733
- | "os.release"
1734
- /** The os.userInfo() field trio (uv_os_get_passwd's slices): pw_name,
1735
- * pw_shell, pw_dir — the PASSWD homedir, not os.homedir's $HOME-first
1736
- * cascade (Node's own split). The frontend assembles the UserInfo
1737
- * record from these plus getuid/getgid. +1 fresh strings; a passwd
1738
- * lookup failure aborts (Node throws a system error there — no
1739
- * compiled program path reaches it for the running uid). */
1740
- | "os.userName" | "os.userShell" | "os.userHomedir" | "os.tmpdir"
1741
- /** os.networkInterfaces(): getifaddrs(3) → the Dict<NetworkInterfaceInfo[]>
1742
- * record, built inline by the emitter from a runtime snapshot (scr_lib.c).
1743
- * The result type is the CALL SITE's mapped @types/node shape — a pure
1744
- * index-signature record whose value is `Info[] | undefined`, Info a
1745
- * two-record union (IPv4: scopeid `number | undefined` holding undefined;
1746
- * IPv6: scopeid number) — verified structurally by the frontend. Rows
1747
- * match libuv's filter (IFF_UP && IFF_RUNNING, AF_INET/AF_INET6; loopback
1748
- * = internal; MACs from the interface's link-level sibling entry, zeros
1749
- * when absent; cidr from the netmask's contiguous prefix, the null arm
1750
- * when it is missing or non-contiguous). Key/row order follows the OS's
1751
- * getifaddrs enumeration — Node itself does not guarantee an order.
1752
- * Fresh +1 record; never throws (a getifaddrs failure yields {}). */
1753
- | "os.networkInterfaces"
1754
- /** `Math.max(...xs)` / `Math.min(...xs)` over one spread number[]
1755
- * (scr_number.c): the JS fold exactly — any NaN element poisons the
1756
- * result, ±0 order by the JS comparison (max prefers +0, min prefers
1757
- * -0), and the empty array yields -Infinity / +Infinity like the
1758
- * zero-argument calls. Borrows the array; never throws. */
1759
- | "math.maxArr" | "math.minArr" | "math.hypotArr"
1760
- /** `fs.readdirSync(path, { withFileTypes: true })` — Dirent rows over
1761
- * one readdir pass (scr_lib.c's scandir snapshot; DT_UNKNOWN falls back
1762
- * to lstat, Node's getDirents rule). The result type is the call site's
1763
- * interned Dirent record array (name, parentPath, hidden %dtype in
1764
- * libuv's UV_DIRENT encoding) — verified by the frontend; the emitter
1765
- * assembles the rows from the snapshot. OS order, no "."/"..". Throws
1766
- * Node's scandir errno error (may-throw seed set); fresh +1 array. */
1767
- | "fs.readdirTypesSync"
1768
- /** `Math.floor(x)` — C floor() IS the JS operation (NaN/±0/±Infinity
1769
- * pass through bit-exactly). Never throws. */
1770
- | "math.floor"
1771
- /** `Math.min(a, b)` / `Math.max(a, b)` — the two-argument scalar forms
1772
- * (scr_lib.c), JS-exact like the Arr folds: NaN poisons, max prefers +0
1773
- * over -0 (min the reverse). C fmin/fmax are NOT these (they drop NaN).
1774
- * Never throw. */
1775
- | "math.min" | "math.max"
1776
- /** `Math.random()` — a uniform double in [0,1) with the spec's 53-bit
1777
- * granularity, drawn from arc4random_buf (the CSPRNG behind the crypto
1778
- * lowerings). Same distribution as Node, NECESSARILY different sequence
1779
- * (SEMANTICS.md 62 — no seeded sequence exists to match). Never throws. */
1780
- | "math.random"
1781
- /** Math.abs (C fabs — IS the JS operation) and Math.round (scr_lib.c:
1782
- * ECMA half-toward-+Infinity with the exact-fraction comparison — C
1783
- * round() is half-away-from-zero and floor(x+0.5) drifts at the
1784
- * epsilon boundary). Borrow nothing; never throw. */
1785
- | "math.abs" | "math.round"
1786
- /** Math.trunc / Math.ceil — C trunc()/ceil() ARE the JS operations
1787
- * (NaN/±0/±Infinity pass through bit-exactly; ceil(-0.5) is -0 in IEEE
1788
- * round-toward-+Infinity exactly as ECMA says). Static like floor —
1789
- * they are ask-4's wholeness-discharge operators, so the library
1790
- * inference needs them compiled, not island-served. Never throw. */
1791
- | "math.trunc" | "math.ceil" | "math.sin" | "math.sinh" | "math.cos" | "math.cosh" | "math.tan" | "math.tanh" | "math.asin" | "math.asinh" | "math.acos" | "math.acosh" | "math.atan" | "math.atanh" | "math.cbrt" | "math.clz32"
1792
- /** Return -1, +1, or the original NaN/zero. In particular, -0 remains -0. */
1793
- | "math.sign" | "math.exp" | "math.expm1" | "math.fround" | "math.sqrt" | "math.log" | "math.log1p" | "math.log2" | "math.log10" | "math.atan2" | "math.pow" | "math.imul"
1794
- /** The static global parsers/tests (scr_string.c). num.parseInt is
1795
- * ECMA-262 19.2.5 exactly — JS whitespace, sign, ToInt32 radix (the
1796
- * frontend completes an omitted radix to 0 = the spec's "undefined":
1797
- * base 10 with the 0x hex escape), longest digit prefix, and the exact
1798
- * mathematical value correctly rounded (u64 fast path, bignum beyond —
1799
- * overflow is ±Infinity). num.isNaN is the NaN self-test on an
1800
- * already-number argument (tsc pins the argument to number, so no
1801
- * ToNumber coercion exists to model). Borrow; never throw. */
1802
- | "num.parseInt" | "num.isNaN"
1803
- /** ES parseFloat (scr_string.c): the longest StrDecimalLiteral prefix
1804
- * of the trimmed input (no hex, "Infinity" exact-case), NaN when none —
1805
- * ECMA-262 19.2.4 over a string argument (non-string arguments keep the
1806
- * fence: Node would ToNumber-coerce). Borrows; never throws. */
1807
- | "num.parseFloat" | "num.fromString"
1808
- /** The static URI component codecs (scr_string.c), ECMA-262 Encode/
1809
- * Decode with the component sets over the runtime's UTF-8 strings.
1810
- * str.encodeUriComponent percent-encodes every byte outside the
1811
- * unreserved component set (ALPHA/DIGIT/- _ . ! ~ * ' ( )) as uppercase
1812
- * %XX — the spec's per-code-point UTF-8 encoding IS a byte scan here —
1813
- * and never throws (the spec's URIError case is an unpaired surrogate,
1814
- * which cannot exist in well-formed UTF-8). str.decodeUriComponent
1815
- * decodes %XX escapes bytewise (raw non-escape bytes copy through) and
1816
- * requires the escaped bytes to form strictly valid UTF-8 (overlong
1817
- * forms, surrogate code points, and >U+10FFFF refused, per UTF8-decode
1818
- * without replacement); bad hex or an invalid sequence THROWS the
1819
- * spec's URIError ("URI malformed"), catchable. Borrow; results +1. */
1820
- | "str.encodeUriComponent" | "str.decodeUriComponent" | "str.decodeUri"
1821
- /** RegExp.escape (ES2025): per-code-point EncodeForRegExpEscape —
1822
- * leading ASCII alphanumeric hex-escapes, syntax characters and '/'
1823
- * take a backslash, other punctuators/whitespace/line terminators
1824
- * hex-escape, the rest passes through. Total; borrows; result +1. */
1825
- | "regexp.escape"
1826
- /** encodeURI: the same Encode() keeping the reserved set and '#'
1827
- * unescaped — total like the component encoder. Borrow; result +1. */
1828
- | "str.encodeUri"
1829
- /** The WHATWG base64 globals (scr_string.c), Node-global since v16.
1830
- * Arguments are borrowed dyn values — WebIDL ToString runs in the
1831
- * runtime over the dyn kind (String(null) is "null": the html spec's
1832
- * coercion, which Node's atob(null) exercises). str.atob decodes
1833
- * forgiving-base64 (ASCII whitespace stripped, %4==0 strips up to two
1834
- * '=', %4==1 refuses, leftover bits discarded) into the latin1 code
1835
- * points as a string; a malformed input THROWS the catchable
1836
- * DOMException InvalidCharacterError ("The string to be decoded is not
1837
- * correctly encoded."). str.btoa encodes the string's code points as
1838
- * base64; any code point over U+00FF THROWS InvalidCharacterError
1839
- * ("Invalid character"). str.b64Missing is the zero-argument call of
1840
- * either: always throws Node's TypeError [ERR_MISSING_ARGS] "The
1841
- * \"input\" argument must be specified". Results +1. */
1842
- | "str.atob" | "str.btoa" | "str.b64Missing"
1843
- /** Number.prototype formatters (scr_lib.c), JS-exact:
1844
- * num.toExponential is toExponential() with the spec's "as many digits
1845
- * as necessary"; num.toFixed0 is the non-throwing omitted-argument
1846
- * toFixed() fast path; num.toFixed implements an explicit fractionDigits
1847
- * with exact binary-value rounding and THROWS RangeError outside 0..100.
1848
- * Successful results +1. */
1849
- | "num.toExponential" | "num.toFixed0" | "num.toFixed" | "num.toStringRadix"
1850
- /** Object.is over two numbers — the spec's SameValue on doubles: NaN
1851
- * equals NaN, +0 differs from -0, everything else is `===`. Plain bool
1852
- * result; never throws. (Union-armed operands take unionEq's sameValue
1853
- * flag instead — this is the both-f64 fast path.) */
1854
- | "num.sameValue"
1855
- /** SameValue over checked values, including NaN, signed zero and reference identity. */
1856
- | "dyn.sameValue"
1857
- /** `new Intl.NumberFormat("en-US").format(x)` and
1858
- * `x.toLocaleString("en-US")` with DEFAULT options — the one locale
1859
- * whose data the runtime embeds (Node's default-build locale): decimal
1860
- * notation, 0–3 fraction digits rounded half-up on the SHORTEST
1861
- * round-tripping decimal (ICU's rounding input, probed vs Node —
1862
- * format(1.0005) is "1.001" though toFixed(3) answers "1.000"), ","
1863
- * grouping every three integer digits, "∞"/"NaN" texts, and "-0" for
1864
- * negative inputs rounding to zero. Result +1; never throws. */
1865
- | "intl.numFormatEnUs"
1866
- /** `delete process.env[NAME]` — unsetenv(3): the mutation is visible to
1867
- * every later read (process.envGet asks getenv fresh) and inherited by
1868
- * spawned children, exactly Node. Statement position only (JS's boolean
1869
- * result is constant true there). Borrows the name; never throws. */
1870
- | "process.envUnset"
1871
- /** node:url + the URL class (scr_url.c). url.new parses one absolute
1872
- * URL string into a mutable URL value (+1) — invalid input THROWS a
1873
- * catchable TypeError ("Invalid URL"), like Node's constructor. The
1874
- * getters (borrowed receiver, +1 string) never throw; url.href doubles
1875
- * as toString(). fileURLToPath has one libFn per receiver form (URL
1876
- * value / string) — both THROW Node's TypeErrors on non-file schemes,
1877
- * encoded slashes, and non-empty hosts. url.pathToFileURL resolves the
1878
- * path (getcwd) and never throws. */
1879
- | "url.new" | "url.newBase"
1880
- /** Factories consume already-converted input/base strings. canParse
1881
- * answers a boolean; parse returns a checked native URL or null (+1).
1882
- * Parser failures are suppressed; conversion occurs before these calls. */
1883
- | "url.canParse" | "url.canParseBase" | "url.parse" | "url.parseBase" | "url.protocol" | "url.origin" | "url.username" | "url.password" | "url.host" | "url.hostname" | "url.port" | "url.pathname" | "url.href"
1884
- /** Selected component writes borrow the receiver and converted string.
1885
- * href replaces its parsed fields while retaining cached params identity. */
1886
- | "url.set" | "url.setChecked" | "url.fileURLToPathUrl" | "url.fileURLToPathChecked" | "url.fileURLToPathOptions" | "url.fileURLToPathBuffer" | "url.pathToFileURLChecked" | "url.fileURLToPathStr" | "url.pathToFileURL"
1887
- /** Explicit path syntax from the options.windows argument, independent
1888
- * of the executable's host platform. Windows UNC input can throw. */
1889
- | "url.pathToFileURLPlatform"
1890
- /** pathToFileURL under a win32 TARGET: the same scr_url_from_path call
1891
- * (the runtime selects the win32 arm by _WIN32), but a distinct IR name
1892
- * because that arm THROWS for malformed UNC inputs — may-throw seeds on
1893
- * it while posix pathToFileURL emission stays byte-identical. */
1894
- | "url.pathToFileURLWin32"
1895
- /** URLSearchParams (scr_url.c — always linked with the url unit).
1896
- * Construction: sp.new (empty), sp.parse (one borrowed init string —
1897
- * a single leading '?' strips, Node's constructor), sp.copy (snapshot
1898
- * of another list), sp.fromPairs (a string[][] value — THROWS Node's
1899
- * ERR_INVALID_TUPLE TypeError on a non-[name, value] row; the one
1900
- * throwing entry in the family), sp.with (the record-literal init
1901
- * desugar: append one pair, answer the same list +1 — chains fold
1902
- * `new URLSearchParams({...})` into nested calls). url.searchParams
1903
- * answers the URL's LIVE cached view (+1, one identity per URL);
1904
- * url.search is the WHATWG search getter ("" for no/empty query).
1905
- * Methods mirror the WHATWG surface: sp.get answers +1-or-NULL (the
1906
- * sym.desc union pattern, null arm), sp.getAll a fresh string[];
1907
- * sp.append/sp.set/sp.delete/sp.deleteValue/sp.sort mutate and
1908
- * re-serialize a live view's URL query; sp.has/sp.hasValue answer
1909
- * bools; sp.size/sp.toString are pure reads. sp.keyAt/sp.valAt are
1910
- * the for-of/forEach desugar's index reads (live — the loop re-reads
1911
- * sp.size each pass). */
1912
- | "sp.new" | "sp.newChecked" | "sp.parse" | "sp.copy" | "sp.fromPairs" | "sp.with" | "url.searchParams" | "url.search" | "url.hash" | "sp.get" | "sp.getAll" | "sp.append" | "sp.set" | "sp.delete" | "sp.deleteValue" | "sp.has" | "sp.hasValue" | "sp.sort" | "sp.size" | "sp.toString" | "sp.keyAt" | "sp.valAt"
1913
- /** node:querystring (scr_qs.c — link-gated by moduleUsesQs; NOT
1914
- * URLSearchParams: the legacy codec's escaping and '+' rules differ).
1915
- * qs.escape is Node's qsEscape, which encodes exactly the component
1916
- * unreserved set — it emits the always-linked
1917
- * scr_str_encode_uri_component, so escape-only programs never pull the
1918
- * unit. qs.unescape is Node's qsUnescape: strict decodeURIComponent
1919
- * first, the lenient legacy unescapeBuffer fallback on failure (never
1920
- * throws). qs.parse takes (str, sep, eq, maxKeys) — the frontend
1921
- * completes omitted/null sep/eq to "&"/"=" and the omitted maxKeys
1922
- * option to Node's 1000 (0 and negatives mean unlimited, Node's rule) —
1923
- * and its result type is the CALL SITE's mapped ParsedUrlQuery shape (a
1924
- * pure index-signature record over `string | string[]`, an undefined
1925
- * arm tolerated — @types/node's Dict), verified structurally by the
1926
- * frontend (lowerQuerystringParseCall); the emitters construct the
1927
- * record and hand its overflow map to scr_qs_parse_into with the two
1928
- * union tags. qs.stringify takes (obj, sep, eq) with obj a dyn value
1929
- * (the frontend dynFroms the typed record; JS-world dyn values pass
1930
- * through) — Node's encodeStringified rules run in the runtime, so
1931
- * arrays expand to repeated keys and null/undefined/nested objects are
1932
- * empty values. Custom encoder/decoder options fence at compile time.
1933
- * All borrow; string results +1; none throw. */
1934
- | "qs.parse" | "qs.stringify" | "qs.escape" | "qs.unescape"
1935
- /** node:util.parseArgs: one checked-dynamic config object in, one
1936
- * checked-dynamic ParsedResults tree out. Statically typed member reads
1937
- * validate their values when leaving that tree. The native parser may
1938
- * throw Node's coded validation/grammar TypeErrors. */
1939
- | "util.parseArgs" | "util.parseEnv" | "util.getSystemErrorName" | "util.getSystemErrorMessage" | "util.systemErrorEntries" | "util.stripVTControlCharacters" | "util.toUSVString" | "util.isDeepStrictEqual" | "util.styleText" | "util.typeIs" | "util.typeValue"
1940
- /** ES Symbol values (scr_symbol.c — link-gated by moduleUsesSymbol).
1941
- * sym.new: `Symbol(desc)` — a fresh runtime-unique identity (+1) whose
1942
- * one arg is the description string (borrowed); sym.newAnon is the
1943
- * description-less `Symbol()` form. sym.for: the Symbol.for global
1944
- * registry — one interned symbol per key (borrowed), +1 on every call.
1945
- * sym.toString: "Symbol(desc)" (+1 string; "Symbol()" when absent).
1946
- * sym.desc / sym.keyFor answer the interned `string | undefined` union
1947
- * (the runtime returns +1-or-NULL; the backend builds the union arms —
1948
- * the child.stdout pattern). None of these throw. */
1949
- | "sym.new" | "sym.newAnon" | "sym.for" | "sym.wellKnown" | "sym.keyFor" | "sym.desc" | "sym.toString"
1950
- /** Engine-free arbitrary-precision bigint operations (scr_bigint.c).
1951
- * parse accepts the ECMAScript BigInt string grammar; fromF64 accepts
1952
- * finite integral Numbers. Arithmetic returns fresh immutable values.
1953
- * cmp returns -1/0/1 as f64; toString accepts a numeric radix. */
1954
- | "bigint.parse" | "bigint.fromF64" | "bigint.neg" | "bigint.not" | "bigint.add" | "bigint.sub" | "bigint.mul" | "bigint.div" | "bigint.mod" | "bigint.pow" | "bigint.and" | "bigint.or" | "bigint.xor" | "bigint.shl" | "bigint.shr" | "bigint.eq" | "bigint.eqString" | "bigint.cmp" | "bigint.cmpNumber" | "bigint.truthy" | "bigint.toString" | "bigint.inspect" | "bigint.toF64" | "bigint.asUintN" | "bigint.asIntN" | "bigint.bufferRead" | "bigint.bufferWrite" | "bigint.dataViewGet" | "bigint.dataViewSet"
1955
- /** fs.statSync → a Stats value (may throw, like the other sync fs
1956
- * calls); the stats.* getters are pure reads on it. */
1957
- | "fs.statSync" | "stats.isFile" | "stats.isDirectory" | "stats.size" | "stats.dev" | "stats.ino"
1958
- /** child_process.spawnSync (scr_child.c): posix_spawn + waitpid + piped
1959
- * utf8 capture — cmd borrowed, args one borrowed string[] (the frontend
1960
- * completes an omitted list to an empty literal), result an owned (+1)
1961
- * spawnRes. NEVER throws: spawn failure (nonexistent binary, EACCES) is
1962
- * data, like Node's error property — status null and empty outputs
1963
- * (SEMANTICS.md documents the divergence from Node's null stdout).
1964
- * The getters are pure reads: status is the interned `number | null`
1965
- * union (null = spawn failure or signal death, type-directed
1966
- * construction in the backend like process.envGet); stdout/stderr are
1967
- * +1 strings. */
1968
- | "cp.spawnSync" | "spawnRes.status" | "spawnRes.stdout" | "spawnRes.stderr"
1969
- /** Node's spawn-failure carrier `error?: Error`: a fresh +1 %Error
1970
- * ("spawnSync <file> ENOENT", `code` stamped) when the spawn itself
1971
- * failed, the interned undefined arm otherwise — the result type is the
1972
- * call site's `Error | undefined` union, constructed type-directedly in
1973
- * the backend (the envGet convention). Never throws. */
1974
- | "spawnRes.error"
1975
- /** child_process.spawn (scr_child.c + the scr_async.c loop): posix_spawnp
1976
- * with per-slot ignore/inherit/pipe modes (and number output fds), the
1977
- * all-piped Node default, and the child registered with the event loop,
1978
- * which polls waitpid(WNOHANG) at quiescence like timers.
1979
- * NEVER throws: spawn failure defers to the "error" event, Node-exact
1980
- * (the error message is Node's "spawn <cmd> <ERRNO-NAME>"; an "error"
1981
- * event with no listener prints it and exits 1 like an EventEmitter).
1982
- * cmd/args borrowed; result an owned (+1) child handle. The loop will
1983
- * not exhaust while any spawned child is unreaped — Node's keep-alive.
1984
- *
1985
- * child.onExit / child.onClose / child.onError — terminal listener
1986
- * registration through child.on/once. Close uses the exit adapter shape
1987
- * but fires only after every piped stdio handle reaches EOF. The
1988
- * receiver is borrowed, the CALLBACK MOVES into the child's listener
1989
- * registry (released after the terminal event fires, or at reap for
1990
- * the event that never fires). Both are void (chaining is fenced).
1991
- * onExit's third emitted ingredient is an ADAPTER the backend interns
1992
- * per callback shape: the runtime invokes adapter(cb, has_code, code)
1993
- * and the adapter builds the `number | null` union (tags are program-
1994
- * dependent) or ignores the code for a zero-param callback. onError's
1995
- * adapters are runtime-provided (zero-param, or the %Error one-param
1996
- * shape — scr_error_new needs no program types). "exit" fires once
1997
- * with the code (f64 arm) or null (signal death); "error" fires only
1998
- * for spawn failure, exactly Node's split. */
1999
- | "cp.spawn"
2000
- /** Static-native fork startup and IPC. process.forkTarget initializes a
2001
- * re-executed child's inherited channel and returns its embedded target id
2002
- * (-1 in the parent). The remaining entries mirror Node's JSON channel. */
2003
- | "process.forkTarget" | "cp.fork" | "child.connected" | "child.send" | "child.sendCb" | "child.disconnect" | "child.onMessage" | "child.onDisconnect" | "child.onSpawn"
2004
- /** Rest listeners use the checked function bridge to pack event arguments. */
2005
- | "child.onDyn" | "process.connected" | "process.send" | "process.sendCb" | "process.disconnect" | "process.onMessage" | "process.onDisconnect"
2006
- /** child_process.execFile's callback slice: starts an all-piped child,
2007
- * captures stdout/stderr, and moves the error-first callback into the
2008
- * child registry. The callback shape is program-dependent and checked
2009
- * by the validator/backends. */
2010
- | "cp.execFile" | "child.onExit" | "child.onClose" | "child.onError"
2011
- /** The ChildProcess lifecycle members (scr_child.c), Node's shapes
2012
- * exactly (SEMANTICS.md has the pinned matrix). child.pid is the
2013
- * checker's `number | undefined` (undefined = spawn failure) and
2014
- * child.exitCode its `number | null` (null while running and after a
2015
- * signal death; -errno once a spawn failure settled) — both unions are
2016
- * type-directed constructions in the backend over a has/get runtime
2017
- * pair, the spawnRes.status pattern. child.killed is Node's
2018
- * sent-a-signal flag. child.kill sends while the child is un-reaped
2019
- * (false after — Node's null-handle answer) and THROWS the
2020
- * Unknown-signal TypeError on bad names (may-throw); killNum passes
2021
- * numbers through (0 probes; never throws). child.unref drops the
2022
- * child from the loop's keep-alive set — it is still reaped while the
2023
- * loop runs for other reasons, and one the loop never reaps is left to
2024
- * the OS at exit. All receivers borrowed. */
2025
- | "child.pid" | "child.exitCode" | "child.killed" | "child.kill" | "child.killNum" | "child.unref" | "child.ref"
2026
- /** The piped-output streams (stdio mode 3 — scr_child.c's stream
2027
- * slice). child.stdout/child.stderr answer the checker's
2028
- * `Readable | null` union (type-directed construction in the backend
2029
- * over the +1-or-NULL runtime pair — the child.pid pattern with a ref
2030
- * arm). stream.onData/onEnd register 'data'/'end' listeners (receiver
2031
- * borrowed, CALLBACK MOVES, trailing once-flag, void — chaining
2032
- * fenced): 'data' fires one Buffer chunk per read (zero-param and
2033
- * Buffer/string adapters are runtime-provided; setEncoding threads
2034
- * split multibyte sequences through the shared StringDecoder core. A
2035
- * union-param listener —
2036
- * ngrok's `Buffer | string` — gets a compiler-emitted adapter wrapping
2037
- * the chunk at its Buffer arm), 'end' fires once at EOF, always BEFORE
2038
- * the child's 'exit' (the pinned ordering). A flowing stream keeps the
2039
- * loop alive: usesTimers. */
2040
- | "child.stdout" | "child.stderr" | "stream.onData" | "stream.onDataStr" | "stream.onEnd" | "stream.childSetEncoding"
2041
- /** The piped-input writer (stdio mode 3 on fd 0). child.stdin answers
2042
- * `Writable | null`; writes copy borrowed data into the nonblocking
2043
- * queue, end/destroy settle it, writable is a pure state read, and
2044
- * listener callbacks move into the writer registry. */
2045
- | "child.stdin" | "writer.writeString" | "writer.writeBytes" | "writer.end" | "writer.destroy" | "writer.writable" | "writer.onDrain" | "writer.onFinish" | "writer.onError"
2046
- /** The first-class WritableStream write (`output.write(line)` — the
2047
- * prefixStream idiom): the receiver IS the fd scalar (process.stdout/
2048
- * stderr reads mint 1/2), dispatched onto the exact stdoutWrite/
2049
- * stderrWrite paths so buffering and ordering stay identical. Data
2050
- * borrowed; the bool is Node's always-true backpressure signal. */
2051
- | "procStream.write"
2052
- /** node:net (scr_net.c — linked, and scr_net_install() emitted, only
2053
- * when one of these appears on the IR; moduleUsesNet is the switch).
2054
- * Receivers are borrowed; CALLBACKS MOVE into the handle's listener
2055
- * registry and are released at settlement (the child.onExit story).
2056
- * All listener registrations carry a trailing BOOL once-flag (`on` vs
2057
- * `once`) and are void — chaining is fenced. None of these throw:
2058
- * listen/connect failures are the async 'error' event, like Node.
2059
- *
2060
- * net.createServer's optional connection handler and the
2061
- * serverOnConnection listeners take the runtime-provided adapters
2062
- * (zero-param, or the one-param socket shape); sockOnData's adapters
2063
- * are the stdin pair's shapes (zero-param / bytes chunk); the error
2064
- * events reuse the child %Error adapters. net.listen/net.listenCb bind
2065
- * NOW and defer 'listening' to the next loop turn (Node's next-tick
2066
- * emit); net.serverPort is the composed `server.address().port` read.
2067
- * net.connect's host argument is a string ("localhost" pins to
2068
- * 127.0.0.1 — SEMANTICS.md); the connect callback is once('connect'). */
2069
- | "net.createServer" | "net.createServerCb" | "net.listen" | "net.listenCb"
2070
- /** listen({ port, host, ipv6Only }[, cb]) — the explicit-interface bind
2071
- * (portless's listenOnProxyInterface): args [server, port, host,
2072
- * ipv6Only]. host is an IP literal string ("" = the host-less
2073
- * dual-stack any default); ipv6Only sets IPV6_V6ONLY before the bind.
2074
- * These are the old-shaped calls, retained for omitted reusePort so
2075
- * serialized IR remains compatible. Failures are the async 'error',
2076
- * message in Node's listen shape with the requested host. Never throws. */
2077
- | "net.listenOpts" | "net.listenOptsCb"
2078
- /** Additive ABI for listen({ ..., reusePort }) — args
2079
- * [server, port, host, ipv6Only, reusePort], with the callback following
2080
- * those values in the callback form. The final BOOL is the requested
2081
- * kernel connection-distribution option; old spellings remain
2082
- * four/five-argument calls so serialized IR stays compatible. */
2083
- | "net.listenOptsReusePort" | "net.listenOptsReusePortCb" | "net.serverPort" | "net.serverListening"
2084
- /** server.address() as the full AddressInfo record (the dgram.address
2085
- * materialization pattern: the emitter builds the record from the three
2086
- * runtime reads; the frontend pinned the shape). Never throws — before
2087
- * listen it answers the any-form defaults with port 0 where Node
2088
- * answers null (the serverPort stance). */
2089
- | "net.serverAddress" | "net.serverClose" | "net.serverCloseCb"
2090
- /** The close-override pair (the portless close-proxy idiom).
2091
- * serverCloseBind is `wrapper.close.bind(wrapper)` as a VALUE: a
2092
- * compiler-emitted closure over the server whose invocation runs the
2093
- * REAL close (scr_net_server_close_direct — never the override), so
2094
- * the override body's `origClose(cb)` cannot recurse; its callback
2095
- * argument (the `((err?: Error) => void) | undefined` union) registers
2096
- * as a once-'close' listener, a one-param callback wrapped by an
2097
- * emitted zero-arg trampoline firing the undefined arm (a clean close
2098
- * carries no error). serverSetCloseOverride is `wrapper.close = fn`:
2099
- * the override MOVES in behind an emitted zero-arg wrapper (it invokes
2100
- * the user function with the undefined-arm callback — tags are program
2101
- * data), and server.close() consults it before closing. */
2102
- | "net.serverCloseBind" | "net.serverSetCloseOverride" | "net.serverOnError" | "net.serverOnClose" | "net.serverOnConnection"
2103
- /** 'secureConnection' — the TLS server's deferred 'connection' list
2104
- * (handshake-completion timing); on a server without deferred
2105
- * connections (a plain net server) the registration never fires,
2106
- * exactly Node's split. */
2107
- | "net.serverOnSecureConnection" | "net.connect"
2108
- /** connect with a validated autoSelectFamilyAttemptTimeout option (the
2109
- * budget runs Node's validateInt32-from-1 ladder and is then inert —
2110
- * the single dial has nothing to time). May-throw. */
2111
- | "net.connectAttempt"
2112
- /** net.connect/createConnection over a RUNTIME option bag (computed
2113
- * keys — the invalid-input probes): Node-order validation (the
2114
- * objectMode trio's ERR_INVALID_ARG_VALUE, validatePort, host string,
2115
- * autoSelectFamily boolean, the attempt budget), then the trailing
2116
- * compiler-rendered fence — ALWAYS THROWS (the error.nodeThrow
2117
- * polymorphic-result carve-out). May-throw seed. */
2118
- | "net.connectOptsChk" | "net.connectCb"
2119
- /** connect({ port, host, autoSelectFamily: true, lookup }) — the
2120
- * caller-resolver dial (portless's createLoopbackConnection): args
2121
- * [port, host, lookup]. The runtime creates the (connecting) socket
2122
- * handle, invokes the lookup as Node does — lookup(hostname, options,
2123
- * callback), options crossing as the dyn undefined — and the answer
2124
- * closure (an emitter-synthesized per-shape thunk over a boxed socket,
2125
- * the SNI-answer pattern) dials the answered addresses IN ORDER: each
2126
- * connect failure tries the next, the LAST failure's message is the
2127
- * socket's 'error' (Node's autoSelectFamily aggregate is a documented
2128
- * divergence), and a lookup error surfaces as the deferred socket
2129
- * 'error'. A synchronous throw INSIDE the lookup propagates out of the
2130
- * connect call (may-throw seed). */
2131
- | "net.connectLookup" | "net.sockWrite" | "net.sockWriteBytes" | "net.sockEnd" | "net.sockEndStr" | "net.sockEndBytes"
2132
- /** write/end with a CHECKED-DYNAMIC chunk (an untyped JS payload into a
2133
- * typed socket): the runtime dispatches STR/BYTES and throws Node's
2134
- * ERR_INVALID_ARG_TYPE chunk TypeError on any other kind. */
2135
- | "net.sockWriteDyn" | "net.sockEndDyn" | "net.sockDestroy" | "net.sockPipe"
2136
- /** socket.pipe(res) — raw socket chunks into a ServerResponse body
2137
- * (the extended-CONNECT bridge leg): each chunk is a body write (the
2138
- * response's own framing applies); source EOF end()s the response,
2139
- * pipe's default. Borrows both. Never throws. */
2140
- | "net.sockPipeRes" | "net.sockOnData" | "net.sockOnEnd" | "net.sockOnClose" | "net.sockOnError" | "net.sockOnConnect"
2141
- /** node:dgram + node:dns (scr_dgram.c — linked, and
2142
- * scr_dgram_install() emitted, only when one of these appears on the
2143
- * IR; moduleUsesDgram is the switch — dns.lookup rides the same unit).
2144
- * The net listener discipline verbatim: receivers borrowed, CALLBACKS
2145
- * MOVE into the handle's registry and release at settlement, `on` vs
2146
- * `once` is the trailing bool, registrations are void. bind/connect
2147
- * bind NOW and defer 'listening'/'connect' to the next loop turn (the
2148
- * net.listen story); their optional-host completions are ""
2149
- * (bind → 0.0.0.0) and "127.0.0.1" (connect — udp4's Node default).
2150
- * bind/connect/send/close/address THROW Node's state errors ("Socket
2151
- * is already bound", "Already connected", "Not running") — may-throw
2152
- * seeded. dgram.address returns the AddressInfo RECORD (the frontend
2153
- * pins the {address, family, port} shape; the emitter builds it from
2154
- * runtime parts). onMessage adapters are emitted per rinfo record
2155
- * shape (the child.onExit precedent); onError reuses the child %Error
2156
- * adapters. dns.lookup resolves via getaddrinfo AT CALL TIME and
2157
- * defers the callback to the next turn (SEMANTICS.md documents the
2158
- * blocking divergence); its per-union adapter builds the
2159
- * `Error | null` first argument. */
2160
- | "dgram.createSocket" | "dgram.bind" | "dgram.bindCb" | "dgram.connect" | "dgram.connectCb" | "dgram.sendStr" | "dgram.sendBytes"
2161
- /** The send argument-validation ladder over dyn arguments (Node's
2162
- * signature shuffle: slice bounds, list/type contracts, port/address
2163
- * validation, connected-state errors) — a fully-validated unconnected
2164
- * single-payload send RUNS; callback/list/connected forms meet the
2165
- * trailing fence. May-throw. */
2166
- | "dgram.sendChk" | "dgram.address" | "dgram.close" | "dgram.closeCb" | "dgram.unref" | "dgram.ref" | "dgram.onMessage" | "dgram.onError" | "dgram.onListening" | "dgram.onClose" | "dgram.onConnect" | "dns.lookup"
2167
- /** node:test (scr_test.c — linked only when one of these appears on
2168
- * the IR; moduleUsesNodeTest is the switch, and the main epilogue asks
2169
- * scr_test_exit_code() for the process's exit status). Strings are
2170
- * BORROWED, callbacks MOVE. register/suite/hook attach to the runner
2171
- * tree (register: name, mode 0|1|2 run/skip/todo, directive message ""
2172
- * = none, cb or absent via registerEmpty, flags 1 async | 2 takes-ctx
2173
- * | 4 only, "file:line:col"); suite runs its body AT registration
2174
- * (Node's collection phase). sub is t.test — runs the subtest INLINE
2175
- * on the runner fiber and returns the settled promise the await
2176
- * consumes. ctxSkip/ctxTodo mark the running test; ctxDiagnostic
2177
- * queues an ℹ line; ctxName reads t.name. Every registration keeps
2178
- * the loop-run emitted (usesTimers) so the runner fiber drains. */
2179
- | "test.register" | "test.registerEmpty" | "test.suite" | "test.hook" | "test.sub" | "test.subEmpty" | "test.ctxSkip" | "test.ctxTodo" | "test.ctxDiagnostic" | "test.ctxName"
2180
- /** node:http, the server slice (scr_http.c over scr_net.c — linked
2181
- * only when these appear on the IR; moduleUsesHttpServer is the
2182
- * switch, and any http.* libCall also counts as net use so scr_net.c
2183
- * links and installs). http.createServer's handler MOVES in and takes
2184
- * the runtime adapters for its (req, res) / (req) / () shapes; req
2185
- * body listeners follow the net.sockOnData story (bytes chunks, once
2186
- * flags); reqHeader answers the interned `string | undefined` union
2187
- * exactly like process.envGet; the res writers are borrowed-argument
2188
- * voids with Node's framing decided in the runtime (Content-Length
2189
- * for end-before-head, chunked after an explicit writeHead/write). */
2190
- | "http.createServer"
2191
- /** http.createServer() / http.Server() with no handler — the
2192
- * on("request") route; option helpers set parser behavior on a fresh
2193
- * server before the constructor/factory result is returned. */
2194
- | "http.createServerEmpty" | "http.validateHeaderName" | "http.validateHeaderValue" | "http.serverJoinDupHeaders" | "http.serverAllowMissingHostHeader"
2195
- /** The five writable numeric http.Server timeout fields use one
2196
- * selector ABI: 0 timeout, 1 keepAliveTimeout, 2 headersTimeout,
2197
- * 3 requestTimeout, 4 keepAliveTimeoutBuffer. These calls store/read
2198
- * the property values; timer enforcement remains outside this surface.
2199
- * The constructor-option setter takes dyn so explicit undefined remains
2200
- * distinguishable from a numeric value until its Node validation ladder. */
2201
- | "http.serverTimeoutGet" | "http.serverSetTimeout" | "http.serverSetTimeoutCb" | "http.serverOnTimeout" | "http.serverCloseAllConnections" | "http.serverCloseIdleConnections" | "http.serverTimeoutSet" | "http.serverTimeoutOptionSet"
2202
- /** server.on("listening", cb) — the deferred listen-callback list. */
2203
- | "net.serverOnListening"
2204
- /** The ServerResponse member surface: statusCode/statusMessage reads
2205
- * and assignments (Node's writable properties), the header CRUD trio
2206
- * (getHeader answers `string | undefined` like reqHeader), and
2207
- * end(cb)'s finish slot (resOnFinish registers, the end call follows —
2208
- * the callback fires deferred, Node's 'finish' emit). writeHead's
2209
- * statusMessage forms compose in interned helpers: resStatusMsgSet
2210
- * then the ordinary writeHead entry. */
2211
- | "http.resStatusGet" | "http.resStatusSet" | "http.resStatusMsgGet" | "http.resStatusMsgSet" | "http.resRequest" | "http.resSocket" | "http.resWritableFinished" | "http.resSendDateGet" | "http.resSendDateSet" | "http.resStrictContentLengthGet" | "http.resStrictContentLengthSet" | "http.resSetTimeout" | "http.resSetTimeoutCb" | "http.resGetHeader" | "http.resGetHeaderNames" | "http.resGetRawHeaderNames" | "http.resGetHeaders" | "http.resHasHeader" | "http.resRemoveHeader" | "http.resOnFinish" | "http.reqUrl" | "http.reqMethod" | "http.reqHeader" | "http.reqTrailer" | "http.reqHeaderValues" | "http.reqTrailerValues" | "http.reqOnData" | "http.reqOnEnd" | "http.resSetHeader" | "http.resWriteHead" | "http.resWriteHeadN"
2212
- /** HTTP/1.1 informational heads; early hints takes flat string pairs,
2213
- * with a lowercase `link` key required to send anything. */
2214
- | "http.resWriteContinue" | "http.resWriteProcessing" | "http.resWriteEarlyHints" | "http.resWrite" | "http.resWriteBytes" | "http.resEnd" | "http.resEndStr" | "http.resEndBytes"
2215
- /** The checked-dynamic chunk twins (the net.sockWriteDyn story). */
2216
- | "http.resWriteDyn" | "http.resEndDyn" | "http.resHeadersSent" | "http.resWritableEnded" | "http.resFlushHeaders" | "http.resAddTrailers" | "http.resCork" | "http.resUncork" | "http.resWritableCorked"
2217
- /** The server-surface member follow-ups: reqStatusCode answers the
2218
- * interned `number | undefined` union (negative = the undefined arm —
2219
- * a SERVER request, where Node's statusCode is undefined; every client
2220
- * response carries a real status); reqSocket is the underlying
2221
- * connection (+1, the same handle net.connect would give);
2222
- * sockRemoteAddress answers `string | undefined` (NULL after the fd
2223
- * closed, Node's destroyed-socket undefined; a dual-stack accept of an
2224
- * IPv4 peer reads "::ffff:a.b.c.d" like Node). reqResume/reqDestroy and
2225
- * the req error/close listener slots complete the IncomingMessage
2226
- * surface portless's client responses use; resDestroy/resOnClose and
2227
- * resWriteHeadPairs ([k0,v0,k1,v1,...] — the env.pairs helper's flat
2228
- * shape) complete ServerResponse. sockSetTimeout arms the idle
2229
- * EVFILT_TIMER ('timeout' fires after ms of inactivity, once per idle
2230
- * period, never destroying the socket — Node's semantics). */
2231
- | "http.reqStatusCode" | "http.reqSocket" | "http.reqH2Stream" | "http.reqH2StreamOrThrow" | "http.reqResume"
2232
- /** req.rawHeaders — [name, value, name, value, ...] in arrival order,
2233
- * names in their ORIGINAL case (Node's shape); a fresh string[] per
2234
- * read. reqStatusMessage answers the interned `string | undefined`
2235
- * union — the reason phrase on client responses ("" when the status
2236
- * line carried none), the undefined arm on server requests (the
2237
- * statusCode split). sockDestroyed is socket.destroyed — true once the
2238
- * fd is gone (destroy() or full close). */
2239
- | "http.reqRawHeaders" | "http.reqRawTrailers" | "http.reqStatusMessage"
2240
- /** The `{ ...req.headers }` snapshot feed: [lowercased name, value,
2241
- * ...] pairs in arrival order — the interned %headers.snapshot helper
2242
- * builds the record over it, exactly the process.envPairs pattern. */
2243
- | "http.reqHeaderPairs" | "http.reqTrailerPairs" | "net.sockDestroyed"
2244
- /** socket.writable — the write half is open: no end() yet, no FIN sent,
2245
- * fd alive (connecting sockets answer true; writes queue). Node's
2246
- * stream flag. Borrows; never throws. */
2247
- | "net.sockWritable"
2248
- /** The 'upgrade' events, both sides (SEMANTICS.md — the WebSocket
2249
- * proxying surface): serverOnUpgrade registers (req, socket, head)
2250
- * listeners fired INSTEAD of 'request' for Connection: upgrade
2251
- * requests (the parser steps aside; the socket is raw; `head` carries
2252
- * bytes past the request head; no listener = the socket destroys,
2253
- * Node's default). clientOnUpgrade is the client twin: a 101 response
2254
- * fires (res, socket, head) INSTEAD of 'response'. */
2255
- | "http.serverOnUpgrade" | "http.clientOnUpgrade"
2256
- /** server.on("connect", ...) — HTTP CONNECT tunneling, the 'upgrade'
2257
- * machinery's twin: (req, socket, head) fired INSTEAD of 'request' for
2258
- * CONNECT-method requests (no listener = the socket destroys, Node's
2259
- * default). The h2 compat server's 'connect' (portless's RFC 8441
2260
- * handler) only ever sees the HTTP/1.1 arm under the allowHTTP1
2261
- * lowering, so a listener whose second parameter is a UNION with a
2262
- * netSocket arm takes the socket wrapped at that arm (an emitted
2263
- * per-shape adapter — the tags are program data). */
2264
- | "http.serverOnConnect"
2265
- /** req.pipe(dest) — the IncomingMessage body streaming into a
2266
- * ServerResponse (the proxy's response leg), a ClientRequest (the
2267
- * request-body forward), or a raw socket (the upgrade-rejection leg);
2268
- * chunk-for-chunk, natural end ends the destination (Node's pipe
2269
- * default; no backpressure — divergence 54's stream model). */
2270
- | "http.reqPipeRes" | "http.reqPipeClient" | "http.reqPipeSock" | "http.reqDestroy" | "http.reqOnError" | "http.reqOnClose" | "http.reqOnAborted" | "http.reqHttpVersion" | "http.reqHttpVersionMajor" | "http.reqHttpVersionMinor" | "http.reqAborted" | "http.reqComplete" | "http.resDestroy" | "http.resOnClose" | "http.resWriteHeadPairs"
2271
- /** writeHead(status, headers) with a checked-dynamic headers value —
2272
- * the runtime OBJ walk (string/number values; loud fences otherwise;
2273
- * may throw). */
2274
- | "http.resWriteHeadDyn" | "net.sockSetTimeout"
2275
- /** setEncoding('utf8') — 'data' delivers strings inside the chunk-encoding window; other real encodings fence loudly, unknown names throw ERR_UNKNOWN_ENCODING (may throw). */
2276
- | "net.sockSetEncoding" | "http.reqSetEncoding" | "net.sockOnTimeout" | "net.sockRemoteAddress"
2277
- /** The paused-mode demux surface (portless's first-byte TLS peek:
2278
- * once('readable') + read(1) + unshift + emit('connection')).
2279
- * sockOnReadable registers a zero-param listener (a consumer: arrived
2280
- * bytes buffer instead of flowing, and EOF announces too); sockRead
2281
- * answers `Buffer | null` (exactly n buffered bytes, or null — Node's
2282
- * less-than-n answer; n <= 0 drains everything); sockUnshift returns
2283
- * bytes to the front of the stream; serverEmitConnection routes a
2284
- * socket into another server's protocol layer (a TLS target's
2285
- * 'connection' waits for its handshake). */
2286
- | "net.sockOnReadable" | "net.sockRead" | "net.sockUnshift"
2287
- /** Socket flow control and the compat surface: pause/resume (reads
2288
- * gate off/on — kernel backpressure holds paused bytes; resume flows
2289
- * and discards sans listeners) and setNoDelay answer the SOCKET (+1,
2290
- * Node's chaining); destroySoon ends now and destroys once the FIN
2291
- * flushed; bytesWritten counts accepted bytes; readable is true until
2292
- * the read half ends. */
2293
- | "net.sockPause" | "net.sockResume" | "net.sockSetNoDelay" | "net.sockDestroySoon" | "net.sockBytesWritten" | "net.sockReadable"
2294
- /** socket.on('finish', cb) / end(cb): fires once when the FIN goes out
2295
- * (sweep-deferred, never the registering stack). */
2296
- | "net.sockOnFinish" | "net.serverEmitConnection"
2297
- /** node:http, the CLIENT slice (http.request/http.get over the net
2298
- * client machinery): request/requestCb take (host, port, path, method,
2299
- * timeoutMs, headerPairs, autoEnd[, responseCb]) — headerPairs is the
2300
- * flat [k0,v0,...] array (empty for none), autoEnd true is http.get's
2301
- * eager end(). The handle owns one dialed connection (NO pooling — the
2302
- * wire still carries Node's exact head: user headers, then Host,
2303
- * Connection: keep-alive, and the framing header; the socket closes
2304
- * when the response completes). The response delivered to responseCb /
2305
- * 'response' listeners IS an httpReq (IncomingMessage), status and
2306
- * headers parsed from the wire, body via reqOnData/reqOnEnd. Errors are
2307
- * Node-shaped ('connect ECONNREFUSED ip:port', 'socket hang up') and
2308
- * fire 'error' then 'close'; an unhandled 'error' exits 1 like every
2309
- * net handle. clientWrite before end commits to chunked framing unless
2310
- * the caller set content-length; clientEnd(data) before any write sends
2311
- * Content-Length exactly like Node. */
2312
- | "http.request" | "http.requestCb"
2313
- /** new http.Agent(opts) / new https.Agent(opts): (secure, keepAlive,
2314
- * keepAliveMsecs, maxSockets, maxFreeSockets, timeoutMs, port) — the
2315
- * numeric options arrive < 0 for "unset" (Infinity/256/none; port
2316
- * seeds the settable defaultPort, Node's option merge). Returns the
2317
- * Agent as a checked-dynamic HANDLE (getName/destroy and the
2318
- * sockets/requests/freeSockets counters dispatch through the dyn
2319
- * handle ops). keepAlive: true THROWS the named construction fence —
2320
- * socket POOLING is not modeled (one dial per request); maxSockets
2321
- * accounting is real: over-limit requests defer their dial and queue.
2322
- * MAY THROW. */
2323
- | "http.agentNew"
2324
- /** The agent-threaded request rows: the http.request/https.request
2325
- * shape with a trailing `agent` dyn argument (an Agent handle, false —
2326
- * the one-shot Connection: close dial — or null/undefined for the
2327
- * default path). port < 0 means "no port option": the agent's settable
2328
- * defaultPort, then the scheme's. MAY THROW (a non-Agent value is
2329
- * Node's ERR_INVALID_ARG_TYPE). */
2330
- | "http.requestAgent" | "http.requestAgentCb" | "https.requestAgent" | "https.requestAgentCb"
2331
- /** The createConnection form (the proxy's own dialer): args are
2332
- * (connCb, path, method, timeout, headers, autoEnd[, cb]) — connCb is
2333
- * a `() => net.Socket` closure the runtime invokes ONCE, synchronously
2334
- * (Node's onSocket timing); everything else matches http.request. The
2335
- * Host header defaults to "localhost" — a headers.host entry wins
2336
- * verbatim, the proxy shape. */
2337
- | "http.requestConn" | "http.requestConnCb"
2338
- /** node:tls + node:https (scr_tls.c over scr_net.c/scr_http.c, with
2339
- * the vendored mbedTLS archive — linked only when one of these appears
2340
- * on the IR; moduleUsesTls is the switch, and every tls/https libCall
2341
- * also counts as net AND http use so both units link and install).
2342
- * tls.createServer takes (cert, key[, handler]) — cert/key are PEM
2343
- * strings or Buffers (the emitter passes data+len for either); the
2344
- * handler is Node's 'secureConnection' (fires post-handshake with a
2345
- * socket that behaves exactly like a net socket, the same adapters as
2346
- * net.createServer). https.createServer is (cert, key, handler) with
2347
- * the http request-handler adapters. https.request/requestCb extend
2348
- * the http client row with (…, rejectUnauthorized: bool, ca: PEM
2349
- * string/Buffer — "" for none) and default port 443; everything else
2350
- * (write/end/destroy/events, the response surface) IS the http client
2351
- * surface — the handles are the same kinds. */
2352
- | "tls.createServer" | "tls.createServerCb"
2353
- /** RUNTIME options records (the divergence-66 stance): the *Dyn
2354
- * creators take a checked-dynamic (dyn) options value whose members
2355
- * read at runtime — cert/key extract like the literal path, members
2356
- * whose literal forms fence THROW the catchable fence at runtime, and
2357
- * undocumented keys drop like Node drops them. tls.pemDyn is the
2358
- * literal walk's runtime-valued cert/key extraction: (value, whatLit)
2359
- * → PEM bytes (strings/Buffers/one-element arrays of those) or the
2360
- * thrown fence. All of them may throw. */
2361
- | "tls.pemDyn" | "tls.createServerDyn" | "tls.createServerDynCb" | "https.createServerDyn" | "https.createServerDynCb"
2362
- /** tls.connect — the TLS client socket: (port, host, opts[, cb]) where
2363
- * port -1 reads options.port, host "" reads options.host, and opts is
2364
- * the runtime (dyn) options record (rejectUnauthorized/ca/servername
2365
- * implemented; other documented members throw the runtime fence). The
2366
- * callback fires post-handshake — Node's secureConnect timing. */
2367
- | "tls.connect" | "tls.connectCb"
2368
- /** The TLSSocket member surface on the socket kind: authorized (bool —
2369
- * Node's verify verdict), authorizationError (the verify-failure CODE
2370
- * STRING or null), the 'secureConnect' registration (a TLS socket's
2371
- * conn list fires at establishment; plain sockets never fire it), and
2372
- * the 'session' registration (fires once with the serialized session —
2373
- * a Buffer; the received-ticket event). */
2374
- | "tls.sockAuthorized" | "tls.sockAuthError" | "tls.sockOnSecureConnect" | "tls.sockOnSession"
2375
- /** tls.createSecureContext({ cert, key }) — parses the PEM pair into an
2376
- * opaque SecureContext handle (secureCtx kind) for SNI callbacks to
2377
- * answer with; cert/key are PEM strings or Buffers like createServer's. */
2378
- | "tls.createSecureContext"
2379
- /** createSecureContext over a RUNTIME options record (the checked-
2380
- * dynamic lane): Node's typed option validations first (the ciphers/
2381
- * passphrase/engine/version/timeout/ticketKeys ladders), then the pem
2382
- * walk — a validated { cert, key } bag builds the real context.
2383
- * May-throw. */
2384
- | "tls.createSecureContextDyn"
2385
- /** tls.getCACertificates(type): validateString + the documented name
2386
- * set, then the trailing compiler-rendered fence — ALWAYS THROWS (the
2387
- * error.nodeThrow polymorphic-result carve-out). May-throw seed. */
2388
- | "tls.caCertsChk"
2389
- /** The CA-store introspection surface (scr_tls_ca.c — its own unit and
2390
- * link gate, "tlsca." NOT "tls.", so a getCACertificates-only binary
2391
- * never pulls mbedTLS): tlsca.get is tls.getCACertificates(type) — the
2392
- * cached per-type string[] of PEM blocks (identity-stable across calls,
2393
- * Node's caching; an unknown type throws Node's ERR_INVALID_ARG_VALUE
2394
- * TypeError); tlsca.root is the tls.rootCertificates value read;
2395
- * tlsca.set is tls.setDefaultCACertificates(certs) — replaces the
2396
- * default set (deduped) and the anchors the TLS client verifies
2397
- * against, throwing Node's ERR_CRYPTO_OPERATION_FAILED when no entry
2398
- * carries a certificate block. */
2399
- | "tlsca.get" | "tlsca.root" | "tlsca.set" | "https.createServer" | "https.request" | "https.requestCb"
2400
- /** The URL-string first argument, the http.requestUrl row over TLS:
2401
- * no options means Node's defaults (verification on, default trust
2402
- * anchors), and a non-https scheme is ERR_INVALID_PROTOCOL. */
2403
- | "https.requestUrl" | "https.requestUrlCb"
2404
- /** A call through a `const requestFn = tls ? https.request :
2405
- * http.request` binding — the module-function-as-value ternary between
2406
- * the two known clients: the https.request row with a leading `secure`
2407
- * bool that picks the dial at RUNTIME (true = the TLS client, exactly
2408
- * https.request; false = the plain client, exactly http.request —
2409
- * rejectUnauthorized/ca ignored there like Node ignores TLS options on
2410
- * http.request). The "https." prefix keeps the TLS unit linked. */
2411
- | "https.requestFn" | "https.requestFnCb"
2412
- /** node:http2 allowHTTP1: one TLS server advertises h2 + http/1.1 and
2413
- * dispatches to the matching parser after ALPN. Request listeners mirror
2414
- * into both compatibility lists; the remaining session/req.stream rows
2415
- * below retain their explicitly limited behavior. */
2416
- | "http2.createSecureServer"
2417
- /** createSecureServer(options, handler) — the eager COMPAT handler as
2418
- * the first 'request' listener (Node's exact route), on both literal
2419
- * flavors: Req is the dual ALPN allowHTTP1 server, H2Req the ALPN=h2-only
2420
- * server (both use compat handles over h2 streams). Args are
2421
- * (cert, key, cb, enableConnectProtocol). */
2422
- | "http2.createSecureServerReq" | "http2.createSecureServerH2Req"
2423
- /** createSecureServer with a RUNTIME options record (the divergence-66
2424
- * stance): allowHTTP1/cert/key read at runtime — allowHTTP1 picks the
2425
- * flavor, the TLS server walk fences its out-of-bounds members with
2426
- * the catchable runtime fence, and h2 session-tuning keys drop exactly
2427
- * like the literal walk ignores them. May throw. The Cb form carries
2428
- * the eager compat handler. */
2429
- | "http2.createSecureServerDyn" | "http2.createSecureServerDynCb"
2430
- /** createSecureServer with an SNI callback: args are (cert, key, sniCb)
2431
- * where sniCb is the JS SNICallback — a `(servername, cb) => void`
2432
- * closure, or the `SNICallback | undefined` union from the conditional-
2433
- * spread spelling (`...(x ? { SNICallback: x } : {})`; the emitter
2434
- * unwraps the union — the undefined arm means "no callback", exactly
2435
- * the no-SNI server). The runtime parses each connection's ClientHello
2436
- * for the server_name extension BEFORE the TLS handshake begins, calls
2437
- * the callback with (servername, answer-closure), and resumes the
2438
- * handshake when the answer arrives — cb(err) tears the socket down
2439
- * silently (Node's 'tlsClientError' default), cb(null, ctx) serves
2440
- * ctx's cert/key, cb(null, undefined) serves the default pair. */
2441
- | "http2.createSecureServerSni"
2442
- /** The REAL h2-over-TLS server (createSecureServer WITHOUT allowHTTP1):
2443
- * scr_http2_create_secure_server — the h2c session machinery behind an
2444
- * mbedTLS handshake whose ALPN advertises h2 alone (an http/1.1-only
2445
- * client fails the handshake with no_application_protocol, Node's
2446
- * h2-only split). args are (cert, key) — PEM strings or Buffers. */
2447
- | "http2.createSecureServerH2" | "http.serverOnRequest" | "http2.serverOnSessionError"
2448
- /** The guarded absent-session compatibility call remains a no-op. */
2449
- | "http2.streamNoop"
2450
- /** The UNGUARDED h2-only stream call (`req.stream.on(...)`): stream is
2451
- * undefined on every connection the allowHTTP1 lowering accepts — and
2452
- * on every HTTP/1.1 connection of Node's own allowHTTP1 server — so the
2453
- * call IS Node's member read on undefined: throws the exact catchable
2454
- * TypeError ("Cannot read properties of undefined (reading 'on')").
2455
- * One arg: the read member's name (a string literal). Never returns. */
2456
- | "http2.streamUndefCall"
2457
- /** node:http2, the REAL h2c surface (scr_http2.c — frame codec + HPACK
2458
- * over the net loop; the design note atop that file has the story).
2459
- * Sessions and streams are first-class handle kinds; 'stream'/'response'
2460
- * payloads cross as flat [name, value, ...] pairs arrays and an EMITTED
2461
- * adapter closure builds the program-side headers record (the response
2462
- * :status rides separately as a number). */
2463
- | "http2.createServer" | "http2.createServerReq" | "http2.serverOnStream" | "http2.serverOnSession"
2464
- /** connect(authority[, listener]) — h2c prior knowledge; the listener
2465
- * closure (if any) is the 'connect' once-listener. */
2466
- | "http2.connect" | "http2.connectCb"
2467
- /** session.request(pairs?, endStream) — endStream is a tri-state f64:
2468
- * -1 the method's payload-meaningless default, 0/1 explicit. */
2469
- | "http2.sessionRequest" | "http2.sessionClose" | "http2.sessionCloseCb" | "http2.sessionDestroy" | "http2.sessionOnClose" | "http2.sessionOnError" | "http2.sessionOnConnect" | "http2.sessionOnStream" | "http2.sessionOnGoaway" | "http2.sessionSettings0" | "http2.sessionSettings" | "http2.sessionSettingsDynCb" | "http2.sessionSettingsCb0" | "http2.sessionOnSettingsDyn" | "http2.sessionOnSettings0" | "http2.sessionSettingsGet" | "http2.sessionPendingSettingsAck" | "http2.getDefaultSettings" | "http2.sessionClosed" | "http2.sessionDestroyed" | "http2.sessionEncrypted" | "http2.sessionType" | "http2.sessionAlpn" | "http2.sessionSocket"
2470
- /** stream.respond(pairs?, endStream) — the server answer. */
2471
- | "http2.streamRespond" | "http2.streamWrite" | "http2.streamWriteBytes" | "http2.streamEnd" | "http2.streamEndStr" | "http2.streamEndBytes" | "http2.streamClose" | "http2.streamCloseCb" | "http2.streamDestroy" | "http2.streamSetEncoding" | "http2.streamSetEncodingRet" | "http2.streamResume" | "http2.streamPause" | "http2.streamOnData" | "http2.streamOnEnd" | "http2.streamOnClose" | "http2.streamOnAborted" | "http2.streamOnError" | "http2.streamOnResponse" | "http2.streamId" | "http2.streamRstCode" | "http2.streamDestroyed" | "http2.streamClosed" | "http2.streamAborted" | "http2.streamPending" | "http2.streamSession"
2472
- /** socket.encrypted — `boolean | undefined`: the true arm iff the
2473
- * socket carries a TLS transport (Node types `encrypted: true` on
2474
- * TLSSocket; plain sockets answer undefined — the proxy.ts isEncrypted
2475
- * idiom reads it through a cast). */
2476
- | "net.sockEncrypted" | "http.clientWrite" | "http.clientSetHeader" | "http.clientGetHeader" | "http.clientHasHeader" | "http.clientRemoveHeader" | "http.clientGetHeaderNames" | "http.clientGetRawHeaderNames" | "http.clientGetHeaders" | "http.clientWriteBytes" | "http.clientEnd" | "http.clientEndStr" | "http.clientEndBytes"
2477
- /** The checked-dynamic chunk twins (the net.sockWriteDyn story). */
2478
- | "http.clientWriteDyn" | "http.clientEndDyn" | "http.clientFlushHeaders" | "http.clientAddTrailers" | "http.clientCork" | "http.clientUncork" | "http.clientWritableCorked" | "http.clientMethod" | "http.clientPath" | "http.clientHost" | "http.clientProtocol" | "http.clientHeadersSent" | "http.clientWritableEnded" | "http.clientWritableFinished" | "http.clientSocket" | "http.clientReusedSocket" | "http.clientSetNoDelay" | "http.clientSetSocketKeepAlive" | "http.clientSetTimeout" | "http.clientSetTimeoutCb" | "http.statusCodes" | "http.methods" | "http.reqSetTimeout" | "http.reqSetTimeoutCb"
2479
- /** request/get with a URL-STRING first argument: the runtime parses it
2480
- * (WHATWG) and dials — throws catchably on an unparsable input or a
2481
- * non-http scheme. */
2482
- | "http.requestUrl" | "http.requestUrlCb" | "http.clientDestroy" | "http.clientAbort" | "http.clientAborted" | "http.clientDestroyed" | "http.clientOnResponse" | "http.clientOnSocket" | "http.clientOnFinish" | "http.clientOnError" | "http.clientOnTimeout" | "http.clientOnClose" | "http.clientOnAbort"
2483
- /** fs/promises (scr_lib.c over scr_async.c's settled minting): the SAME
2484
- * sync syscalls, wrapped in an ALREADY-SETTLED promise — failure
2485
- * REJECTS (catchable at the await) instead of throwing, so none of
2486
- * these are in the may-throw seed. readFile is utf8-fenced like
2487
- * readFileSync. The non-interleaving divergence is documented in
2488
- * SEMANTICS.md. */
2489
- /** node:crypto randomness: randomUUID plus randomBytes as either a real
2490
- * Buffer or the fused randomBytes(n).toString("hex"|"base64") path.
2491
- * The size-taking forms throw Node's RangeError on invalid values. */
2492
- | "crypto.randomUUID" | "crypto.randomBytesToString"
2493
- /** The fused createHash(alg).update(data).digest(enc) fast path and the
2494
- * one-shot crypto.hash implementation. First-class Hash/Hmac handles use
2495
- * the entries below; all paths share the incremental runtime core. */
2496
- | "crypto.hashDigestStr" | "crypto.hashDigestBytes"
2497
- /** First-class static Hash/Hmac handles. Constructors validate the
2498
- * runtime algorithm string (MD5, SHA-1, or SHA-2); update returns the same
2499
- * handle by retained identity, copy snapshots Hash state, and digest
2500
- * finalizes the handle and returns either a Buffer or encoded string. */
2501
- | "crypto.native" | "crypto.hashNew" | "crypto.hmacNewStr" | "crypto.hmacNewBytes" | "crypto.hashUpdateStr" | "crypto.hashUpdateBytes" | "crypto.hmacUpdateStr" | "crypto.hmacUpdateBytes" | "crypto.hashCopy" | "crypto.hashDigestString" | "crypto.hashDigestBuffer" | "crypto.hmacDigestString" | "crypto.hmacDigestBuffer" | "crypto.timingSafeEqual" | "crypto.randomFill" | "crypto.randomFillRest" | "crypto.randomInt" | "crypto.pbkdf2" | "crypto.randomBytesCb" | "crypto.pbkdf2Cb" | "crypto.hkdf" | "crypto.hkdfCb" | "crypto.scrypt" | "crypto.scryptCb"
2502
- /** crypto.randomBytes(n) → a real u8 Buffer (+1). THROWS Node's
2503
- * RangeError on out-of-range sizes, exactly like the composed
2504
- * randomBytesToString (which keeps its one-libCall lowering — the two
2505
- * coexist: the composed form never materializes the Buffer). */
2506
- | "crypto.randomBytes"
2507
- /** The Buffer statics with fixed (always-u8) signatures. fromStr is
2508
- * `Buffer.from(string, enc)` — the frontend completes an omitted
2509
- * encoding to "utf8" and fences non-literal/unsupported ones; hex and
2510
- * base64 decode Node-leniently, so it never throws. concat takes ONE
2511
- * bytes<u8>[] arg (the list) and returns a fresh copy. `Buffer.from(u8)`
2512
- * and `Buffer.alloc(n)` need no libFn — they lower to bytesNew. */
2513
- | "buffer.fromStr" | "buffer.brand"
2514
- /** Buffer.from on checked-native strings, bytes, arrays and data-only
2515
- * array-like/Buffer-JSON objects. The encoding is a normalized literal;
2516
- * non-string inputs ignore it. Copies the input and may throw during
2517
- * element coercion or argument validation. Custom object valueOf and
2518
- * opaque reference inputs retain explicit runtime refusals. */
2519
- | "buffer.fromDyn" | "buffer.concat"
2520
- /** Buffer.byteLength(string, enc) — enc a NORMALIZED literal like
2521
- * fromStr's — and Buffer.isEncoding(name) over a runtime string
2522
- * (case-insensitive against Node's alias set). Pure; never throw. */
2523
- | "buffer.byteLenDyn" | "buffer.byteLenStr" | "buffer.isEncoding"
2524
- /** Buffer.concat(list, totalLength): the concatenation truncated or
2525
- * zero-padded to the total. THROWS Node's 'length' RangeError on a
2526
- * negative/non-integer total (may-throw seed). */
2527
- | "buffer.concatLen"
2528
- /** The checked-dynamic compare/equals validators (scr_bytes_io.c) —
2529
- * the lowered form when an argument is NOT statically bytes<u8> (the
2530
- * invalid-input probes; a dyn from an untyped JS helper): Node's own
2531
- * argument ladders run at runtime — ERR_INVALID_ARG_TYPE with the
2532
- * API's argument name ("buf1"/"buf2", "otherBuffer", "target"; offsets
2533
- * "of type number"), validateOffset's ERR_OUT_OF_RANGE for bad
2534
- * numbers, undefined offsets taking their Node defaults — and a
2535
- * well-typed value still computes the real answer. All args borrowed
2536
- * dyn; compareChk's four offset slots pass the undefined dyn when
2537
- * syntactically absent. May-throw seeds. */
2538
- | "buffer.compareChk" | "bytes.equalsChk" | "bytes.compareChk"
2539
- /** The deprecated `new Buffer(number, 'enc')` string-arm rejection:
2540
- * always throws Node's ERR_INVALID_ARG_TYPE ("The \"string\" argument
2541
- * must be of type string. Received ..."). Borrowed dyn; may-throw. */
2542
- | "buffer.newStringFail"
2543
- /** fs._toUnixTimestamp(time) over a dyn value: numeric strings and
2544
- * finite numbers coerce (negatives answer now/1000, Node's shape);
2545
- * everything else throws Node's ERR_INVALID_ARG_TYPE. May-throw. */
2546
- | "fs.toUnixTimestamp"
2547
- /** The fs argument-validation ladders (checked-dynamic lane): each Chk
2548
- * replicates its API's Node-order validation over dyn values (Node's
2549
- * exact typed errors — ERR_INVALID_ARG_TYPE/VALUE, ERR_OUT_OF_RANGE),
2550
- * and a full pass meets the trailing compiler-rendered SC2020 fence
2551
- * string — so the ALWAYS-THROW forms take the error.nodeThrow
2552
- * polymorphic-result carve-out. mkdtempSyncChk and the lchmod sync/
2553
- * promise pair run the REAL operation on a validated pass instead
2554
- * (macOS lchmod(2); non-APPLE answers Node's not-a-function /
2555
- * ERR_METHOD_NOT_IMPLEMENTED shapes). May-throw seeds, all of them. */
2556
- | "fs.existsChk" | "fs.mkdtempChk" | "fs.mkdtempSyncChk" | "fs.readFileChk" | "fs.opendirChk" | "fs.watchFileChk" | "fs.lchmodChk" | "fs.lchmodSyncChk" | "fsp.lchmodChk" | "fs.readChk" | "fs.streamOptsChk"
2557
- /** The compiler-resolved ERR_INVALID_ARG_TYPE throw with a RUNTIME-
2558
- * rendered Received tail: args [argname, "of type ..." clause, the
2559
- * offending dyn value]. ALWAYS THROWS; polymorphic result (the
2560
- * error.nodeThrow pattern). May-throw seed. */
2561
- | "error.argTypeThrow"
2562
- /** The property flavor of argTypeThrow ("The \"options.x\" property
2563
- * must be ..."): the option-bag ladders' provably-invalid arms. ALWAYS
2564
- * THROWS; polymorphic result. May-throw seed. */
2565
- | "error.propTypeThrow"
2566
- /** The checked-dynamic max-listeners ladders: setMaxChk is the
2567
- * instance form over a dyn n (non-numbers ERR_INVALID_ARG_TYPE,
2568
- * negatives/NaN ERR_OUT_OF_RANGE; +1 receiver back — chaining);
2569
- * setDefaultMaxChk is the static/property form, its second argument
2570
- * naming the message slot ("setMaxListeners" for the static call,
2571
- * "defaultMaxListeners" for the module-property assignment). */
2572
- | "emitter.setMaxChk" | "emitter.setDefaultMaxChk"
2573
- /** The Buffer forms of fs: readFileSync(path) with NO
2574
- * encoding → bytes<u8> (+1), writeFileSync/appendFileSync(path, bytes), and the
2575
- * fs/promises readFile(path) no-encoding form (an already-settled
2576
- * promise, rejecting on failure like the other fsp members). The sync
2577
- * forms THROW catchably on failure exactly like the utf8 forms. */
2578
- | "fs.readFileSyncBytes" | "fs.writeFileSyncBytes" | "fs.appendFileSyncBytes" | "fsp.readFileBytes"
2579
- /** node:zlib (scr_zlib.c — native-toolchain.ts compiles/links it ONLY when these
2580
- * appear on the IR, the regex/libcurl gating precedent): one-shot zlib,
2581
- * raw-DEFLATE, gzip, and auto-detect codecs over u8 bytes with Node's
2582
- * default options, or a validated literal compression level from -1 to 9.
2583
- * Compression never throws (OOM aborts); decompression
2584
- * of corrupt input THROWS Node's error catchably. */
2585
- | "zlib.deflateSync" | "zlib.inflateSync" | "zlib.deflateRawSync"
2586
- /** bytes, mode (0 zlib / 1 raw / 2 gzip), validated compression level. */
2587
- | "zlib.deflateLevelSync" | "zlib.inflateRawSync" | "zlib.gzipSync" | "zlib.gunzipSync" | "zlib.unzipSync"
2588
- /** The default-options callback twins run on the executable's shared
2589
- * native work pool and deliver (Error | null, Buffer) on a later loop
2590
- * turn. crc32 validates its optional uint32 seed synchronously. */
2591
- | "zlib.deflateCb" | "zlib.inflateCb" | "zlib.deflateRawCb" | "zlib.inflateRawCb" | "zlib.gzipCb" | "zlib.gunzipCb" | "zlib.unzipCb" | "zlib.crc32"
2592
- /** The Buffer overloads of the raw stream writes — same promptly
2593
- * submitted streams as process.stdoutWrite/stderrWrite, constantly true.
2594
- * The encoding arg is evaluated but ignored for bytes, like Node. The Cb
2595
- * forms move their program-shaped completion callback to the tick queue. */
2596
- | "process.stdoutWriteBytes" | "process.stderrWriteBytes" | "process.stdoutWriteBytesCb" | "process.stderrWriteBytesCb" | "fsp.readFile" | "fsp.writeFile"
2597
- /** fs.promises.writeFile(path, data, { mode }): the settled-promise
2598
- * twin of fs.writeFileModeSync. */
2599
- | "fsp.writeFileMode" | "fsp.mkdir"
2600
- /** The fs/promises option/member tail the certs pipeline uses: mkdir's
2601
- * literal { recursive?, mode? } options (the mkdirSync matrix behind
2602
- * settled promises), unlink, chmod. Failures REJECT (catchable at the
2603
- * await), like the rest of the fsp family. */
2604
- | "fsp.mkdirMode" | "fsp.mkdirRecursive" | "fsp.mkdirRecursiveMode" | "fsp.unlink" | "fsp.chmod" | "fsp.link" | "fsp.symlink" | "fsp.readlink" | "fsp.statfs" | "fsp.readlinkStr" | "fsp.readlinkBuffer" | "fsp.utimes" | "fsp.lutimes" | "fsp.rename" | "fsp.readdir"
2605
- /** `fs.promises.readdir(path, { withFileTypes: true })` — the settled-
2606
- * promise twin of fs.readdirTypesSync. The backends assemble the same
2607
- * call-site-shaped Dirent rows, then move the array into a promise;
2608
- * scandir failure becomes its rejection. */
2609
- | "fsp.readdirTypes" | "fsp.rm" | "fsp.stat" | "fsp.realpath" | "fsp.lstat"
2610
- /** fs/promises.open and the statically represented FileHandle surface.
2611
- * Every operation returns an already-settled promise; syscall failures
2612
- * become rejections rather than escaping synchronously. read/write
2613
- * results are call-site record shapes ({ bytesRead/bytesWritten,
2614
- * buffer }) assembled by the backends around the fixed runtime ABI. */
2615
- | "fsp.open" | "fileHandle.fd" | "fileHandle.close" | "fileHandle.sync" | "fileHandle.datasync" | "fileHandle.truncate" | "fileHandle.chmod" | "fileHandle.utimes" | "fileHandle.readv" | "fileHandle.writev" | "fileHandle.read" | "fileHandle.writeBytes" | "fileHandle.writeStr" | "fileHandle.readFile" | "fileHandle.readFileBytes" | "fileHandle.writeFile" | "fileHandle.writeFileBytes" | "fileHandle.stat" | "process.argv" | "process.platform"
2616
- /** getenv(3): one string key arg → the interned `string | undefined`
2617
- * union (present: +1 string wrapped into the string arm; absent: the
2618
- * interned undefined-arm instance). BOTH source forms — `process.env.FOO`
2619
- * and `process.env[expr]` — lower here. Purely static; never throws. */
2620
- | "process.envGet"
2621
- /** setenv(3): (name, value) string args → void. Later envGet reads and
2622
- * spawned children observe the write, like Node (values are strings —
2623
- * the frontend fences non-string RHS). Never throws. */
2624
- | "process.envSet"
2625
- /** The whole environment as alternating [k0, v0, k1, v1, ...] strings in
2626
- * environ order — the raw material of the process.env SNAPSHOT record
2627
- * (the frontend's interned %env.snapshot helper keyed-writes the pairs
2628
- * into a fresh `{ [k: string]: string | undefined }` record). Fresh +1
2629
- * array; never throws. */
2630
- | "process.envPairs" | "process.exit"
2631
- /** Numeric process.exitCode write (integer validation, implicit exit status). */
2632
- | "process.setExitCode"
2633
- /** The code for process.exit() with no argument, or zero when unset. */
2634
- | "process.currentExitCode" | "process.cwd"
2635
- /** getpid(2) / getuid(2): zero args → f64. POSIX-only target, so both
2636
- * always answer (the checker's `getuid?` optionality covers Windows —
2637
- * `process.getuid?.()` lowers as the plain call). Never throw. */
2638
- | "process.pid" | "process.getuid" | "process.getgid"
2639
- /** The ambient receiver — JS `this` in a plain (non-method) function
2640
- * body: the innermost binding the current firing/dispatch window
2641
- * pushed (Node's listener receiver, a dyn OBJ method's object, an
2642
- * apply/call thisArg), or the undefined dyn singleton with none bound
2643
- * (the strict-mode plain-call answer, the old constant). Zero args →
2644
- * dyn (+1). Never throws. */
2645
- | "dyn.dataViewIs" | "dyn.construct" | "dyn.this" | "dyn.generatorThis"
2646
- /** process.execPath: the compiled binary's own resolved absolute path
2647
- * (one interned string, +1 per read) — the honest answer where Node's
2648
- * is the node executable's (SEMANTICS.md divergence 12). Never throws. */
2649
- | "process.execPath"
2650
- /** process.arch: the compiled binary's OWN architecture ("arm64",
2651
- * "x64") — Node's answer for its own build on the same machine.
2652
- * Interned; +1 per read. Never throws. */
2653
- | "process.arch"
2654
- /** Stable native version dictionary. node/openssl identify compatibility
2655
- * targets; components absent from the native runtime are omitted. */
2656
- | "process.versions" | "process.builtinId" | "process.builtinModule" | "process.builtinUnsupported" | "fs.callbackValue" | "fs.callbackCall" | "process.hrtimeValue"
2657
- /** process.versions.node: the runtime's Node COMPATIBILITY TARGET —
2658
- * there is no Node under the binary, so this reports the version whose
2659
- * semantics the runtime implements (SEMANTICS.md divergence 60, the
2660
- * execPath stance). Interned; +1 per read. Never throws. */
2661
- | "process.versionsNode" | "process.versionsOpenssl"
2662
- /** umask(2): arg < 0 reads without setting (umask has no read-only form
2663
- * — set 0, restore); otherwise sets and answers the PREVIOUS mask.
2664
- * Never throws. */
2665
- | "process.umask"
2666
- /** chdir(2) — throws Node's fs-shaped error (ENOENT/EACCES/ENOTDIR,
2667
- * syscall "chdir") on failure. */
2668
- | "process.chdir" | "process.loadEnvFile"
2669
- /** process._exiting: true once the exit sequence began (exit listeners
2670
- * running) — the runtime flag scr_run_exit_listeners/process.exit set.
2671
- * Never throws. */
2672
- | "process.exiting"
2673
- /** os.type(): uname(2)'s sysname ("Darwin", "Linux"; "Windows_NT" on
2674
- * win32) — Node's uv_os_uname answer. Interned per call; never throws. */
2675
- | "os.type"
2676
- /** os.totalmem(): total physical memory in bytes. Never throws. */
2677
- | "os.totalmem"
2678
- /** net's process-wide happy-eyeballs attempt budget (Node's default
2679
- * 250ms): one runtime double in the core unit, so reading/writing it
2680
- * never forces the net unit into the link. Never throw. */
2681
- | "net.getAutoSelTimeout" | "net.setAutoSelTimeout"
2682
- /** realpath(3) with Node's error shape (syscall "lstat" in the message,
2683
- * Node's own spelling for realpathSync failures). +1 fresh string. */
2684
- | "fs.realpathSync"
2685
- /** Native realpath with syscall "realpath" on failure. +1 fresh string. */
2686
- | "fs.realpathNativeSync"
2687
- /** kill(2) with Node's exact semantics and error shapes: the pid must be
2688
- * an int32 (else the ERR_INVALID_ARG_TYPE TypeError text), the named
2689
- * form resolves Node's signal-name table (unknown names throw the
2690
- * ERR_UNKNOWN_SIGNAL TypeError), an omitted signal completes to
2691
- * "SIGTERM" in the frontend, signal 0 probes, and a kill(2) failure
2692
- * throws Node's `kill ESRCH`/`kill EPERM` Error. Result is Node's
2693
- * constant true. */
2694
- | "process.kill" | "process.killNum"
2695
- /** execFileSync/execSync as ONE entry (args: cmd, argv, shell, input,
2696
- * cwd, hasEnv, envPairs, timeoutMs, stdoutMode, stderrMode — see
2697
- * scr_runtime.h). Throws Node's exact errors: "Command failed: <cmd>"
2698
- * (+ captured stderr) on non-zero exit or signal death, "spawnSync
2699
- * <file> ENOENT" on spawn failure, "spawnSync <file> ETIMEDOUT" after
2700
- * the SIGTERM timeout. Result is the captured utf8 stdout (+1). */
2701
- | "cp.execSync"
2702
- /** The promisified-execFile capture (args: cmd, argv, cwd, hasEnv,
2703
- * envPairs, timeoutMs): the same exec core in the async shape — both
2704
- * streams captured, no echo, Node's ASYNC messages on the throw paths
2705
- * ("Command failed: <cmd>\n<stderr>" with the unconditional newline,
2706
- * "spawn <file> ENOENT" with .code, timeouts reporting as ordinary
2707
- * SIGTERM command failures — never ETIMEDOUT). Result reuses the
2708
- * ScrSpawnRes container (+1; stdout/stderr strings, status unused).
2709
- * Called only from the frontend's interned %execFileAsync ASYNC helper,
2710
- * whose fiber turns the throw into the rejection. */
2711
- | "cp.execCapture"
2712
- /** The raw byte writes: one borrowed string arg → bool (constantly true
2713
- * — this synchronous runtime never queues backpressure). stdoutWrite
2714
- * shares console.log's stream, each call is submitted promptly, and
2715
- * interleaved output keeps source order. No newline, no formatting,
2716
- * never throws. */
2717
- | "process.stdoutWrite" | "process.stderrWrite" | "process.stdio" | "timers.setTimeout"
2718
- /** The repeating timer pair. setInterval takes (callback, ms) like
2719
- * setTimeout and RETURNS the f64 handle the fallback declarations
2720
- * promise (ids start at 1, so truthiness narrowing works); the loop
2721
- * owns the callback until clearInterval removes the entry (eagerly — a
2722
- * live interval keeps the loop alive, a cleared one releases it, like
2723
- * Node). Neither throws; a throw ESCAPING an interval callback ends the
2724
- * program like a setTimeout throw. */
2725
- | "timers.setInterval" | "timers.clearInterval"
2726
- /** setTimeout WITH a clear handle (the f64 id) — the clearable/unref-able
2727
- * one-shot; clearTimeout cancels it, .unref() drops it from loop
2728
- * liveness. The plain timers.setTimeout stays the handle-less
2729
- * fire-and-forget. */
2730
- | "timers.setTimeoutHandle" | "timers.clearTimeout"
2731
- /** Timeout.unref()/ref()/hasRef() — loop-liveness bookkeeping over the
2732
- * handle id. unref/ref RETURN the handle (f64) for chaining; hasRef
2733
- * returns bool. */
2734
- | "timers.unref" | "timers.ref" | "timers.hasRef"
2735
- /** Timeout.refresh() — re-arm to now + the original delay (from the
2736
- * heap or from inside the firing callback; a one-shot that fired on an
2737
- * earlier turn is gone and no-ops — documented divergence). Returns
2738
- * the handle for chaining like unref/ref. */
2739
- | "timers.refresh"
2740
- /** setImmediate/clearImmediate — Node's check phase: callbacks run
2741
- * once per loop turn AFTER due timers, FIFO, and immediates queued
2742
- * mid-phase wait for the next turn. setImmediate returns the f64
2743
- * handle (its own id space — clearTimeout of an Immediate no-ops,
2744
- * like Node); the Immediate ref trio mirrors the Timeout one (an
2745
- * unref'd pending immediate neither keeps the loop alive nor fires
2746
- * once nothing reffed remains). */
2747
- | "timers.setImmediate" | "timers.clearImmediate" | "timers.immediateUnref" | "timers.immediateRef" | "timers.immediateHasRef"
2748
- /** queueMicrotask (scr_async.c): the callback enters the SAME FIFO
2749
- * promise continuations ride — one microtask order, like V8's queue —
2750
- * and a throw is an UNCAUGHT exception (never a rejection).
2751
- * timers.queueMicrotask takes an owned zero-param closure and never
2752
- * throws; the Dyn form (checked-dynamic arguments — the mustCall
2753
- * wrapper, the suite's invalid-input probes) throws Node's
2754
- * ERR_INVALID_ARG_TYPE synchronously on a non-function value and calls
2755
- * the function with zero arguments at drain. */
2756
- | "timers.queueMicrotask" | "timers.queueMicrotaskDyn"
2757
- /** The tolerated non-handle clear (`clearTimeout(null)`,
2758
- * `clearInterval({})`, zero-argument forms): Node silently ignores
2759
- * anything that is not a live handle — a VOID no-op the emitter drops
2760
- * (only syntactically side-effect-free arguments take this path). */
2761
- | "timers.clearNoop"
2762
- /** process.nextTick(cb, ...args) — the user tick queue. args: [cb
2763
- * (() => void; trailing call arguments ride the timer surface's
2764
- * interned dyn thunk)]. Ticks drain BEFORE promise jobs at every loop
2765
- * checkpoint, to joint exhaustion with them (Node's tick-then-
2766
- * microtask order); ticks enqueued by station listeners run at the
2767
- * NEXT checkpoint (the stream-tick station divergence, SEMANTICS.md).
2768
- * Pending ticks are always-ready work — the loop neither sleeps nor
2769
- * exits while any exist; ticks scheduled from 'exit' listeners never
2770
- * run (Node). The enqueue itself never throws. */
2771
- | "process.nextTick"
2772
- /** The process introspection statics. uptime: seconds since the
2773
- * binary's own start (fractional — a load-time monotonic anchor).
2774
- * availableMemory/constrainedMemory: libuv's numbers (free-ish bytes;
2775
- * the cgroup cap or 0). cpuUser/cpuSystem (+ threadCpu twins): the
2776
- * process/thread CPU clocks in microseconds — the frontend composes
2777
- * the {user, system} records. The *Diff forms answer current − prev
2778
- * for one field; cpuPrevValidate throws Node's ERR_INVALID_ARG_VALUE
2779
- * RangeError for negative/non-finite prev fields (user first, then
2780
- * system — Node's order; MAY THROW). rusage(idx): one
2781
- * process.resourceUsage() field by canonical index (Node's units).
2782
- * activeResources: the loop's own bookkeeping — 'Timeout' per armed
2783
- * (or firing, uncleared) timer, 'Immediate' per queued unfired
2784
- * immediate; unmodeled resource kinds are absent (SEMANTICS.md). */
2785
- | "process.uptime"
2786
- /** perf_hooks performance.now(): fractional ms since process start. */
2787
- | "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"
2788
- /** Named process signal events: [name string, callback dyn, once bool]
2789
- * or [name, callback] for removal. The runtime resolves platform signal
2790
- * numbers and delivers (name, number). Listeners do not keep the loop
2791
- * alive. Invalid callbacks and uncatchable signals throw. */
2792
- | "process.onSignal" | "process.offSignal"
2793
- /** The process 'exit' event — process.on/once/off("exit"). args: [cb,
2794
- * once bool] / [cb]. Listeners run SYNCHRONOUSLY at termination
2795
- * (normal exit, process.exit(), the uncaught/unhandled exit-1 paths)
2796
- * with the exit code; anything they schedule never runs, like Node.
2797
- * Callback shapes: () => void or (code: number) => void — the emitter
2798
- * picks the runtime adapter. Never throw. */
2799
- | "process.onExit" | "process.offExit"
2800
- /** process.stdin listener registration — stdin.on/once("data" | "end" |
2801
- * "error", cb). args: [cb, once bool]. data callbacks: () => void or
2802
- * (chunk: Uint8Array) => void; end: () => void; error: () => void or
2803
- * (err: Error) => void (the child error adapters are reused). While a
2804
- * data listener (or a parked for-await chunk promise) exists, stdin
2805
- * keeps the loop alive — Node's flowing-stdin keep-alive. Never
2806
- * throw. */
2807
- | "stdin.onData" | "stdin.onEnd" | "stdin.onError"
2808
- /** The for-await chunk source over process.stdin: no args, result
2809
- * Promise<Uint8Array> (+1). Fulfills with the next arrived chunk; the
2810
- * EMPTY bytes value is the done sentinel (POSIX reads never deliver
2811
- * empty data chunks), which the for-await desugar turns into loop
2812
- * exit. Never throws itself; awaiting it re-throws nothing (stdin
2813
- * errors surface through 'error' listeners, not the iterator). */
2814
- | "stdin.nextChunk"
2815
- /** The runtime-provided Error hierarchy's entry points (scr_error.c).
2816
- * error.new: one borrowed string arg (the message), result an owned (+1)
2817
- * builtin error instance — the result TYPE names which builtin class
2818
- * (backends derive the runtime kind from it). error.ctor: the
2819
- * super(message) call of an `extends Error` constructor — borrowed
2820
- * receiver (already allocated by the derived class's new) + borrowed
2821
- * message, void; the receiver's type names the builtin class whose name
2822
- * field to stamp. error.toString: borrowed `%Error`-typed receiver, +1
2823
- * string in Node's "name: message" shape. Formatting can invoke a user
2824
- * message accessor, which can throw. */
2825
- | "error.new"
2826
- /** ECMAScript constructors with raw checked-dynamic message/options.
2827
- * Options retain cause presence; constructor calls borrow their args.
2828
- * Message coercion may throw before the cause is installed. */
2829
- | "error.newOptions" | "error.ctorOptions"
2830
- /** Borrowed Error receiver. cause returns an owned dyn value (undefined
2831
- * when absent); hasCause distinguishes absence from present undefined. */
2832
- | "error.cause" | "error.hasCause"
2833
- /** Assignment borrows both operands and retains the new cause. */
2834
- | "error.setCause" | "error.defineCause" | "error.deleteCause"
2835
- /** The compiler-resolved Node-parity throw for always-throwing lowered
2836
- * arms (ERR_INVALID_THIS receivers, ERR_MISSING_ARGS arity ladders,
2837
- * the symbol-to-string TypeError): args are [error-kind f64 (the
2838
- * SCR_ERR_* index: 0 Error, 1 TypeError, 2 RangeError), code (empty =
2839
- * no code slot), message]. ALWAYS THROWS catchably; the result type is
2840
- * the replaced expression's own (never materialized — the
2841
- * global.undefRead pattern). May-throw seed. */
2842
- | "error.nodeThrow"
2843
- /** JS ToString over a dyn value WITH the object protocol (a user
2844
- * toString/valueOf member is CALLED and its throw propagates;
2845
- * exhaustion throws "Cannot convert object to primitive value"; units
2846
- * render "null"/"undefined") — the WHATWG USVString conversions
2847
- * (URLSearchParams names/values). Borrowed dyn; +1 string. May-throw. */
2848
- | "dyn.toStringCoerce" | "dyn.stringConstructor" | "dyn.propertyKey" | "dyn.toNumeric" | "dyn.increment"
2849
- /** JS ToNumber over a dyn value WITH the object protocol (number-hint
2850
- * valueOf/toString ordering; user throws propagate). Borrowed dyn;
2851
- * f64 result, or a throw. Used by statically lowered numeric coercions
2852
- * whose checker type remained any. */
2853
- | "dyn.numberConstructor" | "dyn.bigintConstructor" | "dyn.toNumberCoerce" | "dyn.add" | "dyn.arithmetic" | "dyn.compare" | "dyn.bitwise" | "dyn.proxyNew"
2854
- /** A read of a `declare`d const NOTHING defines (the bundler-define
2855
- * pattern — __VERSION__): always throws the catchable ReferenceError
2856
- * Node raises at the access ("<name> is not defined"). args[0] is the
2857
- * name; the result type is the read's declared type (a typed dummy the
2858
- * unwind abandons — the value never exists). */
2859
- | "global.undefRead"
2860
- /** A native reference to the global object; known names retain value fences. */
2861
- | "global.native" | "console.native"
2862
- /** `X.name` through a class VALUE (scr_object.c): args[0] is a borrowed
2863
- * classval; the result is the class object's stored .name string,
2864
- * retained (+1 — the string is an interned immortal, so the retain is a
2865
- * no-op, kept for ownership uniformity). Never throws. A direct
2866
- * `C.name` on the class name itself folds to a strLit instead. */
2867
- | "class.name" | "error.ctor" | "error.toString" | "error.stack" | "error.stackLimitGet" | "error.stackLimitSet"
2868
- /** `new DOMException(message?, nameOrOptions?)` (scr_error.c): both args
2869
- * are borrowed dyn values (the lowering passes the dyn undefined for an
2870
- * absent argument, so WebIDL's optionality lives in one place). The
2871
- * runtime ToStrings the message ("" for absent/undefined), resolves the
2872
- * name — absent/undefined → "Error", a non-null object → ToString of its
2873
- * `name` member plus the `cause` own-property record, anything else →
2874
- * ToString — and stamps the legacy code from the WebIDL name table (0
2875
- * off-table). Result is an owned (+1) %DOMException. Never throws (dyn
2876
- * ToString is total). */
2877
- | "error.newDom"
2878
- /** DOMException's own read surface (scr_error.c; %DOMException receivers
2879
- * only — borrowed). domCode: the legacy numeric code. domHasCause: the
2880
- * options form's own-property record (`'cause' in e`). domCause: the
2881
- * cause value, +1 (the dyn undefined when absent — matching Node's
2882
- * undefined read). None throws. */
2883
- | "error.domCode" | "error.domHasCause" | "error.domCause"
2884
- /** structuredClone of a %DOMException receiver (scr_error.c): WebIDL
2885
- * serialization — name/message copy, the legacy code re-derives, cause
2886
- * does not serialize. args are the borrowed receiver and the borrowed
2887
- * options dyn value (the dyn undefined when absent — the shared
2888
- * validation throws Node's exact option errors; any non-empty transfer
2889
- * list throws DataCloneError, nothing static is transferable). Result
2890
- * +1 %DOMException. */
2891
- | "error.domClone"
2892
- /** `d instanceof TypeError` (and the other BUILTIN error classes) on a
2893
- * checked-dynamic value (scr_json.c): the from_error cache holds the
2894
- * dyn↔error identity edge, so the test resolves the runtime error and
2895
- * asks its vtable's stamped preorder interval — exact for every error
2896
- * that crossed the boundary. A dyn object that never came from an
2897
- * error (a hand-built {%error} literal) answers false: subclass
2898
- * identity is unknowable there (the root keeps dynTest's marker
2899
- * answer). args are the borrowed dyn and the SCR_ERR_* kind literal.
2900
- * Never throws. */
2901
- | "dyn.errInstanceof"
2902
- /** Object.keys/values/entries over a CHECKED-DYNAMIC receiver
2903
- * (scr_json.c): the runtime walks the dyn node's own members in JS
2904
- * own-key order (array-index keys ascending first, then insertion
2905
- * order) and answers a dyn array (entries: an array of [key, value]
2906
- * pairs; values RETAIN the member nodes — reference semantics, like
2907
- * JS). Strings/arrays/bytes answer their index keys; other scalars an
2908
- * empty array; null/undefined throw Node's catchable TypeError
2909
- * ("Cannot convert undefined or null to object"). */
2910
- | "dyn.objKeys" | "dyn.forInKeys" | "dyn.hasOwn" | "dyn.propertyIsEnumerable" | "dyn.assign" | "dyn.copyDataProperties" | "dyn.objectRest"
2911
- /** Variadic Object.assign over CHECKED-DYNAMIC targets (`Object.assign(
2912
- * {}, ...arr.map(f), tail)` — the option-table merge): the lowering
2913
- * builds one fresh dyn pack of sources (packPush retains a plain source
2914
- * in; packPushSpread flattens a spread source through the spread-call
2915
- * walk — V8's exact TypeError texts, the string arg spelling the spread
2916
- * expression for the nullish form), so every source evaluates and
2917
- * flattens BEFORE any copying (JS's ArgumentListEvaluation), then
2918
- * assignAll copies each pack element's own enumerable keys onto the
2919
- * target left to right and answers the TARGET (+1) — identity, like JS.
2920
- * assignAll throws Node's ToObject TypeError on a nullish target. */
2921
- | "dyn.packPush" | "dyn.packPushSpread"
2922
- /** The iterated-path spread twin: V8 spells the optimized apply-path
2923
- * texts (packPushSpread's — the expression named for nullish sources)
2924
- * only for the SINGLE LAST argument's spread; any other spread position
2925
- * drives the real iterator protocol, whose failure describes the VALUE
2926
- * ("object null is not iterable (cannot read property
2927
- * Symbol(Symbol.iterator))"). The frontend picks by position. */
2928
- | "dyn.packPushSpreadIter" | "dyn.assignAll" | "dyn.reflectApply" | "dyn.reflectGet" | "dyn.reflectSet" | "dyn.reflectDefine" | "dyn.abstractEq"
2929
- /** `Object.create(null)` (scr_json.c): a fresh NULL-PROTOTYPE dyn
2930
- * dictionary. The checked-dynamic tree's OBJ dispatch is already own-member-only —
2931
- * Node's null-proto answer — so the flag's whole job is the observations
2932
- * that SEE the prototype: inspect's "[Object: null prototype]" prefix
2933
- * and deepStrictEqual's prototype gate. Never throws. Static builds
2934
- * only; --dynamic routes Object.create through the engine instead. */
2935
- | "dyn.objCreateNullProto" | "dyn.arrayPrototype" | "dyn.arrayConstructor" | "dyn.objectPrototype" | "dyn.functionApply" | "dyn.builtinMethod" | "dyn.classPrototype" | "dyn.classBasePrototype" | "dyn.classInherit" | "dyn.classSuper" | "dyn.assignPrototype" | "dyn.definePrototypeProps" | "dyn.bagGet" | "dyn.bagSet" | "dyn.objCreate" | "dyn.objCreateWithProperties" | "dyn.getPrototype" | "dyn.setPrototype" | "dyn.getOwnPropertyNames" | "dyn.ownKeys" | "dyn.getOwnPropertySymbols" | "dyn.getOwnPropertyDescriptors" | "dyn.preventExtensions" | "dyn.isExtensible" | "dyn.seal" | "dyn.isSealed" | "dyn.objValues" | "dyn.objEntries"
2936
- /** structuredClone over the checked-dynamic tree (scr_json.c): the JSON-safe subset plus
2937
- * bytes (a fresh copy — a Buffer clones as a plain Uint8Array, like
2938
- * Node), deep. Functions and handle kinds throw the spec's catchable
2939
- * DataCloneError; CYCLES throw the scriptc fence (the checked-dynamic tree cannot
2940
- * represent them — Node clones cycles; documented divergence). The
2941
- * options dyn value validates with Node's exact errors (dictionary
2942
- * conversion, the transfer-sequence member; any non-empty transfer
2943
- * list throws DataCloneError). dyn.cloneMissing is the zero-argument
2944
- * call: always throws Node's TypeError [ERR_MISSING_ARGS] with Node's
2945
- * own (verbatim, doubly-wrapped) message. */
2946
- | "dyn.structuredClone" | "dyn.cloneMissing"
2947
- /** `new RegExp(pattern, flags?)` (scr_regex.c): a heap regex over the
2948
- * same libregexp engine the literals use. The pattern compiles EAGERLY
2949
- * so an invalid pattern (or an unknown flag letter) throws Node's
2950
- * catchable SyntaxError at construction — Node's message shape with
2951
- * libregexp's detail text (approximate fidelity; e.name exact). An
2952
- * empty pattern stores the spec's "(?:)" source. Both args borrowed
2953
- * strings (the lowering completes an absent flags to ""); result +1.
2954
- * The result TYPE is the regex kind, so the link switch pulls the
2955
- * engine exactly like a literal. */
2956
- | "regex.new" | "regex.resetLastIndex" | "regex.newChecked"
2957
- /** structuredClone with a NON-EMPTY transfer array of static values:
2958
- * nothing static is transferable, so the call always throws Node's
2959
- * catchable DataCloneError ("Found invalid value in transferList.") —
2960
- * lowered directly (the list's values need no dyn representation to
2961
- * fail). */
2962
- | "dyn.cloneTransferFail"
2963
- /** node:events EventEmitter (scr_events_emitter.c, link-gated by
2964
- * moduleUsesEmitter). The receiver of every instance form is a borrowed
2965
- * emitter-hierarchy object (`%EventEmitter` or a user subclass — the
2966
- * backend reinterprets to ScrEmitter*, the identical prefix); event
2967
- * names are borrowed strings (compile-time literals — the frontend
2968
- * fences non-literals and unifies each event's argument tuple program-
2969
- * wide). The chaining forms (on/off/removeAll/setMax) return the
2970
- * receiver +1 typed as its static class, Node's `return this`.
2971
- *
2972
- * emitter.new: `new EventEmitter()` → a +1 bare emitter. emitter.ctor:
2973
- * super() into the prefix of an emitted subclass (borrowed receiver,
2974
- * void — allocation already initialized the prefix). emitter.on:
2975
- * (recv, name, cb /moves/, once, prepend) — the backend synthesizes the
2976
- * per-signature va_list invoke adapter from the cb's func type.
2977
- * emitter.emit: (recv, name, ...tuple) — VARIADIC, the one libCall
2978
- * whose arg count exceeds its signature; args are borrowed, result is
2979
- * the had-listeners bool. emitter.emitError: emit('error', err) —
2980
- * throws err when unhandled. count/countFn/names/listeners/getMax/
2981
- * setMax/setDefaultMax/getDefaultMax are the introspection surface. */
2982
- | "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"
2983
- /** Stream-'data' registration twins of emitter.on/onDyn (same args):
2984
- * chosen at registration sites whose receiver is stream-rooted, so the
2985
- * backend emits DATA thunks — the runtime's 'data' emission carries
2986
- * BOTH payload slots (bytes, string; exactly one non-NULL — encoded
2987
- * streams deliver strings), and the thunk unwraps the listener's
2988
- * declared side (typed) or boxes by tag (dyn). emitter.emitData is the
2989
- * user-emit form: (recv, name, chunk) with a bytes OR string chunk. */
2990
- | "emitter.onData" | "emitter.onDataDyn" | "emitter.emitData" | "emitter.setDefaultMax" | "emitter.getDefaultMax"
2991
- /** node:stream (scr_stream.c, link-gated by moduleUsesStream — which
2992
- * implies the emitter unit: stream events dispatch through the embedded
2993
- * ScrEmitter registry). Receivers are borrowed stream-class objects
2994
- * (`%Readable`/`%Writable`/`%Duplex`/`%Transform`/`%PassThrough` — one
2995
- * runtime layout, reinterpreted by side).
2996
- *
2997
- * Constructors (`readable.new` et al): args are [hwmR, hwmW, flags]
2998
- * followed by the PRESENT user callbacks in canonical order (read,
2999
- * write, final, destroy, transform, flush — the flags f64 is a bitmask
3000
- * naming which follow; absent ones emit NULL). Every callback closure
3001
- * MOVES and carries a leading `this` param (the stream), invoked
3002
- * through compiler-emitted adapters. Results are +1.
3003
- *
3004
- * readable.push / readable.pushStr / readable.pushNull: Node's push —
3005
- * buffers or delivers (bytes chunk borrowed; string converted utf8);
3006
- * returns the below-hwm answer. readable.read: (recv, size — -1 for
3007
- * absent) → Buffer|null union. pause/resume return recv +1 (`this`);
3008
- * isPaused answers the flag. readable.pipe: (recv, dst, end) → dst +1,
3009
- * fires 'pipe' on dst; readable.unpipe (recv[, dst]) → recv +1.
3010
- * writable.write/writeStr: (recv, chunk[, cb]) → below-hwm bool (cb
3011
- * MOVES when present, called after the user write completes).
3012
- * writable.end: (recv, flags[, chunk][, cb]) → recv +1. cork/uncork are
3013
- * void. stream.destroy/destroyErr: (recv[, err]) → recv +1.
3014
- * stream.prop: (recv, name-literal) → the flag/number the name asks
3015
- * for; stream.errored → Error|null union; readable.flowing →
3016
- * bool|null union. All may leave a listener's exception pending
3017
- * (dispatch runs user code synchronously, like emit). */
3018
- | "readable.new" | "writable.new" | "duplex.new" | "transform.new" | "passthrough.new"
3019
- /** Subclass initialization (`super(options?)` in a user `extends
3020
- * Readable` constructor): same tail as the `.new` forms, prefixed with
3021
- * the BORROWED receiver (the emitted subclass allocation — vtable and
3022
- * display name stamped, state NULL until here). Overridden underscore
3023
- * methods arrive as synthesized wrapper closures dispatching through
3024
- * the vtable. Void result. */
3025
- | "readable.init" | "writable.init" | "duplex.init" | "transform.init" | "passthrough.init"
3026
- /** The dyn-options twins (a checked-dynamic options record — the JS
3027
- * lane's `super(options)` forwarding and `new Readable(dynVar)`): the
3028
- * option walk runs at RUNTIME with Node's reading rules. newDyn:
3029
- * (optsDyn) → the fresh stream; initDyn: (recv, optsDyn, flags,
3030
- * ...fallback wrapper closures in canonical order — the flags literal
3031
- * names which ride, exactly the .init callback ABI). MAY THROW (a
3032
- * consumed-but-unlowered option is the compile fence's runtime twin). */
3033
- /** stream.finished(s, cb) — the callback form: the watcher fires once
3034
- * at the terminal point with the finish status; the result is the +1
3035
- * cleanup closure. stream.pipeline(count, s1..sn, cb): chains pipes,
3036
- * propagates the first error by destroying the rest, calls cb after the
3037
- * last 'close'; answers the destination +1. The Dyn twins take the
3038
- * callback as a checked-dynamic VALUE (mustCall wrappers). */
3039
- | "stream.finished" | "stream.finishedDyn" | "stream.pipeline" | "stream.pipelineDyn"
3040
- /** node:stream/promises — the promise forms over the same machinery:
3041
- * sp.finished: (s) → a pending void promise the terminal watcher
3042
- * settles; sp.pipeline: (count, s1..sn) → the callback pipeline's
3043
- * chaining/destroyer semantics settling a void promise (fulfilled on a
3044
- * clean finish, rejected with the finish status otherwise). */
3045
- | "sp.finished" | "sp.pipeline"
3046
- /** node:stream/consumers — the promise consumers over the readable
3047
- * machinery: (s) → a pending promise settled at the terminal point
3048
- * with the accumulated result (sc.text: the utf8 decode, sc.json: the
3049
- * parsed dyn — malformed input rejects with the parse's SyntaxError,
3050
- * sc.buffer: the concatenated bytes) or rejected with the stream's
3051
- * error / ERR_STREAM_PREMATURE_CLOSE. */
3052
- | "sc.text" | "sc.json" | "sc.buffer" | "readable.newDyn" | "writable.newDyn" | "duplex.newDyn" | "transform.newDyn" | "passthrough.newDyn" | "readable.initDyn" | "writable.initDyn" | "duplex.initDyn" | "transform.initDyn" | "passthrough.initDyn" | "readable.push" | "readable.pushStr" | "readable.pushNull" | "readable.pushU" | "readable.pushDyn" | "readable.unshift" | "readable.unshiftStr" | "readable.read" | "readable.readDyn" | "stream.onDyn" | "readable.pause" | "readable.resume" | "readable.setEncoding"
3053
- /** push(chunk, enc) with a literal non-utf8 encoding, and the
3054
- * defaultEncoding option's push side (how push(string) decodes —
3055
- * Buffer.from(chunk, enc)); both carry the CANONICAL literal. */
3056
- | "readable.pushStrEnc" | "readable.pushEncoding"
3057
- /** for-await over a readable (the desugared loop's per-pass promise):
3058
- * +1 promise of the next chunk — buffered content, the EOF sentinel
3059
- * (empty Buffer / dyn undefined), or a rejection with the stream's
3060
- * error. The Dyn twin boxes chunks by runtime tag (the JS lane).
3061
- * readable.fromArr is Readable.from(array): a fully-seeded object-
3062
- * entry stream (one whole chunk per element; strings per the flag). */
3063
- | "readable.nextChunk" | "readable.nextChunkDyn" | "readable.fromArr" | "readable.isPaused" | "readable.pipe" | "readable.unpipe" | "readable.flowing" | "writable.write" | "writable.writeStr" | "writable.writeU" | "writable.writeDyn" | "writable.end" | "writable.cork" | "writable.uncork" | "stream.destroy" | "stream.destroyErr"
3064
- /** AsyncIteratorClose for Readable[Symbol.asyncIterator](): destroy with
3065
- * Node's AbortError/ABORT_ERR payload while the iterator's internal error
3066
- * consumer prevents an unhandled-error crash. */
3067
- | "stream.iteratorClose" | "stream.prop" | "stream.errored"
3068
- /** The underscore-method assignment surface (`r._read = fn` after
3069
- * construction — Node's own-property shadow of the prototype method):
3070
- * args [stream receiver (borrowed), callback closure (+1 moves)]. The
3071
- * runtime slot the matching option callback fills swaps its closure
3072
- * and invoke thunk; the next dispatch uses it (Node's timing). The
3073
- * setters themselves never throw. */
3074
- | "stream.setRead" | "stream.setWrite" | "stream.setFinal" | "stream.setDestroy" | "stream.setTransform" | "stream.setFlush"
3075
- /** NodeJS.ErrnoException's `.code` read: borrowed error-hierarchy
3076
- * receiver → the interned `string | undefined` union (type-directed
3077
- * construction in the backend, the process.envGet pattern) — the errno
3078
- * name where a throw site stamped one (fs, exec spawn/timeout,
3079
- * process.kill, the spawn 'error' event), the undefined arm everywhere
3080
- * else. Never throws. */
3081
- | "error.code"
3082
- /** node:assert (scr_assert.c; assert.match in scr_regex.c — every call
3083
- * site carries a regex value, so the regex link switch is already on).
3084
- * Failures throw a catchable AssertionError — a runtime %Error whose
3085
- * name is "AssertionError" and whose code slot is "ERR_ASSERTION" — so
3086
- * `instanceof Error`, `.name`, `.message`, and `.code` all answer like
3087
- * Node's. Generated messages are Node's assertion_error.js scalar forms
3088
- * byte-exactly (the short `a !== b` form, the stacked `+ actual
3089
- * - expected` diff with the string `^` indicator, the inline-vs-block
3090
- * not-equal split); composite deep failures carry the header line
3091
- * without the rendered inspect diff (documented divergence).
3092
- *
3093
- * assert.ok: (pass, message) — the frontend computed the truthiness AND
3094
- * the full message (the user's, or the compile-time source-text form —
3095
- * assert.fail lowers here too with pass=false). assert.eqF64/eqBigInt/
3096
- * eqStr/eqBool: (a, b, negated, deep, msg, hasMsg) — Object.is comparison,
3097
- * covering strictEqual/notStrictEqual and the scalar deepStrictEqual
3098
- * pair; msg is a typed dummy ("" literal) when hasMsg is false (Node
3099
- * distinguishes an omitted message from an empty one per operator).
3100
- * assert.deepResult: (equal, negated, msg, hasMsg) — the verdict of a
3101
- * frontend-synthesized structural comparison, turned into Node's throw.
3102
- * assert.sameValue: Object.is over doubles (the deep-equal helpers'
3103
- * number leaf; never throws). assert.match: (s, regex, negated, msg,
3104
- * hasMsg) — a fresh exec from index 0. assert.throwsNone: (rejection,
3105
- * ename, hasEname, msg, hasMsg) — the "Missing expected
3106
- * exception|rejection" throw of assert.throws/rejects whose callback
3107
- * returned (fulfilled) normally, with Node's ` (${expected.name})`
3108
- * detail when the expected class or shape carries a name.
3109
- * assert.throwsMismatch: (expectedName, error) — the wrong-class throw
3110
- * of the assert.throws(fn, ErrorClass) form. assert.eqSym:
3111
- * (a, b, negated, deep, msg, hasMsg) — strict equality over symbol
3112
- * values, pointer identity with v24's "Symbol(desc)" stacked-diff
3113
- * messages (scr_symbol.c, the assert.match pattern — symbol-typed
3114
- * slots already flip the symbol link switch). assert.eqDyn:
3115
- * (a, b, negated, deep, msg, hasMsg) — the whole quartet over
3116
- * checked-dynamic operands (both slots dyn; the frontend boxes a
3117
- * static side with dynFrom first): SameValue for the strict pair over
3118
- * the dyn kinds (boxed-closure identity for functions), the structural
3119
- * dyn walk for the deep pair, with assertion_error.js's messages —
3120
- * scalar forms byte-exact, composites rendered compact:false/sorted
3121
- * through the checked-dynamic tree and diffed with the real myers line printer.
3122
- *
3123
- * The assert.throws(fn, {name/code/message}) shape check
3124
- * (expectedException over the static error surface): shapeBegin
3125
- * stashes the caught error, shapeStr/shapeRe add one expected key each
3126
- * (key ids 0 code / 1 message / 2 name; shapeRe lives in scr_regex.c —
3127
- * its regex argument flips the regex link switch — and tests eagerly
3128
- * so scr_assert.c stays libregexp-free), then shapeEnd throws Node's
3129
- * deep-equal Comparison diff BYTE-EXACTLY (the bounded key set makes
3130
- * the rendering enumerable) or the custom message.
3131
- * assert.throwsRegex: (regex, error, msg, hasMsg) — the
3132
- * assert.throws(fn, /re/) check over String(error), Node's
3133
- * regex-mismatch message. assert.regexErrTest: doesNotReject's silent
3134
- * regex predicate over String(error) (never throws).
3135
- * assert.unwantedRejection: (error, msg, hasMsg) — doesNotReject's
3136
- * "Got unwanted rejection" throw.
3137
- * assert.ifErrorErr/F64/Str/Bool: assert.ifError's per-type throws
3138
- * ("ifError got unwanted exception: " + the error's message/name or
3139
- * the value's inspection) — the frontend routes null/undefined to a
3140
- * no-op and everything else here (Node throws for falsy values too).
3141
- * All arguments are borrowed. */
3142
- | "assert.ok" | "assert.eqF64" | "assert.eqBigInt" | "assert.eqStr" | "assert.eqBool" | "assert.eqSym" | "assert.eqDyn" | "assert.looseResult" | "assert.deepResult" | "assert.sameValue" | "assert.deqEnter" | "assert.deqLeave" | "assert.match" | "assert.throwsNone" | "assert.throwsMismatch" | "assert.throwsRegex" | "assert.shapeBegin" | "assert.shapeStr" | "assert.shapeRe" | "assert.shapeEnd" | "assert.regexErrTest" | "assert.unwantedRejection" | "assert.unwantedError" | "assert.noErrorPredicate" | "assert.regexDynTest"
3143
- /** Node's expectsError over an error-INSTANCE expected (assert.throws/
3144
- * rejects second argument): walk the expected dyn error's keys (name,
3145
- * message, code — the %error marker skipped) and deep-compare each
3146
- * against the caught value's; a mismatch throws the deep-equal
3147
- * AssertionError (scr_assert.c). MAY THROW by design. */
3148
- | "assert.expectsErrDyn" | "assert.ifErrorErr" | "assert.ifErrorF64" | "assert.ifErrorStr" | "assert.ifErrorBool" | "assert.ifErrorDyn" | "assert.refEqBytes" | "assert.refEqFn" | "assert.bytesDeepEq"
3149
- /** util.inspect (scr_inspect.c — its own link switch, moduleUsesInspect):
3150
- * the runtime half of the static rendering. Scalar formatters return +1
3151
- * strings (insp.f64: JS ToString except -0; insp.str: the quoting
3152
- * ladder + line splitting; insp.regex: /source/flags; insp.buffer:
3153
- * <Buffer aa ..>). insp.error renders the STACKLESS [Name: message]
3154
- * form with the code slot as its one property. insp.dyn walks the
3155
- * checked-dynamic tree entirely in the runtime (its shape lives in the
3156
- * value); insp.dynS is format's %s twin (dyn strings pass verbatim).
3157
- * insp.jsval ([value, recurse, depth], --dynamic only) renders the
3158
- * island scalars and THROWS a catchable TypeError on composites (the
3159
- * may-throw seed set). begin/entry/moreItems/end drive the frame
3160
- * engine from the compiler-synthesized per-type traversal helpers
3161
- * (%util.insp.N — the deepStrictEqual precedent). */
3162
- | "insp.f64"
3163
- /** util.format %j over a checked-dynamic argument: the runtime dyn
3164
- * walk (JS-exact stringify; root undefined/function prints
3165
- * "undefined"; a handle in the tree throws the loud fence). */
3166
- | "insp.jsonDyn" | "insp.str" | "insp.regex" | "insp.buffer" | "insp.error" | "insp.dyn" | "insp.dynS" | "insp.jsval" | "insp.begin" | "insp.entry" | "insp.key" | "insp.moreItems" | "insp.circCheck" | "insp.seenPush" | "insp.refWrap" | "insp.circular" | "insp.end"
3167
- /** node:string_decoder's utf8 StringDecoder (scr_string.c): the decoder
3168
- * value is a one-field record whose f64 PACKS the pending partial
3169
- * sequence (count + up to 3 raw bytes — Node buffers at most 3 for
3170
- * every encoding); the frontend's interned %strdec helpers thread it,
3171
- * with the decoder's CANONICAL encoding name first, through these pure
3172
- * functions. write: (enc, pending, chunk) → the decoded complete
3173
- * prefix of pending+chunk (+1); next: (enc, pending, chunk) → the
3174
- * packed NEW pending; end: (enc, pending) → the buffered partial's
3175
- * flush (+1). Node-exact per encoding (oracle-pinned); none throws. */
3176
- | "strdec.write" | "strdec.next" | "strdec.end"
3177
- /** node:readline's question/close slice (scr_readline.c, linked under
3178
- * the events gate — these fns imply moduleUsesProcessEvents). The
3179
- * interface value is an f64 handle (the Timeout-id precedent).
3180
- * rl.create: [] → f64 — createInterface({ input: process.stdin,
3181
- * output: process.stdout }), registering the unit's shared stdin
3182
- * consumer (an OPEN interface keeps the loop alive until close/EOF,
3183
- * Node's semantics). rl.question: [handle, query, cb] — writes the
3184
- * query to stdout (Node writes under pipes too) and delivers the next
3185
- * line's text through a backend-picked adapter (zero-param or
3186
- * (answer: string)); THROWS Node's "readline was closed" on a closed
3187
- * interface (may-throw). rl.close: [handle] — fires 'close' listeners
3188
- * SYNCHRONOUSLY (Node's inline emit) and detaches the consumer (the
3189
- * loop stops waiting on fd 0). rl.onClose: [handle, cb] — a zero-arg
3190
- * listener (moves); stdin EOF closes every open interface with the
3191
- * buffered partial line DISCARDED, like Node. */
3192
- | "rl.create" | "rl.question" | "rl.close" | "rl.onClose"
3193
- /** node:timers/promises — the promisified pair (scr_async.c, beside
3194
- * the timer heap they ride): tp.setTimeout: [ms] → a pending void
3195
- * promise a one-shot heap timer fulfills (the loop's timer phase, FIFO
3196
- * against equal deadlines like Node); tp.setImmediate: [] → the same
3197
- * through the immediate queue (fires before due timers of later loop
3198
- * turns, Node's check phase). Neither throws. */
3199
- | "tp.setTimeout" | "tp.setImmediate"
3200
- /** node:diagnostics_channel (scr_dc.c, linked when any dc.* appears —
3201
- * the zlib gating precedent): a process-global name→channel registry;
3202
- * channel values are f64 handles (type-mapper.ts maps Channel to F64, the
3203
- * readline.Interface pattern). Subscribers are dyn function values —
3204
- * identity-compared by unsubscribe, called (message, name) by publish
3205
- * over a SNAPSHOT of the list (a subscriber unsubscribing itself
3206
- * mid-publish still lets its siblings fire, Node's behavior). dc.publish
3207
- * MAY THROW: a subscriber's throw propagates out of publish (catchable
3208
- * there) where Node routes it to triggerUncaughtException — the
3209
- * documented divergence. subscribe/unsubscribe throw Node's
3210
- * ERR_INVALID_ARG_TYPE TypeError for non-function subscribers. */
3211
- | "dc.channel" | "dc.subscribe" | "dc.unsubscribe" | "dc.hasSubscribers" | "dc.publish" | "dc.chanSubscribe" | "dc.chanUnsubscribe" | "dc.chanHasSubscribers" | "dc.chanName"
3212
- /** TracingChannel (dc.tracingChannel): a registry entry of the five
3213
- * event channels, an f64 handle like Channel (type-mapper.ts). tcSubscribe/
3214
- * tcUnsubscribe walk a dyn handlers object's five event keys (truthy
3215
- * non-function slots throw the per-channel ERR_INVALID_ARG_TYPE);
3216
- * tcTraceSync/tcTraceCallback/tcTracePromise run Node's publish choreography in C over
3217
- * dyn values (fn, ctx, thisArg, args-array) with thisArg bound as the
3218
- * ambient receiver — the traced call's throw and any subscriber throw
3219
- * both propagate (MAY THROW). tcTraceCallback wraps args[position] in a
3220
- * native error/result + asyncStart/asyncEnd publisher and throws Node's
3221
- * TypeError when that slot is not callable. tracingChannelOf is the
3222
- * five-Channel collection form of the constructor. */
3223
- /** setImmediate as a first-class dyn value (scr_async.c): a minted dyn
3224
- * callable scheduling args[0](args[1..]) on the immediate queue — the
3225
- * Node-suite traceCallback shape (`traceCallback(setImmediate, ...)`).
3226
- * Calling it validates the callback (the dyn call machinery); minting
3227
- * never throws. */
3228
- | "timers.setImmediateFnValue"
3229
- /** `new Promise(setImmediate)` (the Node-suite early-exit shape): a
3230
- * fresh promise an immediate fulfills with the undefined dyn value —
3231
- * the executor IS setImmediate, so resolve rides the immediate queue
3232
- * (scr_async.c). Never throws. */
3233
- | "timers.immediatePromise" | "dc.tracingChannel" | "dc.tracingChannelOf" | "dc.tcChannel" | "dc.tcHasSubscribers" | "dc.tcSubscribe" | "dc.tcUnsubscribe" | "dc.tcTraceSync" | "dc.tcTraceCallback"
3234
- /** tracePromise (scr_dc.c): start publish, the traced call, a wrap of
3235
- * non-promise results, the end publish, and a REACTION FIBER that
3236
- * awaits the traced promise and publishes asyncStart/asyncEnd (error
3237
- * first on rejection) before settling the returned promise<dyn> with
3238
- * the passed-through outcome. MAY THROW (the traced call and the
3239
- * synchronous publishes). */
3240
- | "dc.tcTracePromise"
3241
- /** AsyncLocalStorage (node:async_hooks — scr_async.c): stores are f64
3242
- * handles; contexts are immutable fiber-carried snapshots (spawned
3243
- * fibers inherit the spawner's — Node's init-time capture). run/exit
3244
- * enter (or clear) the store, call the dyn function with forwarded
3245
- * arguments, and restore (the finally); getStore answers the current
3246
- * dyn value or undefined; enterWith installs with no restore point.
3247
- * run/exit MAY THROW (the callback's own throws propagate). */
3248
- /** `await v` over a checked-dynamic VALUE (scr_async.c): a dyn promise
3249
- * adopts (rejections re-throw — MAY THROW), anything else takes JS's
3250
- * one-microtask non-thenable await and answers itself. Only emitted
3251
- * inside async bodies (the frontend's isAsync gate). */
3252
- | "async.awaitDyn"
3253
- /** The bare one-microtask hop (scr_await_hop): `await v` over a typed
3254
- * NON-promise value — JS awaits non-thenables through exactly one
3255
- * microtask turn and yields the value itself. Never throws. */
3256
- | "async.hop" | "als.new" | "als.get" | "als.run" | "als.exitRun" | "als.enterWith" | "als.disable"
3257
- /** Channel.bindStore/unbindStore/runStores (scr_dc.c): the
3258
- * AsyncLocalStorage integration — set-semantics bindings per store,
3259
- * runStores entering every bound store with transform(data) around the
3260
- * publish and the callback (MAY THROW: transforms, subscribers, and
3261
- * the callback all run). */
3262
- | "dc.chanBindStore" | "dc.chanUnbindStore" | "dc.chanRunStores"
3263
- /** process warnings (scr_lib.c): onWarning/offWarning register dyn
3264
- * listeners; emitWarning applies Node's full argument grammar over the
3265
- * call's dyn argument vector (ERR_INVALID_ARG_TYPE TypeErrors — MAY
3266
- * THROW; a listener throw propagates too) and always prints Node's
3267
- * stderr report. Emission is synchronous (SEMANTICS.md). */
3268
- | "process.onWarning" | "process.offWarning" | "process.emitWarning"
3269
- /** process.on/once('unhandledRejection', fn): registers a dyn listener
3270
- * the checkpoint report dispatches per never-observed rejection —
3271
- * (reason, promise) — instead of printing and exiting 1 (scr_async.c).
3272
- * The bool second arg is `once` (auto-removed after one delivery,
3273
- * Node's once); off/removeListener remove by closure identity, the
3274
- * offWarning stance. Throws Node's ERR_INVALID_ARG_TYPE on a
3275
- * non-function. */
3276
- /** Uncaught exception handlers and monitors: [callback dyn, once, monitor]. */
3277
- | "process.onUncaughtException" | "process.offUncaughtException" | "process.onUnhandledRejection" | "process.offUnhandledRejection"
3278
- /** process.on/once/off('rejectionHandled', fn): the sibling registry.
3279
- * A handler attached after unhandledRejection delivery fires the event
3280
- * once. Dispatch is synchronous at the attach, with the promise,
3281
- * Node's payload. */
3282
- | "process.onRejectionHandled" | "process.offRejectionHandled"
3283
- /** The Number statics with a static C implementation (scr_lib.c): one
3284
- * f64 arg → bool, JS-exact BY CONSTRUCTION — Number.isFinite/isNaN/
3285
- * isInteger/isSafeInteger never coerce, and the frontend routes only
3286
- * f64-typed arguments here (other static types fence). None throws. */
3287
- | "number.isFinite" | "number.isNaN" | "number.isInteger" | "number.isSafeInteger"
3288
- /** Date (scr_lib.c). Values are TimeClip'd epoch-millisecond scalars:
3289
- * construction/store/pass/getters are exact while identity and mutation
3290
- * remain fenced. date.now is Node's integer milliseconds since epoch;
3291
- * date.toISOString formats one raw f64 millisecond time value and
3292
- * date.toISOStringValue formats a stored Date, both with Node's rules (UTC,
3293
- * YYYY-MM-DDTHH:mm:ss.sssZ, expanded ±YYYYYY years outside 0–9999,
3294
- * ToInteger truncation of fractional ms) and THROWS Node's "Invalid
3295
- * time value" RangeError on NaN / out-of-range input (may-throw seed).
3296
- * Results: f64 / owned (+1) string. */
3297
- | "date.now" | "date.newNow" | "date.newMs" | "date.newString"
3298
- /** Date.parse(dateString), with its own reach witness for exact fences. */
3299
- | "date.parse" | "date.getTime" | "date.valueOf" | "date.toISOString" | "date.toISOStringValue" | "date.getFullYear" | "date.getUTCFullYear" | "date.getMonth" | "date.getUTCMonth" | "date.getDate" | "date.getUTCDate" | "date.getDay" | "date.getUTCDay" | "date.getHours" | "date.getUTCHours" | "date.getMinutes" | "date.getUTCMinutes" | "date.getSeconds" | "date.getUTCSeconds" | "date.getMilliseconds" | "date.getUTCMilliseconds" | "date.getTimezoneOffset"
3300
- /** The composed `new Date(dateString).getTime()` read: one borrowed
3301
- * string, f64 milliseconds since epoch. The parsed grammar is BOUNDED
3302
- * (documented divergence — V8's parser accepts far more): the ASN.1
3303
- * validity shape X509Certificate.validFrom/validTo answer ("Jul 1
3304
- * 00:00:00 2026 GMT" — the portless cert-expiry read), and ECMA's own
3305
- * date-time string format (YYYY-MM-DD[THH:mm[:ss[.sss]]][Z|±HH:MM] —
3306
- * date-only forms are UTC, exactly the spec). Anything else is NaN,
3307
- * Node's invalid-date getTime. Never throws. */
3308
- | "date.parseGetTime"
3309
- /** `Date.UTC(...)` — seven f64 arguments (the frontend completes the
3310
- * spec's defaults for omitted trailing parts: month 0, date 1, time
3311
- * parts 0), the spec's MakeDay/MakeTime/TimeClip exactly: 0–99 years
3312
- * map to 1900+year, out-of-range months/dates roll over, non-finite
3313
- * parts and out-of-range results answer NaN. Never throws. */
3314
- | "date.utc"
3315
- /** The fs option forms and friends (scr_lib.c), all throwing catchably
3316
- * like the rest of sync fs. mkdirRecursiveSync is Node's recursive
3317
- * algorithm (try mkdir, EEXIST-dir is fine, ENOENT creates the parent
3318
- * first — errors report Node's errno at Node's path, EEXIST at a file
3319
- * target, ENOTDIR at the full path past a file); the first-created-dir
3320
- * return value has no lowering (statement position only, frontend-
3321
- * fenced). rmOptsSync is rmSync with (recursive, force) bools: force
3322
- * swallows ENOENT, recursive removes trees post-order, a directory
3323
- * without recursive throws the EISDIR-worded error (divergence 13's
3324
- * wording note). mkdtempSync appends the six X's and returns the
3325
- * created path (+1). accessSync takes the F_OK/R_OK/W_OK/X_OK bits as
3326
- * one f64 (the frontend bakes fs.constants.* as literals and completes
3327
- * an omitted mode to 0). readFdSync/readFdSyncBytes are the
3328
- * readFileSync(fd[, "utf8"]) forms — a read(2) loop to EOF on the fd
3329
- * (the stdin path); errors carry Node's no-path message shape. */
3330
- | "fs.mkdirRecursiveSync" | "fs.rmOptsSync"
3331
- /** rmOptsSync's maxRetries/retryDelay form (path, recursive, force,
3332
- * maxRetries, retryDelay): Node's linear-backoff retry on
3333
- * EBUSY/EMFILE/ENFILE/ENOTEMPTY/EPERM — the tmpdir-harness shape
3334
- * rmSync(p, { maxRetries: 3, recursive: true, force: true }). */
3335
- | "fs.rmRetrySync" | "fs.mkdtempSync" | "fs.accessSync" | "fs.readFdSync" | "fs.readFdSyncBytes"
3336
- /** isatty(3) over an fd literal (0/1/2 — process.stdin/stdout/stderr
3337
- * .isTTY reads). A real boolean: false where Node's non-TTY streams
3338
- * expose undefined (documented divergence). Never throws. */
3339
- | "process.isTTY"
3340
- /** process.stdin.destroy(): a deliberate no-op (no stream machinery
3341
- * exists to tear down; documented in SEMANTICS.md). */
3342
- | "process.stdinDestroy"
3343
- /** process.stdin.setRawMode(mode) — one borrowed bool arg, void. On a
3344
- * TTY stdin: termios raw mode on/off (libuv's UV_TTY_MODE_RAW flag set,
3345
- * the mode Node's setRawMode(true) applies; false restores the entry
3346
- * state). On a NON-TTY stdin Node's process.stdin has no such method at
3347
- * all, so the call throws Node's exact catchable TypeError
3348
- * ("process.stdin.setRawMode is not a function") — the may-throw seed
3349
- * carries it. */
3350
- | "process.stdinSetRawMode"
3351
- /** Terminal width over an fd literal (1/2 — process.stdout/stderr
3352
- * .columns): ioctl(TIOCGWINSZ). The result is the module's interned
3353
- * `number | undefined` union — a non-TTY stream (or an ioctl refusal)
3354
- * yields the undefined arm, exactly Node's missing `.columns`. Never
3355
- * throws. */
3356
- | "process.columns"
3357
- /** Terminal height, with the same fd and optional-number contract. */
3358
- | "process.rows"
3359
- /** fromCharCode takes one packed f64[] or bytes arg and builds a string
3360
- * from UTF-16 code units. Adjacent surrogate pairs combine; lone
3361
- * surrogates follow the runtime's replacement policy. */
3362
- | "string.fromCharCode"
3363
- /** Numeric code points, with catchable RangeError for non-integers or
3364
- * values outside 0..0x10ffff. Uses the same UTF-8 surrogate policy. */
3365
- | "string.fromCodePoint"
3366
- /** lastIndexOf returns the last UTF-16 start index, or -1. The two-arg
3367
- * form searches at or before its numeric position; NaN starts at the end.
3368
- * String arguments are borrowed and neither form throws. */
3369
- | "string.lastIndexOf" | "string.lastIndexOfFrom"
3370
- /** String.raw(template, ...subs): the raw literals array (a string[]
3371
- * read off the template record) interleaved with the PRE-STRINGIFIED
3372
- * substitutions (the frontend applies the static ToString and packs
3373
- * them into one string[] literal) — extra substitutions drop, missing
3374
- * ones skip, the spec's loop exactly (scr_array.c). Borrowed args;
3375
- * +1 string; never throws. */
3376
- | "string.raw"
3377
- /** WHATWG TextDecoder.decode over u8 bytes (scr_bytes.c): utf-8 with
3378
- * default options — the same maximal-subpart replacement decode as
3379
- * Buffer.toString("utf8"), with the leading BOM stripped (the one
3380
- * behavioral difference; ignoreBOM defaults to false). Inline calls
3381
- * lower directly; stored decoder records dispatch by encoding id.
3382
- * TextEncoder.encode needs no libFn: its matching forms
3383
- * lower to buffer.fromStr(s, "utf8") (identical bytes — ScrStr storage
3384
- * is well-formed UTF-8). Borrowed arg; owned (+1) string; never throws. */
3385
- | "text.decode" | "bytes.bufferSource" | "text.decodeBufferSource" | "text.decodeOptions" | "text.decodeStream" | "text.decodeLegacyOptions"
3386
- /** TextDecoder.decode for a compile-time non-UTF-8 WHATWG label. The
3387
- * second f64 is the frontend-owned encoding id consumed by scr_bytes.c;
3388
- * label aliases/case/ASCII whitespace are canonicalized before IR. The
3389
- * mapping tables are generated from the pinned Node 24 oracle, keeping
3390
- * output portable without an ICU/iconv dependency. Borrowed args; owned
3391
- * (+1) string; never throws. */
3392
- | "text.decodeLegacy" | "text.decoderEncoding" | "text.decoderName" | "text.encodeInto" | "buffer.isAscii" | "buffer.isUtf8" | "buffer.transcode"
3393
- /** The wider sync fs slice (scr_lib.c), all throwing catchably with
3394
- * Node's errno message shapes and `.code` stamped like the rest of
3395
- * sync fs. unlink/chmod/chown wrap the syscalls 1:1 (Node reports the
3396
- * syscall's own name). copyFileSync copies contents into a fresh (or
3397
- * truncated) destination carrying the SOURCE's mode (libuv's
3398
- * uv_fs_copyfile behavior); its errors carry BOTH paths — Node's
3399
- * "copyfile 'src' -> 'dest'". lstatSync is statSync without following
3400
- * a trailing symlink (Node reports lstat); stats.isSymbolicLink /
3401
- * stats.dev / ino / blocks / nlink / atimeMs / mtimeMs / ctimeMs are pure reads on the widened
3402
- * snapshot (blocks is allocated 512-byte units; the times are milliseconds
3403
- * with their sub-second fractions, Node's arithmetic).
3404
- * writeFileModeSync is writeFileSync(path, data, { mode }): the mode
3405
- * applies at CREATION only (open(2) with O_CREAT, umask applying),
3406
- * exactly Node — an existing file keeps its permissions. mkdirModeSync
3407
- * / mkdirRecursiveModeSync are the mkdirSync option forms with an
3408
- * explicit mode (the recursive walk passes it to every directory it
3409
- * creates, like Node's). */
3410
- | "fs.unlinkSync" | "fs.chmodSync" | "fs.chownSync" | "fs.copyFileSync"
3411
- /** renameSync is the direct two-path syscall wrapper. renameCb defers
3412
- * the operation to the loop and fires a program-shaped Error | null
3413
- * callback through a backend-emitted adapter. */
3414
- | "fs.renameSync" | "fs.renameCb" | "fs.lstatSync" | "fs.fstatSync" | "fs.fchmodSync" | "fs.fsyncSync" | "fs.fdatasyncSync" | "fs.ftruncateSync" | "fs.utimesSync" | "fs.futimesSync" | "fs.lutimesSync" | "fs.readvSync" | "fs.writevSync" | "fs.linkSync" | "fs.symlinkSync" | "fs.readlinkSync" | "fs.statfsSync" | "fs.readlinkSyncStr" | "fs.readlinkSyncBuffer"
3415
- /** fs.openSync(path, flags) → the raw fd as f64; fs.readSync/fs.writeSync
3416
- * over Buffer windows perform sequential I/O when position is -1 and
3417
- * offset-preserving positioned I/O otherwise; fs.writeStrSync is the
3418
- * utf8 string twin; and fs.closeSync(fd) closes the descriptor. This is
3419
- * the fd slice behind spawn/log-processing forms.
3420
- * flags is Node's string
3421
- * grammar ("r", "w", "a" and the +/x variants; unknown flags throw
3422
- * Node's ERR_INVALID_ARG_VALUE TypeError text). All throw Node-shaped
3423
- * fs errors (openSync ENOENT/EACCES..., readSync EBADF/range errors,
3424
- * closeSync EBADF). */
3425
- | "fs.openSync" | "fs.openNumericSync" | "fs.readSync" | "fs.writeSync" | "fs.writeStrSync" | "fs.closeSync"
3426
- /** fs.watch(path, listener?) → an FSWatcher handle (scr_watch.c —
3427
- * linked, and scr_watch_install() emitted, only when these appear on
3428
- * the IR; moduleUsesFsWatch is the switch). The path opens NOW —
3429
- * failure throws Node's fs error synchronously ("ENOENT: ..., watch
3430
- * 'x'", the polling-fallback catch shape) — and the unit's kqueue
3431
- * (EVFILT_VNODE) delivers "rename"/"change" through the loop's watch
3432
- * hook. The callback (nullable) MOVES in with an adapter per listener
3433
- * shape (zero-param, or the (eventType: string) form — runtime-
3434
- * provided); an open watcher keeps the loop alive until watcher.close()
3435
- * (idempotent, receiver borrowed, statement position only). */
3436
- | "fs.watch" | "fs.watchCb" | "watcher.close"
3437
- /** The composed `new crypto.X509Certificate(data).fingerprint` read
3438
- * (scr_lib.c — no certificate handle exists): the SHA-1 of the DER,
3439
- * uppercase colon-separated, over PEM or raw-DER Buffer input; other
3440
- * inputs throw Node's ERR_OSSL_PEM_NO_START_LINE Error (may-throw). */
3441
- | "crypto.x509Fingerprint" | "crypto.x509FingerprintStr"
3442
- /** The certificate's Validity window (validFrom / validTo reads —
3443
- * scr_lib.c's minimal ASN.1 walk to the TBSCertificate validity
3444
- * SEQUENCE): UTCTime and GeneralizedTime render in Node's exact
3445
- * ASN1_TIME_print shape ("Jul 1 00:00:00 2026 GMT" — %2d space-padded
3446
- * day). Same input contract and PEM error as the fingerprint pair
3447
- * (may-throw). */
3448
- | "crypto.x509ValidFrom" | "crypto.x509ValidFromStr" | "crypto.x509ValidTo" | "crypto.x509ValidToStr" | "stats.isSymbolicLink" | "stats.blocks" | "stats.nlink" | "stats.atimeMs" | "stats.mtimeMs" | "stats.ctimeMs" | "fs.writeFileModeSync" | "fs.mkdirModeSync" | "fs.mkdirRecursiveModeSync"
3449
- /** spawnSync with options (scr_child.c): the cp.spawnSync core plus the
3450
- * option slice portless-class CLIs pass — timeout (killSignal fires at
3451
- * the deadline and the result carries error: ETIMEDOUT + the signal,
3452
- * Node's shape), killSignal (a signal NAME; "" = the SIGTERM default),
3453
- * and per-fd stdio modes (in: 0 /dev/null, 1 ignore, 2 inherit; out/
3454
- * err: 0 capture, 1 ignore → "", 2 inherit → ""). NEVER throws — spawn
3455
- * failure and timeout are data on the result, like Node's error
3456
- * property. spawnRes.signal is the result's termination signal as the
3457
- * call site's `Signals | null` union (null = exited normally or spawn
3458
- * failure), constructed type-directedly like spawnRes.status. */
3459
- | "cp.spawnSyncOpts"
3460
- /** cp.spawnSyncOpts with the stdio carried as a RUNTIME string —
3461
- * "pipe" | "ignore" | "inherit", proven by the call site's TYPE (the
3462
- * defaultRunner idiom `stdio: options?.stdio ?? "pipe"`); the runtime
3463
- * maps the value to the three modes. Args (cmd, argv, timeout,
3464
- * killSignal, stdio). Never throws, like the other spawnSync forms. */
3465
- | "cp.spawnSyncStdioStr" | "spawnRes.signal"
3466
- /** spawn with options (scr_child.c): the cp.spawn core plus PER-SLOT
3467
- * stdio — args are (cmd, argv, inMode, outMode, errMode, outFd, errFd,
3468
- * detached, hasEnv, envPairs, cwd); modes 0 ignore (/dev/null), 1
3469
- * inherit, 2 fd (out/err only — the fd dup2s into the child's slot,
3470
- * Node's stdio fd form; the daemon-log idiom ["ignore", logFd, logFd]).
3471
- * detached is POSIX_SPAWN_SETSID (the child gets its own session and
3472
- * process group, Node's semantics), env is a REPLACEMENT ([k,v,...]
3473
- * pairs like cp.execSync's), cwd ""=inherit. Same event/loop story as
3474
- * cp.spawn. */
3475
- | "cp.spawnOpts"
3476
- /** Runtime options normalized into the native spawn core; unsupported
3477
- * process features retain explicit refusals. (command, args, options). */
3478
- | "cp.spawnDynamic"
3479
- /** Atomics.wait(int32Array, idx, expected, timeoutMs) → "not-equal"
3480
- * when the element differs from `expected`, else a real nanosleep for
3481
- * the timeout and "timed-out" (scr_lib.c). scriptc has no threads —
3482
- * no other agent can ever notify, so for every compilable program this
3483
- * IS the spec's behavior, and "ok" is unreachable; the frontend
3484
- * REQUIRES the timeout argument (an infinite wait here is a certain
3485
- * deadlock, fenced). The SharedArrayBuffer the lib types demand exists
3486
- * only syntactically (new Int32Array(new SharedArrayBuffer(n)) lowers
3487
- * to a plain i32 typed array — sharing is unobservable without
3488
- * threads; SEMANTICS.md documents the stance). Never throws; +1 string
3489
- * result. */
3490
- | "atomics.wait";
3491
1602
  /** Numeric binary ops. The bitwise six (`&`/`|`/`^`/`<<`/`>>`/`>>>`) have
3492
1603
  * JS ToInt32/ToUint32 semantics — operands convert (NaN/±Infinity → 0,
3493
1604
  * truncate, wrap mod 2^32), the operation runs in 32-bit space (shift
@@ -5262,258 +3373,3 @@ export declare function canMarshalIntoIsland(t: IrType, getRecord: (shapeId: str
5262
3373
  * Promise.all arm). Null = outside the domain (the boundary fence). */
5263
3374
  export declare function islandPromisePayloadTag(inner: IrType): "void" | "f64" | "bool" | "string" | "jsval" | "jsvalArr" | null;
5264
3375
  export declare function canExitIslandToType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
5265
- export interface RuntimeFeatures {
5266
- regex: boolean;
5267
- copying: boolean;
5268
- legacyTextDecoder: boolean;
5269
- fileHandle: boolean;
5270
- fetch: boolean;
5271
- processEvents: boolean;
5272
- emitter: boolean;
5273
- stream: boolean;
5274
- zlib: boolean;
5275
- dc: boolean;
5276
- assert: boolean;
5277
- dynInvoke: boolean;
5278
- dynAsync: boolean;
5279
- inspect: boolean;
5280
- childProcess: boolean;
5281
- net: boolean;
5282
- symbol: boolean;
5283
- bigint: boolean;
5284
- searchParams: boolean;
5285
- qs: boolean;
5286
- parseArgs: boolean;
5287
- fsWatch: boolean;
5288
- nodeTest: boolean;
5289
- dgram: boolean;
5290
- http: boolean;
5291
- http2: boolean;
5292
- tls: boolean;
5293
- tlsCa: boolean;
5294
- }
5295
- /** Inspect types and expressions together in one traversal. This is a fresh
5296
- * snapshot: callers may mutate an IR module between compilation passes. */
5297
- export declare function moduleRuntimeFeatures(mod: IrModule): RuntimeFeatures;
5298
- /** True when the module contains any regex construct — a regexLit /
5299
- * regexIntrinsic node or a regex-typed slot anywhere. This is the link
5300
- * switch that pulls scr_regex.c + the vendored libregexp into the binary
5301
- * (native-toolchain.ts); regex-free programs keep the historical command line. The
5302
- * typed traversal visits type slots as well as executable nodes. */
5303
- export declare function moduleUsesRegex(mod: IrModule): boolean;
5304
- /** True when the module contains an intrinsic whose implementation lives
5305
- * in scr_copying.c. This is the link switch that keeps the optional
5306
- * Array-copying and typed-array bridge TU out of unrelated binaries. */
5307
- export declare function moduleUsesCopying(mod: IrModule): boolean;
5308
- /** True when a non-UTF-8 TextDecoder call survives lowering. This gates the
5309
- * generated legacy mapping tables inside scr_bytes.c; the default UTF-8
5310
- * decoder and unrelated Buffer users keep their prior runtime object. */
5311
- export declare function moduleUsesLegacyTextDecoder(mod: IrModule): boolean;
5312
- /** True when a FileHandle type survives in the module. This is the link
5313
- * switch for scr_file_handle.c; fs/promises.open carries the type inside its
5314
- * promise result even when no handle method is called. */
5315
- export declare function moduleUsesFileHandle(mod: IrModule): boolean;
5316
- /** True when user code lowers static fetch or the embedded npm graph
5317
- * reaches the engine's global fetch — the link switch that pulls scr_fetch.c +
5318
- * its socket/tls/zlib dependencies into the binary (native-toolchain.ts) and has the
5319
- * emitted main call scr_fetch_install. The npm graph records the embedded
5320
- * source fact with a parser + binder, so comments, strings, property names,
5321
- * and local `fetch` bindings do not change the link or target capability.
5322
- * Fetch-free graphs keep their exact historical link lines. */
5323
- export declare function moduleUsesFetch(mod: IrModule): boolean;
5324
- /** True when the module uses the process-events surface — the link switch
5325
- * that pulls scr_events.c into the binary and has the emitted main call
5326
- * scr_events_install (native-toolchain.ts + emitter; the scr_regex/scr_fetch/scr_zlib
5327
- * gating precedent). Event-free programs pay zero bytes and keep their
5328
- * exact link line. Same generic-walk shape as moduleUsesRegex. */
5329
- export declare function moduleUsesProcessEvents(mod: IrModule): boolean;
5330
- /** True when the module uses the node:events EventEmitter surface — the
5331
- * link switch that pulls scr_events_emitter.c into the binary (native-toolchain.ts; the
5332
- * scr_events.c gating precedent, but pure data structure: no install, no
5333
- * loop hooks). Two signals: the `%EventEmitter` class def rides the
5334
- * module (any emitter-typed value or `extends EventEmitter` subclass
5335
- * references it, and the emitted RC/trace helpers call scr_emitter_*),
5336
- * or an emitter.* libCall survived (the defaultMaxListeners statics carry
5337
- * no emitter-typed value). Emitter-free programs pay zero bytes and keep
5338
- * their exact link line. */
5339
- export declare function moduleUsesEmitter(mod: IrModule): boolean;
5340
- /** True when the program touches the node:stream surface (scr_stream.c —
5341
- * the moduleUsesEmitter story: the class defs ride the module whenever a
5342
- * stream-typed value exists, and every stream libCall names its unit).
5343
- * Stream programs always use the emitter unit too — the stream class
5344
- * defs pull `%EventEmitter` through their base chain, so
5345
- * moduleUsesEmitter answers true whenever this does. Stream-free
5346
- * programs pay zero bytes and keep their exact link line. */
5347
- export declare function moduleUsesStream(mod: IrModule): boolean;
5348
- /** True when the embedded npm graph has an edge into `builtin` — the
5349
- * island shim needs the corresponding native bridge linked (zlib's is
5350
- * the first; the emitted main installs it before any island entry). */
5351
- export declare function moduleEmbedsBuiltin(mod: IrModule, builtin: string): boolean;
5352
- /** Embedded module texts at least this long are DEFLATE-compressed into
5353
- * the emitted LLVM (island.ts; each stays plain when deflate does not
5354
- * shrink it) and inflated lazily by the island's module loader at first
5355
- * load. Below it the zlib round trip cannot pay for itself. */
5356
- export declare const NPM_COMPRESS_MIN = 1024;
5357
- /** True when the emitted npm tables will carry compressed module text —
5358
- * the SAME candidate test island.ts compresses by, so index.ts's
5359
- * zlib link switch and emitter.ts's inflater installation stay in
5360
- * lockstep with the emission (a candidate whose deflate happens not to
5361
- * shrink stays plain; the installed inflater is then just unused). */
5362
- export declare function moduleEmbedsCompressedNpm(mod: IrModule): boolean;
5363
- /** True when the module contains any zlib libCall (the static lowering)
5364
- * OR the embedded npm graph imports node:zlib (the island shim) — the
5365
- * link switch that pulls scr_zlib.c + the system libz into the binary
5366
- * (native-toolchain.ts); zlib-free programs keep their exact link line. Same
5367
- * generic-walk shape as moduleUsesRegex: `kind`/`fn` discriminants live
5368
- * only on IR objects. */
5369
- export declare function moduleUsesZlib(mod: IrModule): boolean;
5370
- /** True when the module contains any dc.* libCall — the link switch that
5371
- * pulls scr_dc.c (the diagnostics_channel registry and pub/sub) into the
5372
- * binary (native-toolchain.ts). Channel-free binaries keep their exact size class.
5373
- * Same walk shape as moduleUsesZlib. */
5374
- export declare function moduleUsesDc(mod: IrModule): boolean;
5375
- /** True when the module contains any assert libCall — the link switch
5376
- * that pulls scr_assert.c into the binary (native-toolchain.ts). scr_regex.c calls the
5377
- * assert throw/inspect helpers (assert.match lives there), so the regex
5378
- * switch also pulls scr_assert.c; assert-free, regex-free binaries keep
5379
- * the historical command line and size. Same walk shape as
5380
- * moduleUsesZlib. */
5381
- export declare function moduleUsesAssert(mod: IrModule): boolean;
5382
- /** True when the module contains any dynInvoke node or dyn.defineProps
5383
- * libCall — the link switch that pulls scr_dyn_invoke.c (the prototype-
5384
- * method dispatch on dyn receivers, plus scr_dyn_display and
5385
- * scr_dyn_define_props) into the binary (native-toolchain.ts; the assert gating
5386
- * precedent — dispatch-free binaries keep their exact size class). Same
5387
- * walk shape as moduleUsesZlib. */
5388
- export declare function moduleUsesDynInvoke(mod: IrModule): boolean;
5389
- /** True when the module contains any insp libCall — the link switch that
5390
- * pulls scr_inspect.c into the binary (native-toolchain.ts; the assert gating
5391
- * precedent — inspect-free binaries keep the historical command line and
5392
- * size class). Same walk shape as moduleUsesZlib. */
5393
- /** True when the module needs scr_async_dyn.c — the checked-dynamic
5394
- * async surfaces (dyn-promise then/catch/finally reactions, await of a
5395
- * dyn value, `new Promise(setImmediate)`, AsyncLocalStorage, the
5396
- * unhandledRejection/warning process events). Also pulled by the
5397
- * dynInvoke and dc gates (their TUs call into this one) — native-toolchain.ts. Same
5398
- * walk shape as moduleUsesZlib. */
5399
- export declare function moduleUsesDynAsync(mod: IrModule): boolean;
5400
- export declare function moduleUsesInspect(mod: IrModule): boolean;
5401
- /** True when the module reaches child_process or carries one of its runtime
5402
- * handle/result types. Besides the existing link consequence, this gates the
5403
- * checked-dynamic ChildProcess handle table installed from scr_child.c. */
5404
- export declare function moduleUsesChildProcess(mod: IrModule): boolean;
5405
- /** True when the module contains any net libCall — the link switch that
5406
- * pulls scr_net.c into the binary and has the emitted main call
5407
- * scr_net_install (native-toolchain.ts + emitter; the scr_events gating precedent).
5408
- * Net-free programs pay zero bytes and keep their exact link line. Same
5409
- * generic-walk shape as moduleUsesZlib. */
5410
- export declare function moduleUsesNet(mod: IrModule): boolean;
5411
- /** True when the module contains any sym.* libCall or a symbol-kind type
5412
- * anywhere in the IR — the link switch that pulls scr_symbol.c into the
5413
- * binary (native-toolchain.ts; the scr_net gating precedent — no install call, the
5414
- * Symbol.for registry initializes lazily). The TYPE check matters like
5415
- * net's: a symbol-typed local whose initializer compiled to a runtime
5416
- * fence still emits release calls that need the unit linked. Symbol-free
5417
- * programs pay zero bytes and keep their exact link line. */
5418
- export declare function moduleUsesSymbol(mod: IrModule): boolean;
5419
- /** True when bigint runtime operations or bigint-typed storage appears in
5420
- * the IR. The type check keeps retain/release references link-safe even
5421
- * when a producing statement was replaced by a runtime fence. */
5422
- export declare function moduleUsesBigInt(mod: IrModule): boolean;
5423
- /** True when the module uses the URLSearchParams surface — sp.* libCalls,
5424
- * the url.searchParams getter, or a searchParams-kind type anywhere on
5425
- * the IR (a fenced statement can leave a typed local whose release call
5426
- * still needs the unit linked) — the link switch that pulls
5427
- * scr_url_params.c into the binary (the moduleUsesSymbol precedent: pure
5428
- * data structure, no loop hooks, cross-compiles everywhere). sp-free
5429
- * programs keep their exact link line; scr_url.c itself stays
5430
- * always-linked and never references the unit. */
5431
- export declare function moduleUsesSearchParams(mod: IrModule): boolean;
5432
- /** True when the module uses the node:querystring surface — the qs.*
5433
- * libCalls that live in scr_qs.c (parse/stringify/unescape; qs.escape
5434
- * emits the always-linked component encoder and deliberately does NOT
5435
- * flip this switch) — the link switch that pulls scr_qs.c into the
5436
- * binary (the moduleUsesSearchParams precedent: pure data transforms, no
5437
- * loop hooks, cross-compiles everywhere). qs-free programs keep their
5438
- * exact link line. Same generic-walk shape as moduleUsesZlib. */
5439
- export declare function moduleUsesQs(mod: IrModule): boolean;
5440
- /** True when the module uses native util parsing, comparison, or styling.
5441
- * The utility units also follow their required symbol, inspection, and
5442
- * warning features, independently of the island's node:util shim. */
5443
- export declare function moduleUsesParseArgs(mod: IrModule): boolean;
5444
- /** True when the module contains any fs.watch/watcher.* libCall — the
5445
- * link switch that pulls scr_watch.c into the binary and has the emitted
5446
- * main call scr_watch_install (native-toolchain.ts + emitter; the scr_net gating
5447
- * precedent). Watch-free programs pay zero bytes and keep their exact
5448
- * link line. Same generic-walk shape as moduleUsesZlib. */
5449
- export declare function moduleUsesFsWatch(mod: IrModule): boolean;
5450
- /** True when the module contains any test.* libCall or a testCtx handle
5451
- * type — the link switch that pulls scr_test.c into the binary and has
5452
- * the emitted main return scr_test_exit_code() after the loop drains
5453
- * (native-toolchain.ts + emitter; the moduleUsesDgram shape). Test-free programs pay
5454
- * zero bytes and keep their exact link line. */
5455
- export declare function moduleUsesNodeTest(mod: IrModule): boolean;
5456
- /** True when the module contains any dgram.* or dns.* libCall — the
5457
- * link switch that pulls scr_dgram.c into the binary and has the emitted
5458
- * main call scr_dgram_install (native-toolchain.ts + emitter; the scr_net gating
5459
- * precedent — dns.lookup lives in the same unit, so either prefix
5460
- * answers). Dgram-free programs pay zero bytes and keep their exact link
5461
- * line. Same generic-walk shape as moduleUsesZlib. */
5462
- export declare function moduleUsesDgram(mod: IrModule): boolean;
5463
- /** True when the module contains any http.* libCall — the link switch
5464
- * that pulls scr_http.c into the binary (native-toolchain.ts; moduleUsesNet already
5465
- * answers true for these, so scr_net.c comes along). */
5466
- export declare function moduleUsesHttpServer(mod: IrModule): boolean;
5467
- /** True when the module uses the REAL h2 surface (scr_http2.c): any core
5468
- * http2.* libCall, or an h2 handle type left behind by a fenced statement
5469
- * (its emitted release call needs the unit — the moduleUsesNet story). */
5470
- export declare function moduleUsesHttp2(mod: IrModule): boolean;
5471
- /** True when the module contains any tls.* or https.* libCall — the link
5472
- * switch that pulls scr_tls.c and the vendored mbedTLS archive into the
5473
- * binary (native-toolchain.ts; moduleUsesNet and moduleUsesHttpServer already answer
5474
- * true for these, so scr_net.c and scr_http.c come along). TLS-free
5475
- * programs keep their exact link line and never build mbedTLS. */
5476
- export declare function moduleUsesTls(mod: IrModule): boolean;
5477
- /** True when the module contains any tlsca.* libCall — the link switch
5478
- * for scr_tls_ca.c, the CA-store introspection unit (getCACertificates /
5479
- * rootCertificates / setDefaultCACertificates). Deliberately SEPARATE
5480
- * from moduleUsesTls: the unit is plain PEM-block bookkeeping, so a
5481
- * program that only inspects the CA store never pulls mbedTLS. native-toolchain.ts
5482
- * also compiles the unit whenever TLS itself links — scr_tls.c consults
5483
- * the unit's default-set override for its trust anchors. */
5484
- export declare function moduleUsesTlsCa(mod: IrModule): boolean;
5485
- /** First async/event-loop/ambient-process surface the module graph
5486
- * reaches, or null when the graph is async_free (the v1 library requirement).
5487
- * Typed slots use their declaration location and executable nodes use their
5488
- * own location, so the refusal anchors at the reaching construct; the
5489
- * coarse moduleUses* predicates are the safety net behind the fine-grained
5490
- * table (a surface reached only through a spelling the table misses still
5491
- * refuses, anchored at the entry). */
5492
- export declare function moduleLibAsyncSurface(mod: IrModule): {
5493
- surface: string;
5494
- loc: SrcLoc;
5495
- } | null;
5496
- /** libCall families that demote `deterministic` (prefix match over
5497
- * IrLibFn spellings). process.stdout/stderr writes are deliberately NOT
5498
- * here: output is an effect, not a nondeterminism input, and console
5499
- * policy is the profile's ask-5 business. process.platform/arch and the
5500
- * version constants fold at compile time, so they are per-binary
5501
- * constants, not ambient reads. Exported for the attestation-parity test
5502
- * (tests/harness/surface-manifest.test.ts): every spelling this table
5503
- * demotes on must be deniable by a manifest-id fence, or the ask-5 §4
5504
- * invariant (compiles under full fences ⇒ deterministic) cannot be
5505
- * stated. */
5506
- export declare const LIB_NONDETERMINISTIC_PREFIXES: readonly [string, string][];
5507
- /** First ambient-nondeterminism or ambient-authority surface the module
5508
- * graph reaches, or null when the graph is clean (the sidecar then
5509
- * attests `deterministic: true`). */
5510
- export declare function moduleLibNondeterministicSurface(mod: IrModule): string | null;
5511
- /** The may-throw seed: libCall members that can raise. Every fs.* member
5512
- * EXCEPT existsSync (which, like Node's, swallows errors and returns false)
5513
- * throws a catchable error on failure; json.parse throws a catchable
5514
- * SyntaxError-shaped string on malformed input. Backends' may-throw analyses must treat a function containing one
5515
- * of these as throwing, exactly like a `throw` statement (and must ALSO
5516
- * seed on `dynCheck` and `awaitExpr` nodes, which throw on validation
5517
- * failure / promise rejection). */
5518
- export declare const MAY_THROW_LIB_FNS: ReadonlySet<IrLibFn>;
5519
- export {};