@scriptc/compiler 0.2.3 → 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 (1124) 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.d.ts +15 -0
  38. package/dist/backend/llvm/borrowed-inputs.js +28 -0
  39. package/dist/backend/llvm/borrowed-inputs.js.map +1 -0
  40. package/dist/backend/llvm/borrowed-receivers.js +43 -19
  41. package/dist/backend/llvm/borrowed-receivers.js.map +1 -1
  42. package/dist/backend/llvm/byte-numbers.d.ts +10 -0
  43. package/dist/backend/llvm/byte-numbers.js +240 -0
  44. package/dist/backend/llvm/byte-numbers.js.map +1 -0
  45. package/dist/backend/llvm/bytes-bounds.d.ts +9 -0
  46. package/dist/backend/llvm/bytes-bounds.js +240 -0
  47. package/dist/backend/llvm/bytes-bounds.js.map +1 -0
  48. package/dist/backend/llvm/call-lifetimes.d.ts +10 -0
  49. package/dist/backend/llvm/call-lifetimes.js +83 -20
  50. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  51. package/dist/backend/llvm/call-lifetimes.test.js +203 -18
  52. package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
  53. package/dist/backend/llvm/checked-value-lifetimes.d.ts +13 -0
  54. package/dist/backend/llvm/checked-value-lifetimes.js +45 -0
  55. package/dist/backend/llvm/checked-value-lifetimes.js.map +1 -0
  56. package/dist/backend/llvm/classes.js +16 -12
  57. package/dist/backend/llvm/classes.js.map +1 -1
  58. package/dist/backend/llvm/common.js +4 -1
  59. package/dist/backend/llvm/common.js.map +1 -1
  60. package/dist/backend/llvm/counted-loops.d.ts +6 -0
  61. package/dist/backend/llvm/counted-loops.js +35 -0
  62. package/dist/backend/llvm/counted-loops.js.map +1 -0
  63. package/dist/backend/llvm/debug-info.js +33 -13
  64. package/dist/backend/llvm/debug-info.js.map +1 -1
  65. package/dist/backend/llvm/debug-info.test.js +28 -6
  66. package/dist/backend/llvm/debug-info.test.js.map +1 -1
  67. package/dist/backend/llvm/dyn.js +68 -22
  68. package/dist/backend/llvm/dyn.js.map +1 -1
  69. package/dist/backend/llvm/emitter.d.ts +34 -12
  70. package/dist/backend/llvm/emitter.js +357 -124
  71. package/dist/backend/llvm/emitter.js.map +1 -1
  72. package/dist/backend/llvm/emitter.test.js +237 -46
  73. package/dist/backend/llvm/emitter.test.js.map +1 -1
  74. package/dist/backend/llvm/expr-async.js +28 -8
  75. package/dist/backend/llvm/expr-async.js.map +1 -1
  76. package/dist/backend/llvm/expr-bytes.d.ts +4 -4
  77. package/dist/backend/llvm/expr-bytes.js +78 -36
  78. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  79. package/dist/backend/llvm/expr-callbacks.js +10 -4
  80. package/dist/backend/llvm/expr-callbacks.js.map +1 -1
  81. package/dist/backend/llvm/expr-calls.js +40 -21
  82. package/dist/backend/llvm/expr-calls.js.map +1 -1
  83. package/dist/backend/llvm/expr-containers.d.ts +4 -1
  84. package/dist/backend/llvm/expr-containers.js +157 -76
  85. package/dist/backend/llvm/expr-containers.js.map +1 -1
  86. package/dist/backend/llvm/expr-context.d.ts +11 -0
  87. package/dist/backend/llvm/expr-control.js +27 -8
  88. package/dist/backend/llvm/expr-control.js.map +1 -1
  89. package/dist/backend/llvm/expr-dispatch.js +3 -1
  90. package/dist/backend/llvm/expr-dispatch.js.map +1 -1
  91. package/dist/backend/llvm/expr-dynamic.js +50 -33
  92. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  93. package/dist/backend/llvm/expr-island.js +26 -6
  94. package/dist/backend/llvm/expr-island.js.map +1 -1
  95. package/dist/backend/llvm/expr-primitives.js +139 -37
  96. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  97. package/dist/backend/llvm/expr-primitives.test.js +43 -1
  98. package/dist/backend/llvm/expr-primitives.test.js.map +1 -1
  99. package/dist/backend/llvm/expr-records.js +16 -9
  100. package/dist/backend/llvm/expr-records.js.map +1 -1
  101. package/dist/backend/llvm/expr-stream-bridges.js +44 -26
  102. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  103. package/dist/backend/llvm/expr-stream-bridges.test.js +51 -14
  104. package/dist/backend/llvm/expr-stream-bridges.test.js.map +1 -1
  105. package/dist/backend/llvm/expr-stream-callbacks.js +34 -14
  106. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
  107. package/dist/backend/llvm/integer-values.d.ts +10 -0
  108. package/dist/backend/llvm/integer-values.js +52 -0
  109. package/dist/backend/llvm/integer-values.js.map +1 -0
  110. package/dist/backend/llvm/integer-views.d.ts +7 -0
  111. package/dist/backend/llvm/integer-views.js +83 -0
  112. package/dist/backend/llvm/integer-views.js.map +1 -0
  113. package/dist/backend/llvm/integer-views.test.d.ts +1 -0
  114. package/dist/backend/llvm/integer-views.test.js +69 -0
  115. package/dist/backend/llvm/integer-views.test.js.map +1 -0
  116. package/dist/backend/llvm/lib-abi.js +13 -4
  117. package/dist/backend/llvm/lib-abi.js.map +1 -1
  118. package/dist/backend/llvm/lib-connect.js +7 -1
  119. package/dist/backend/llvm/lib-connect.js.map +1 -1
  120. package/dist/backend/llvm/lib-datagram.js +35 -10
  121. package/dist/backend/llvm/lib-datagram.js.map +1 -1
  122. package/dist/backend/llvm/lib-dispatch.js +36 -15
  123. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  124. package/dist/backend/llvm/lib-filesystem.js +38 -23
  125. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  126. package/dist/backend/llvm/lib-http2.js +60 -15
  127. package/dist/backend/llvm/lib-http2.js.map +1 -1
  128. package/dist/backend/llvm/lib-lookup.js +12 -5
  129. package/dist/backend/llvm/lib-lookup.js.map +1 -1
  130. package/dist/backend/llvm/lib-network.js +97 -31
  131. package/dist/backend/llvm/lib-network.js.map +1 -1
  132. package/dist/backend/llvm/lib-process.js +57 -14
  133. package/dist/backend/llvm/lib-process.js.map +1 -1
  134. package/dist/backend/llvm/lib-shared.js +107 -31
  135. package/dist/backend/llvm/lib-shared.js.map +1 -1
  136. package/dist/backend/llvm/lib-stream.js +33 -14
  137. package/dist/backend/llvm/lib-stream.js.map +1 -1
  138. package/dist/backend/llvm/lib-test.js +21 -7
  139. package/dist/backend/llvm/lib-test.js.map +1 -1
  140. package/dist/backend/llvm/lib-tls.js +69 -20
  141. package/dist/backend/llvm/lib-tls.js.map +1 -1
  142. package/dist/backend/llvm/local-array-reads.d.ts +3 -4
  143. package/dist/backend/llvm/local-array-reads.js +100 -121
  144. package/dist/backend/llvm/local-array-reads.js.map +1 -1
  145. package/dist/backend/llvm/local-array-reads.test.js +379 -71
  146. package/dist/backend/llvm/local-array-reads.test.js.map +1 -1
  147. package/dist/backend/llvm/local-union-storage.d.ts +25 -0
  148. package/dist/backend/llvm/local-union-storage.js +109 -0
  149. package/dist/backend/llvm/local-union-storage.js.map +1 -0
  150. package/dist/backend/llvm/local-union-storage.test.d.ts +1 -0
  151. package/dist/backend/llvm/local-union-storage.test.js +210 -0
  152. package/dist/backend/llvm/local-union-storage.test.js.map +1 -0
  153. package/dist/backend/llvm/map-read-lifetimes.d.ts +6 -2
  154. package/dist/backend/llvm/map-read-lifetimes.js +46 -16
  155. package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
  156. package/dist/backend/llvm/map-read-lifetimes.test.js +93 -17
  157. package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
  158. package/dist/backend/llvm/reference-effects.d.ts +23 -0
  159. package/dist/backend/llvm/reference-effects.js +179 -0
  160. package/dist/backend/llvm/reference-effects.js.map +1 -0
  161. package/dist/backend/llvm/reference-effects.test.d.ts +1 -0
  162. package/dist/backend/llvm/reference-effects.test.js +157 -0
  163. package/dist/backend/llvm/reference-effects.test.js.map +1 -0
  164. package/dist/backend/llvm/shapes.d.ts +7 -4
  165. package/dist/backend/llvm/shapes.js +82 -22
  166. package/dist/backend/llvm/shapes.js.map +1 -1
  167. package/dist/backend/llvm/shapes.test.js +3 -1
  168. package/dist/backend/llvm/shapes.test.js.map +1 -1
  169. package/dist/backend/llvm/split.js +4 -4
  170. package/dist/backend/llvm/split.js.map +1 -1
  171. package/dist/backend/llvm/split.test.js +14 -6
  172. package/dist/backend/llvm/split.test.js.map +1 -1
  173. package/dist/backend/llvm/stack-unions.js +14 -5
  174. package/dist/backend/llvm/stack-unions.js.map +1 -1
  175. package/dist/backend/llvm/stack-unions.test.js +172 -32
  176. package/dist/backend/llvm/stack-unions.test.js.map +1 -1
  177. package/dist/backend/llvm/string-construction.d.ts +10 -0
  178. package/dist/backend/llvm/string-construction.js +38 -0
  179. package/dist/backend/llvm/string-construction.js.map +1 -0
  180. package/dist/backend/llvm/string-construction.test.d.ts +1 -0
  181. package/dist/backend/llvm/string-construction.test.js +90 -0
  182. package/dist/backend/llvm/string-construction.test.js.map +1 -0
  183. package/dist/backend/llvm/string-lifetimes.d.ts +2 -2
  184. package/dist/backend/llvm/string-lifetimes.js +19 -11
  185. package/dist/backend/llvm/string-lifetimes.js.map +1 -1
  186. package/dist/backend/llvm/string-lifetimes.test.js +127 -32
  187. package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
  188. package/dist/backend/llvm/switch-dispatch.d.ts +9 -0
  189. package/dist/backend/llvm/switch-dispatch.js +114 -0
  190. package/dist/backend/llvm/switch-dispatch.js.map +1 -0
  191. package/dist/backend/llvm/switch-dispatch.test.d.ts +1 -0
  192. package/dist/backend/llvm/switch-dispatch.test.js +83 -0
  193. package/dist/backend/llvm/switch-dispatch.test.js.map +1 -0
  194. package/dist/backend/llvm/unsupported.js.map +1 -1
  195. package/dist/backend/llvm/walkers.js +6 -3
  196. package/dist/backend/llvm/walkers.js.map +1 -1
  197. package/dist/backend/mangle.js +9 -3
  198. package/dist/backend/mangle.js.map +1 -1
  199. package/dist/backend/may-throw.js +18 -8
  200. package/dist/backend/may-throw.js.map +1 -1
  201. package/dist/backend/may-throw.test.js +118 -22
  202. package/dist/backend/may-throw.test.js.map +1 -1
  203. package/dist/backend/native/artifact-stamps.d.ts +39 -0
  204. package/dist/backend/native/artifact-stamps.js +371 -0
  205. package/dist/backend/native/artifact-stamps.js.map +1 -0
  206. package/dist/backend/native/cache-warm.d.ts +24 -0
  207. package/dist/backend/native/cache-warm.js +80 -0
  208. package/dist/backend/native/cache-warm.js.map +1 -0
  209. package/dist/backend/native/compiler-fingerprint.d.ts +19 -0
  210. package/dist/backend/native/compiler-fingerprint.js +357 -0
  211. package/dist/backend/native/compiler-fingerprint.js.map +1 -0
  212. package/dist/backend/native/contracts.d.ts +314 -0
  213. package/dist/backend/native/contracts.js +2 -0
  214. package/dist/backend/native/contracts.js.map +1 -0
  215. package/dist/backend/native/dependency-files.d.ts +5 -0
  216. package/dist/backend/native/dependency-files.js +83 -0
  217. package/dist/backend/native/dependency-files.js.map +1 -0
  218. package/dist/backend/native/driver.d.ts +50 -0
  219. package/dist/backend/native/driver.js +294 -0
  220. package/dist/backend/native/driver.js.map +1 -0
  221. package/dist/backend/native/executable.d.ts +18 -0
  222. package/dist/backend/native/executable.js +1267 -0
  223. package/dist/backend/native/executable.js.map +1 -0
  224. package/dist/backend/native/library.d.ts +2 -0
  225. package/dist/backend/native/library.js +614 -0
  226. package/dist/backend/native/library.js.map +1 -0
  227. package/dist/backend/native/linker-fingerprint.d.ts +8 -0
  228. package/dist/backend/native/linker-fingerprint.js +174 -0
  229. package/dist/backend/native/linker-fingerprint.js.map +1 -0
  230. package/dist/backend/native/object-merge.d.ts +2 -0
  231. package/dist/backend/native/object-merge.js +154 -0
  232. package/dist/backend/native/object-merge.js.map +1 -0
  233. package/dist/backend/native/process.d.ts +17 -0
  234. package/dist/backend/native/process.js +42 -0
  235. package/dist/backend/native/process.js.map +1 -0
  236. package/dist/backend/native/program-shards.d.ts +21 -0
  237. package/dist/backend/native/program-shards.js +99 -0
  238. package/dist/backend/native/program-shards.js.map +1 -0
  239. package/dist/backend/native/runtime-inputs.d.ts +12 -0
  240. package/dist/backend/native/runtime-inputs.js +163 -0
  241. package/dist/backend/native/runtime-inputs.js.map +1 -0
  242. package/dist/backend/native/runtime-inputs.test.d.ts +1 -0
  243. package/dist/backend/native/runtime-inputs.test.js +64 -0
  244. package/dist/backend/native/runtime-inputs.test.js.map +1 -0
  245. package/dist/backend/native/runtime-objects.d.ts +16 -0
  246. package/dist/backend/native/runtime-objects.js +122 -0
  247. package/dist/backend/native/runtime-objects.js.map +1 -0
  248. package/dist/backend/native/session.d.ts +12 -0
  249. package/dist/backend/native/session.js +31 -0
  250. package/dist/backend/native/session.js.map +1 -0
  251. package/dist/backend/native/tool-identity.d.ts +37 -0
  252. package/dist/backend/native/tool-identity.js +310 -0
  253. package/dist/backend/native/tool-identity.js.map +1 -0
  254. package/dist/backend/native/trace-paths.d.ts +12 -0
  255. package/dist/backend/native/trace-paths.js +73 -0
  256. package/dist/backend/native/trace-paths.js.map +1 -0
  257. package/dist/backend/native/vendor.d.ts +1 -0
  258. package/dist/backend/native/vendor.js +12 -0
  259. package/dist/backend/native/vendor.js.map +1 -0
  260. package/dist/backend/native-codegen-core.js +2 -1
  261. package/dist/backend/native-codegen-core.js.map +1 -1
  262. package/dist/backend/native-codegen.d.ts +1 -1
  263. package/dist/backend/native-codegen.js +24 -13
  264. package/dist/backend/native-codegen.js.map +1 -1
  265. package/dist/backend/native-codegen.test.js +12 -9
  266. package/dist/backend/native-codegen.test.js.map +1 -1
  267. package/dist/backend/native-link-info-core.js +9 -5
  268. package/dist/backend/native-link-info-core.js.map +1 -1
  269. package/dist/backend/native-link-info.js +14 -5
  270. package/dist/backend/native-link-info.js.map +1 -1
  271. package/dist/backend/native-link-info.test.js +58 -13
  272. package/dist/backend/native-link-info.test.js.map +1 -1
  273. package/dist/backend/native-toolchain.d.ts +17 -450
  274. package/dist/backend/native-toolchain.js +17 -3971
  275. package/dist/backend/native-toolchain.js.map +1 -1
  276. package/dist/backend/native-toolchain.test.js +103 -72
  277. package/dist/backend/native-toolchain.test.js.map +1 -1
  278. package/dist/backend/native-tools.js +27 -8
  279. package/dist/backend/native-tools.js.map +1 -1
  280. package/dist/backend/object-localize.js +17 -14
  281. package/dist/backend/object-localize.js.map +1 -1
  282. package/dist/backend/object-localize.test.js +59 -12
  283. package/dist/backend/object-localize.test.js.map +1 -1
  284. package/dist/backend/runtime-pack-core.js +96 -49
  285. package/dist/backend/runtime-pack-core.js.map +1 -1
  286. package/dist/backend/runtime-pack-native.js +5 -3
  287. package/dist/backend/runtime-pack-native.js.map +1 -1
  288. package/dist/backend/runtime-pack-targets.test.js +87 -15
  289. package/dist/backend/runtime-pack-targets.test.js.map +1 -1
  290. package/dist/backend/runtime-pack.d.ts +1 -1
  291. package/dist/backend/runtime-pack.js +11 -12
  292. package/dist/backend/runtime-pack.js.map +1 -1
  293. package/dist/backend/runtime-pack.test.js +40 -24
  294. package/dist/backend/runtime-pack.test.js.map +1 -1
  295. package/dist/backend/source-locations.js.map +1 -1
  296. package/dist/backend/source-locations.test.js +7 -2
  297. package/dist/backend/source-locations.test.js.map +1 -1
  298. package/dist/backend/target-diagnostics.js +44 -14
  299. package/dist/backend/target-diagnostics.js.map +1 -1
  300. package/dist/backend/target-diagnostics.test.js +93 -20
  301. package/dist/backend/target-diagnostics.test.js.map +1 -1
  302. package/dist/backend/targets.js +230 -86
  303. package/dist/backend/targets.js.map +1 -1
  304. package/dist/backend/targets.test.js +32 -18
  305. package/dist/backend/targets.test.js.map +1 -1
  306. package/dist/backend/toolchain-environment.js +5 -1
  307. package/dist/backend/toolchain-environment.js.map +1 -1
  308. package/dist/backend/vendor-archives.d.ts +2 -2
  309. package/dist/backend/vendor-archives.js +84 -35
  310. package/dist/backend/vendor-archives.js.map +1 -1
  311. package/dist/backend/vendor-inputs.js +13 -1
  312. package/dist/backend/vendor-inputs.js.map +1 -1
  313. package/dist/backend/warm-cache.d.ts +1 -1
  314. package/dist/backend/warm-cache.js +33 -9
  315. package/dist/backend/warm-cache.js.map +1 -1
  316. package/dist/cli/command.js +39 -9
  317. package/dist/cli/command.js.map +1 -1
  318. package/dist/cli/output-options.js +14 -4
  319. package/dist/cli/output-options.js.map +1 -1
  320. package/dist/cli/paths.js.map +1 -1
  321. package/dist/cli/wasi-runner.js.map +1 -1
  322. package/dist/compat/fetch-profile.js +36 -35
  323. package/dist/compat/fetch-profile.js.map +1 -1
  324. package/dist/coverage/report.js +16 -17
  325. package/dist/coverage/report.js.map +1 -1
  326. package/dist/coverage/surface-manifest.js +112 -26
  327. package/dist/coverage/surface-manifest.js.map +1 -1
  328. package/dist/diagnostics/diagnostic.js +55 -16
  329. package/dist/diagnostics/diagnostic.js.map +1 -1
  330. package/dist/executable/executable-cache.d.ts +1 -1
  331. package/dist/executable/executable-cache.js +78 -48
  332. package/dist/executable/executable-cache.js.map +1 -1
  333. package/dist/executable/executable-cache.test.js +75 -26
  334. package/dist/executable/executable-cache.test.js.map +1 -1
  335. package/dist/executable/prepare.js +2 -2
  336. package/dist/executable/prepare.js.map +1 -1
  337. package/dist/ffi/ffi-manifest.js +78 -20
  338. package/dist/ffi/ffi-manifest.js.map +1 -1
  339. package/dist/ffi/ffi-manifest.test.js +96 -16
  340. package/dist/ffi/ffi-manifest.test.js.map +1 -1
  341. package/dist/format-integer.js.map +1 -1
  342. package/dist/frontend/analysis.js +12 -2
  343. package/dist/frontend/analysis.js.map +1 -1
  344. package/dist/frontend/arguments-usage.js.map +1 -1
  345. package/dist/frontend/binding-source.js +9 -3
  346. package/dist/frontend/binding-source.js.map +1 -1
  347. package/dist/frontend/builtin-modules.js +46 -2
  348. package/dist/frontend/builtin-modules.js.map +1 -1
  349. package/dist/frontend/cjs-resolve.js +40 -17
  350. package/dist/frontend/cjs-resolve.js.map +1 -1
  351. package/dist/frontend/cjs-syntax.js +31 -10
  352. package/dist/frontend/cjs-syntax.js.map +1 -1
  353. package/dist/frontend/comptime-node.test.js +10 -11
  354. package/dist/frontend/comptime-node.test.js.map +1 -1
  355. package/dist/frontend/dts-paths.js +7 -3
  356. package/dist/frontend/dts-paths.js.map +1 -1
  357. package/dist/frontend/fork-target.js +17 -12
  358. package/dist/frontend/fork-target.js.map +1 -1
  359. package/dist/frontend/function-completion.js +11 -6
  360. package/dist/frontend/function-completion.js.map +1 -1
  361. package/dist/frontend/helper-tokens.js +53 -6
  362. package/dist/frontend/helper-tokens.js.map +1 -1
  363. package/dist/frontend/helper-tokens.test.js +18 -2
  364. package/dist/frontend/helper-tokens.test.js.map +1 -1
  365. package/dist/frontend/inferred-js-diagnostics.js +32 -12
  366. package/dist/frontend/inferred-js-diagnostics.js.map +1 -1
  367. package/dist/frontend/inferred-js-diagnostics.test.js +11 -15
  368. package/dist/frontend/inferred-js-diagnostics.test.js.map +1 -1
  369. package/dist/frontend/input-tracker.js +11 -11
  370. package/dist/frontend/input-tracker.js.map +1 -1
  371. package/dist/frontend/input-tracker.test.js +4 -1
  372. package/dist/frontend/input-tracker.test.js.map +1 -1
  373. package/dist/frontend/lib-contract.js +38 -9
  374. package/dist/frontend/lib-contract.js.map +1 -1
  375. package/dist/frontend/literal-values.js.map +1 -1
  376. package/dist/frontend/literal-values.test.js +28 -8
  377. package/dist/frontend/literal-values.test.js.map +1 -1
  378. package/dist/frontend/lowering/abstract-equality.js +53 -10
  379. package/dist/frontend/lowering/abstract-equality.js.map +1 -1
  380. package/dist/frontend/lowering/array-indexed-mutation.d.ts +1 -1
  381. package/dist/frontend/lowering/array-indexed-mutation.js +108 -106
  382. package/dist/frontend/lowering/array-indexed-mutation.js.map +1 -1
  383. package/dist/frontend/lowering/array-values.js +37 -14
  384. package/dist/frontend/lowering/array-values.js.map +1 -1
  385. package/dist/frontend/lowering/binding-analysis.d.ts +50 -0
  386. package/dist/frontend/lowering/binding-analysis.js +376 -0
  387. package/dist/frontend/lowering/binding-analysis.js.map +1 -0
  388. package/dist/frontend/lowering/builtin-calls.d.ts +9 -0
  389. package/dist/frontend/lowering/builtin-calls.js +60 -0
  390. package/dist/frontend/lowering/builtin-calls.js.map +1 -0
  391. package/dist/frontend/lowering/builtins/arguments.d.ts +43 -0
  392. package/dist/frontend/lowering/builtins/arguments.js +247 -0
  393. package/dist/frontend/lowering/builtins/arguments.js.map +1 -0
  394. package/dist/frontend/lowering/builtins/async-context.d.ts +52 -0
  395. package/dist/frontend/lowering/builtins/async-context.js +436 -0
  396. package/dist/frontend/lowering/builtins/async-context.js.map +1 -0
  397. package/dist/frontend/lowering/builtins/atomics.d.ts +15 -0
  398. package/dist/frontend/lowering/builtins/atomics.js +46 -0
  399. package/dist/frontend/lowering/builtins/atomics.js.map +1 -0
  400. package/dist/frontend/lowering/builtins/callable-aliases.d.ts +13 -0
  401. package/dist/frontend/lowering/builtins/callable-aliases.js +87 -0
  402. package/dist/frontend/lowering/builtins/callable-aliases.js.map +1 -0
  403. package/dist/frontend/lowering/builtins/child-process-async.d.ts +18 -0
  404. package/dist/frontend/lowering/builtins/child-process-async.js +245 -0
  405. package/dist/frontend/lowering/builtins/child-process-async.js.map +1 -0
  406. package/dist/frontend/lowering/builtins/child-process-methods.d.ts +21 -0
  407. package/dist/frontend/lowering/builtins/child-process-methods.js +362 -0
  408. package/dist/frontend/lowering/builtins/child-process-methods.js.map +1 -0
  409. package/dist/frontend/lowering/builtins/child-process-sync.d.ts +4 -0
  410. package/dist/frontend/lowering/builtins/child-process-sync.js +639 -0
  411. package/dist/frontend/lowering/builtins/child-process-sync.js.map +1 -0
  412. package/dist/frontend/lowering/builtins/child-process.d.ts +55 -0
  413. package/dist/frontend/lowering/builtins/child-process.js +669 -0
  414. package/dist/frontend/lowering/builtins/child-process.js.map +1 -0
  415. package/dist/frontend/lowering/builtins/compression.d.ts +7 -0
  416. package/dist/frontend/lowering/builtins/compression.js +115 -0
  417. package/dist/frontend/lowering/builtins/compression.js.map +1 -0
  418. package/dist/frontend/lowering/builtins/console.d.ts +10 -0
  419. package/dist/frontend/lowering/builtins/console.js +38 -0
  420. package/dist/frontend/lowering/builtins/console.js.map +1 -0
  421. package/dist/frontend/lowering/builtins/constants.d.ts +24 -0
  422. package/dist/frontend/lowering/builtins/constants.js +141 -0
  423. package/dist/frontend/lowering/builtins/constants.js.map +1 -0
  424. package/dist/frontend/lowering/builtins/crypto.d.ts +22 -0
  425. package/dist/frontend/lowering/builtins/crypto.js +517 -0
  426. package/dist/frontend/lowering/builtins/crypto.js.map +1 -0
  427. package/dist/frontend/lowering/builtins/dates.d.ts +7 -0
  428. package/dist/frontend/lowering/builtins/dates.js +101 -0
  429. package/dist/frontend/lowering/builtins/dates.js.map +1 -0
  430. package/dist/frontend/lowering/builtins/environment.d.ts +34 -0
  431. package/dist/frontend/lowering/builtins/environment.js +95 -0
  432. package/dist/frontend/lowering/builtins/environment.js.map +1 -0
  433. package/dist/frontend/lowering/builtins/errors.d.ts +14 -0
  434. package/dist/frontend/lowering/builtins/errors.js +83 -0
  435. package/dist/frontend/lowering/builtins/errors.js.map +1 -0
  436. package/dist/frontend/lowering/builtins/filesystem-calls.d.ts +32 -0
  437. package/dist/frontend/lowering/builtins/filesystem-calls.js +678 -0
  438. package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -0
  439. package/dist/frontend/lowering/builtins/filesystem.d.ts +108 -0
  440. package/dist/frontend/lowering/builtins/filesystem.js +1061 -0
  441. package/dist/frontend/lowering/builtins/filesystem.js.map +1 -0
  442. package/dist/frontend/lowering/builtins/ipc.d.ts +8 -0
  443. package/dist/frontend/lowering/builtins/ipc.js +76 -0
  444. package/dist/frontend/lowering/builtins/ipc.js.map +1 -0
  445. package/dist/frontend/lowering/builtins/json.d.ts +12 -0
  446. package/dist/frontend/lowering/builtins/json.js +387 -0
  447. package/dist/frontend/lowering/builtins/json.js.map +1 -0
  448. package/dist/frontend/lowering/builtins/module-bindings.d.ts +85 -0
  449. package/dist/frontend/lowering/builtins/module-bindings.js +346 -0
  450. package/dist/frontend/lowering/builtins/module-bindings.js.map +1 -0
  451. package/dist/frontend/lowering/builtins/module-calls.d.ts +8 -0
  452. package/dist/frontend/lowering/builtins/module-calls.js +303 -0
  453. package/dist/frontend/lowering/builtins/module-calls.js.map +1 -0
  454. package/dist/frontend/lowering/builtins/module-resolution.d.ts +38 -0
  455. package/dist/frontend/lowering/builtins/module-resolution.js +344 -0
  456. package/dist/frontend/lowering/builtins/module-resolution.js.map +1 -0
  457. package/dist/frontend/lowering/builtins/numbers.d.ts +15 -0
  458. package/dist/frontend/lowering/builtins/numbers.js +124 -0
  459. package/dist/frontend/lowering/builtins/numbers.js.map +1 -0
  460. package/dist/frontend/lowering/builtins/operating-system.d.ts +13 -0
  461. package/dist/frontend/lowering/builtins/operating-system.js +148 -0
  462. package/dist/frontend/lowering/builtins/operating-system.js.map +1 -0
  463. package/dist/frontend/lowering/builtins/performance.d.ts +13 -0
  464. package/dist/frontend/lowering/builtins/performance.js +100 -0
  465. package/dist/frontend/lowering/builtins/performance.js.map +1 -0
  466. package/dist/frontend/lowering/builtins/process.d.ts +50 -0
  467. package/dist/frontend/lowering/builtins/process.js +1138 -0
  468. package/dist/frontend/lowering/builtins/process.js.map +1 -0
  469. package/dist/frontend/lowering/builtins/promises.d.ts +14 -0
  470. package/dist/frontend/lowering/builtins/promises.js +356 -0
  471. package/dist/frontend/lowering/builtins/promises.js.map +1 -0
  472. package/dist/frontend/lowering/builtins/properties.d.ts +11 -0
  473. package/dist/frontend/lowering/builtins/properties.js +186 -0
  474. package/dist/frontend/lowering/builtins/properties.js.map +1 -0
  475. package/dist/frontend/lowering/builtins/querystring.d.ts +19 -0
  476. package/dist/frontend/lowering/builtins/querystring.js +150 -0
  477. package/dist/frontend/lowering/builtins/querystring.js.map +1 -0
  478. package/dist/frontend/lowering/builtins/readline.d.ts +13 -0
  479. package/dist/frontend/lowering/builtins/readline.js +138 -0
  480. package/dist/frontend/lowering/builtins/readline.js.map +1 -0
  481. package/dist/frontend/lowering/builtins/receiver-types.d.ts +5 -0
  482. package/dist/frontend/lowering/builtins/receiver-types.js +15 -0
  483. package/dist/frontend/lowering/builtins/receiver-types.js.map +1 -0
  484. package/dist/frontend/lowering/builtins/reflection.d.ts +13 -0
  485. package/dist/frontend/lowering/builtins/reflection.js +95 -0
  486. package/dist/frontend/lowering/builtins/reflection.js.map +1 -0
  487. package/dist/frontend/lowering/builtins/strings.d.ts +14 -0
  488. package/dist/frontend/lowering/builtins/strings.js +121 -0
  489. package/dist/frontend/lowering/builtins/strings.js.map +1 -0
  490. package/dist/frontend/lowering/builtins/text-codecs.d.ts +29 -0
  491. package/dist/frontend/lowering/builtins/text-codecs.js +590 -0
  492. package/dist/frontend/lowering/builtins/text-codecs.js.map +1 -0
  493. package/dist/frontend/lowering/builtins/timers.d.ts +22 -0
  494. package/dist/frontend/lowering/builtins/timers.js +180 -0
  495. package/dist/frontend/lowering/builtins/timers.js.map +1 -0
  496. package/dist/frontend/lowering/builtins/url.d.ts +37 -0
  497. package/dist/frontend/lowering/builtins/url.js +596 -0
  498. package/dist/frontend/lowering/builtins/url.js.map +1 -0
  499. package/dist/frontend/lowering/builtins/util-types.d.ts +7 -0
  500. package/dist/frontend/lowering/builtins/util-types.js +31 -0
  501. package/dist/frontend/lowering/builtins/util-types.js.map +1 -0
  502. package/dist/frontend/lowering/call-arguments.d.ts +72 -0
  503. package/dist/frontend/lowering/call-arguments.js +618 -0
  504. package/dist/frontend/lowering/call-arguments.js.map +1 -0
  505. package/dist/frontend/lowering/call-signatures.d.ts +115 -0
  506. package/dist/frontend/lowering/call-signatures.js +719 -0
  507. package/dist/frontend/lowering/call-signatures.js.map +1 -0
  508. package/dist/frontend/lowering/callback-arg.js.map +1 -1
  509. package/dist/frontend/lowering/checked-iterable-spread.js +53 -10
  510. package/dist/frontend/lowering/checked-iterable-spread.js.map +1 -1
  511. package/dist/frontend/lowering/checked-promise-all.js +41 -9
  512. package/dist/frontend/lowering/checked-promise-all.js.map +1 -1
  513. package/dist/frontend/lowering/class-callbacks.d.ts +1 -1
  514. package/dist/frontend/lowering/class-callbacks.js +130 -27
  515. package/dist/frontend/lowering/class-callbacks.js.map +1 -1
  516. package/dist/frontend/lowering/class-construction.d.ts +1 -1
  517. package/dist/frontend/lowering/class-construction.js +247 -50
  518. package/dist/frontend/lowering/class-construction.js.map +1 -1
  519. package/dist/frontend/lowering/class-descriptors.js +109 -29
  520. package/dist/frontend/lowering/class-descriptors.js.map +1 -1
  521. package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +6 -1
  522. package/dist/frontend/lowering/class-dynamic-dispatch.js +2471 -465
  523. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  524. package/dist/frontend/lowering/class-dynamic-dispatch.test.js +284 -44
  525. package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -1
  526. package/dist/frontend/lowering/class-instance-constructor.js +17 -5
  527. package/dist/frontend/lowering/class-instance-constructor.js.map +1 -1
  528. package/dist/frontend/lowering/class-method-values.js +199 -51
  529. package/dist/frontend/lowering/class-method-values.js.map +1 -1
  530. package/dist/frontend/lowering/class-prototypes.js +345 -86
  531. package/dist/frontend/lowering/class-prototypes.js.map +1 -1
  532. package/dist/frontend/lowering/class-runtime-statics.d.ts +1 -1
  533. package/dist/frontend/lowering/class-runtime-statics.js +80 -17
  534. package/dist/frontend/lowering/class-runtime-statics.js.map +1 -1
  535. package/dist/frontend/lowering/class-static-data.js +76 -16
  536. package/dist/frontend/lowering/class-static-data.js.map +1 -1
  537. package/dist/frontend/lowering/coercions/builders.d.ts +13 -0
  538. package/dist/frontend/lowering/coercions/builders.js +77 -0
  539. package/dist/frontend/lowering/coercions/builders.js.map +1 -0
  540. package/dist/frontend/lowering/coercions/function-adapters.d.ts +58 -0
  541. package/dist/frontend/lowering/coercions/function-adapters.js +430 -0
  542. package/dist/frontend/lowering/coercions/function-adapters.js.map +1 -0
  543. package/dist/frontend/lowering/coercions/island.d.ts +37 -0
  544. package/dist/frontend/lowering/coercions/island.js +350 -0
  545. package/dist/frontend/lowering/coercions/island.js.map +1 -0
  546. package/dist/frontend/lowering/coercions/state.d.ts +14 -0
  547. package/dist/frontend/lowering/coercions/state.js +16 -0
  548. package/dist/frontend/lowering/coercions/state.js.map +1 -0
  549. package/dist/frontend/lowering/coercions/structural-plans.d.ts +40 -0
  550. package/dist/frontend/lowering/coercions/structural-plans.js +447 -0
  551. package/dist/frontend/lowering/coercions/structural-plans.js.map +1 -0
  552. package/dist/frontend/lowering/coercions/structural.d.ts +63 -0
  553. package/dist/frontend/lowering/coercions/structural.js +616 -0
  554. package/dist/frontend/lowering/coercions/structural.js.map +1 -0
  555. package/dist/frontend/lowering/coercions/unions.d.ts +65 -0
  556. package/dist/frontend/lowering/coercions/unions.js +318 -0
  557. package/dist/frontend/lowering/coercions/unions.js.map +1 -0
  558. package/dist/frontend/lowering/collection-ingestion.js +359 -67
  559. package/dist/frontend/lowering/collection-ingestion.js.map +1 -1
  560. package/dist/frontend/lowering/containers/array-callbacks.d.ts +92 -0
  561. package/dist/frontend/lowering/containers/array-callbacks.js +1646 -0
  562. package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -0
  563. package/dist/frontend/lowering/containers/array-construction.d.ts +42 -0
  564. package/dist/frontend/lowering/containers/array-construction.js +1044 -0
  565. package/dist/frontend/lowering/containers/array-construction.js.map +1 -0
  566. package/dist/frontend/lowering/containers/array-iteration.d.ts +16 -0
  567. package/dist/frontend/lowering/containers/array-iteration.js +95 -0
  568. package/dist/frontend/lowering/containers/array-iteration.js.map +1 -0
  569. package/dist/frontend/lowering/containers/array-methods.d.ts +27 -0
  570. package/dist/frontend/lowering/containers/array-methods.js +1854 -0
  571. package/dist/frontend/lowering/containers/array-methods.js.map +1 -0
  572. package/dist/frontend/lowering/containers/bytes.d.ts +17 -17
  573. package/dist/frontend/lowering/containers/bytes.js +419 -105
  574. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  575. package/dist/frontend/lowering/containers/callback-arguments.d.ts +26 -0
  576. package/dist/frontend/lowering/containers/callback-arguments.js +179 -0
  577. package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -0
  578. package/dist/frontend/lowering/containers/collection-grouping.d.ts +19 -0
  579. package/dist/frontend/lowering/containers/collection-grouping.js +297 -0
  580. package/dist/frontend/lowering/containers/collection-grouping.js.map +1 -0
  581. package/dist/frontend/lowering/containers/collection-methods.d.ts +57 -0
  582. package/dist/frontend/lowering/containers/collection-methods.js +1314 -0
  583. package/dist/frontend/lowering/containers/collection-methods.js.map +1 -0
  584. package/dist/frontend/lowering/containers/dynamic-receivers.d.ts +18 -0
  585. package/dist/frontend/lowering/containers/dynamic-receivers.js +114 -0
  586. package/dist/frontend/lowering/containers/dynamic-receivers.js.map +1 -0
  587. package/dist/frontend/lowering/containers/for-of.d.ts +60 -0
  588. package/dist/frontend/lowering/containers/for-of.js +643 -0
  589. package/dist/frontend/lowering/containers/for-of.js.map +1 -0
  590. package/dist/frontend/lowering/containers/indexed-objects.d.ts +132 -0
  591. package/dist/frontend/lowering/containers/indexed-objects.js +1743 -0
  592. package/dist/frontend/lowering/containers/indexed-objects.js.map +1 -0
  593. package/dist/frontend/lowering/containers/iterator-helpers.d.ts +20 -0
  594. package/dist/frontend/lowering/containers/iterator-helpers.js +809 -0
  595. package/dist/frontend/lowering/containers/iterator-helpers.js.map +1 -0
  596. package/dist/frontend/lowering/containers/string-and-regexp.js +585 -157
  597. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  598. package/dist/frontend/lowering/containers/string-replacement.js +213 -63
  599. package/dist/frontend/lowering/containers/string-replacement.js.map +1 -1
  600. package/dist/frontend/lowering/crypto-tables.js +263 -64
  601. package/dist/frontend/lowering/crypto-tables.js.map +1 -1
  602. package/dist/frontend/lowering/deferred-module-initializers.js +172 -68
  603. package/dist/frontend/lowering/deferred-module-initializers.js.map +1 -1
  604. package/dist/frontend/lowering/deferred-module-initializers.test.js +41 -8
  605. package/dist/frontend/lowering/deferred-module-initializers.test.js.map +1 -1
  606. package/dist/frontend/lowering/error-methods.js +339 -65
  607. package/dist/frontend/lowering/error-methods.js.map +1 -1
  608. package/dist/frontend/lowering/expressions/evaluation-safety.js +3 -2
  609. package/dist/frontend/lowering/expressions/evaluation-safety.js.map +1 -1
  610. package/dist/frontend/lowering/expressions/global-symbols.js +2 -1
  611. package/dist/frontend/lowering/expressions/global-symbols.js.map +1 -1
  612. package/dist/frontend/lowering/expressions/native-proxy.js +11 -5
  613. package/dist/frontend/lowering/expressions/native-proxy.js.map +1 -1
  614. package/dist/frontend/lowering/expressions/nullish-assignment.js +67 -13
  615. package/dist/frontend/lowering/expressions/nullish-assignment.js.map +1 -1
  616. package/dist/frontend/lowering/expressions/object-literals.js +589 -162
  617. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  618. package/dist/frontend/lowering/expressions/optional-chains.d.ts +1 -1
  619. package/dist/frontend/lowering/expressions/optional-chains.js +68 -17
  620. package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
  621. package/dist/frontend/lowering/expressions/union-field-write.js +45 -18
  622. package/dist/frontend/lowering/expressions/union-field-write.js.map +1 -1
  623. package/dist/frontend/lowering/function-context.js +5 -1
  624. package/dist/frontend/lowering/function-context.js.map +1 -1
  625. package/dist/frontend/lowering/function-returns.d.ts +67 -0
  626. package/dist/frontend/lowering/function-returns.js +392 -0
  627. package/dist/frontend/lowering/function-returns.js.map +1 -0
  628. package/dist/frontend/lowering/generator-delegation.d.ts +1 -1
  629. package/dist/frontend/lowering/generator-delegation.js +171 -39
  630. package/dist/frontend/lowering/generator-delegation.js.map +1 -1
  631. package/dist/frontend/lowering/generator-dynamic-dispatch.d.ts +1 -1
  632. package/dist/frontend/lowering/generator-dynamic-dispatch.js +176 -36
  633. package/dist/frontend/lowering/generator-dynamic-dispatch.js.map +1 -1
  634. package/dist/frontend/lowering/generic-functions.d.ts +274 -0
  635. package/dist/frontend/lowering/generic-functions.js +1727 -0
  636. package/dist/frontend/lowering/generic-functions.js.map +1 -0
  637. package/dist/frontend/lowering/import-meta.d.ts +1 -1
  638. package/dist/frontend/lowering/import-meta.js +37 -14
  639. package/dist/frontend/lowering/import-meta.js.map +1 -1
  640. package/dist/frontend/lowering/indexed-comparison.js +6 -2
  641. package/dist/frontend/lowering/indexed-comparison.js.map +1 -1
  642. package/dist/frontend/lowering/iterator-consumption.d.ts +9 -0
  643. package/dist/frontend/lowering/iterator-consumption.js +91 -0
  644. package/dist/frontend/lowering/iterator-consumption.js.map +1 -0
  645. package/dist/frontend/lowering/lib-boundary.js +40 -17
  646. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  647. package/dist/frontend/lowering/lib-boundary.test.js +49 -11
  648. package/dist/frontend/lowering/lib-boundary.test.js.map +1 -1
  649. package/dist/frontend/lowering/lower-array-sort.d.ts +0 -19
  650. package/dist/frontend/lowering/lower-array-sort.js +331 -566
  651. package/dist/frontend/lowering/lower-array-sort.js.map +1 -1
  652. package/dist/frontend/lowering/lower-assert.js +248 -43
  653. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  654. package/dist/frontend/lowering/lower-async-iteration.js +71 -16
  655. package/dist/frontend/lowering/lower-async-iteration.js.map +1 -1
  656. package/dist/frontend/lowering/lower-builtin-values.js +420 -71
  657. package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
  658. package/dist/frontend/lowering/lower-calls.d.ts +39 -558
  659. package/dist/frontend/lowering/lower-calls.js +2593 -5667
  660. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  661. package/dist/frontend/lowering/lower-classes.d.ts +243 -242
  662. package/dist/frontend/lowering/lower-classes.js +1704 -727
  663. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  664. package/dist/frontend/lowering/lower-comptime.d.ts +35 -35
  665. package/dist/frontend/lowering/lower-comptime.js +39 -37
  666. package/dist/frontend/lowering/lower-comptime.js.map +1 -1
  667. package/dist/frontend/lowering/lower-dgram.js +59 -31
  668. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  669. package/dist/frontend/lowering/lower-enums.js +5 -2
  670. package/dist/frontend/lowering/lower-enums.js.map +1 -1
  671. package/dist/frontend/lowering/lower-event-emitter.js +322 -85
  672. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
  673. package/dist/frontend/lowering/lower-expando.js +19 -7
  674. package/dist/frontend/lowering/lower-expando.js.map +1 -1
  675. package/dist/frontend/lowering/lower-exprs.d.ts +194 -194
  676. package/dist/frontend/lowering/lower-exprs.js +3455 -1153
  677. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  678. package/dist/frontend/lowering/lower-functions.d.ts +23 -0
  679. package/dist/frontend/lowering/lower-functions.js +449 -0
  680. package/dist/frontend/lowering/lower-functions.js.map +1 -0
  681. package/dist/frontend/lowering/lower-generators.js +121 -32
  682. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  683. package/dist/frontend/lowering/lower-global-value.js +15 -4
  684. package/dist/frontend/lowering/lower-global-value.js.map +1 -1
  685. package/dist/frontend/lowering/lower-inspect.js +479 -89
  686. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  687. package/dist/frontend/lowering/lower-island.d.ts +79 -79
  688. package/dist/frontend/lowering/lower-island.js +365 -273
  689. package/dist/frontend/lowering/lower-island.js.map +1 -1
  690. package/dist/frontend/lowering/lower-island.test.js +7 -2
  691. package/dist/frontend/lowering/lower-island.test.js.map +1 -1
  692. package/dist/frontend/lowering/lower-mixins.js +17 -8
  693. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  694. package/dist/frontend/lowering/lower-modules.d.ts +94 -94
  695. package/dist/frontend/lowering/lower-modules.js +612 -321
  696. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  697. package/dist/frontend/lowering/lower-modules.test.js +91 -20
  698. package/dist/frontend/lowering/lower-modules.test.js.map +1 -1
  699. package/dist/frontend/lowering/lower-namespaces.js +25 -8
  700. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  701. package/dist/frontend/lowering/lower-node-module.js +115 -34
  702. package/dist/frontend/lowering/lower-node-module.js.map +1 -1
  703. package/dist/frontend/lowering/lower-server.js +1210 -290
  704. package/dist/frontend/lowering/lower-server.js.map +1 -1
  705. package/dist/frontend/lowering/lower-stmts.d.ts +148 -148
  706. package/dist/frontend/lowering/lower-stmts.js +2312 -984
  707. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  708. package/dist/frontend/lowering/lower-stmts.test.js +13 -5
  709. package/dist/frontend/lowering/lower-stmts.test.js.map +1 -1
  710. package/dist/frontend/lowering/lower-stream.js +362 -90
  711. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  712. package/dist/frontend/lowering/lower-system-errors.js +30 -8
  713. package/dist/frontend/lowering/lower-system-errors.js.map +1 -1
  714. package/dist/frontend/lowering/lower-test.js +40 -13
  715. package/dist/frontend/lowering/lower-test.js.map +1 -1
  716. package/dist/frontend/lowering/lower-timers.d.ts +31 -0
  717. package/dist/frontend/lowering/lower-timers.js +336 -0
  718. package/dist/frontend/lowering/lower-timers.js.map +1 -0
  719. package/dist/frontend/lowering/lower-url.d.ts +1 -1
  720. package/dist/frontend/lowering/lower-url.js +46 -13
  721. package/dist/frontend/lowering/lower-url.js.map +1 -1
  722. package/dist/frontend/lowering/lowerer.d.ts +21 -351
  723. package/dist/frontend/lowering/lowerer.js +1031 -2704
  724. package/dist/frontend/lowering/lowerer.js.map +1 -1
  725. package/dist/frontend/lowering/lowerer.test.js +85 -17
  726. package/dist/frontend/lowering/lowerer.test.js.map +1 -1
  727. package/dist/frontend/lowering/module-namespace-elements.js +43 -8
  728. package/dist/frontend/lowering/module-namespace-elements.js.map +1 -1
  729. package/dist/frontend/lowering/native-ffi.d.ts +21 -1
  730. package/dist/frontend/lowering/native-ffi.js +487 -18
  731. package/dist/frontend/lowering/native-ffi.js.map +1 -1
  732. package/dist/frontend/lowering/object-enumeration-receiver.js +55 -10
  733. package/dist/frontend/lowering/object-enumeration-receiver.js.map +1 -1
  734. package/dist/frontend/lowering/object-factory-new.d.ts +1 -1
  735. package/dist/frontend/lowering/object-factory-new.js +36 -11
  736. package/dist/frontend/lowering/object-factory-new.js.map +1 -1
  737. package/dist/frontend/lowering/optional-arguments.js +49 -20
  738. package/dist/frontend/lowering/optional-arguments.js.map +1 -1
  739. package/dist/frontend/lowering/pairs-snapshot.js +66 -14
  740. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -1
  741. package/dist/frontend/lowering/runtime-optional-locals.js +3 -1
  742. package/dist/frontend/lowering/runtime-optional-locals.js.map +1 -1
  743. package/dist/frontend/lowering/runtime-optional-locals.test.js.map +1 -1
  744. package/dist/frontend/lowering/sanitize-class-types.js +4 -1
  745. package/dist/frontend/lowering/sanitize-class-types.js.map +1 -1
  746. package/dist/frontend/lowering/sanitize-class-types.test.js +86 -18
  747. package/dist/frontend/lowering/sanitize-class-types.test.js.map +1 -1
  748. package/dist/frontend/lowering/static-this.js +13 -6
  749. package/dist/frontend/lowering/static-this.js.map +1 -1
  750. package/dist/frontend/lowering/string-index.js +32 -10
  751. package/dist/frontend/lowering/string-index.js.map +1 -1
  752. package/dist/frontend/lowering/surfaces.d.ts +42 -42
  753. package/dist/frontend/lowering/surfaces.js +1094 -249
  754. package/dist/frontend/lowering/surfaces.js.map +1 -1
  755. package/dist/frontend/lowering/symbol-fields.js +40 -15
  756. package/dist/frontend/lowering/symbol-fields.js.map +1 -1
  757. package/dist/frontend/lowering/symbol-methods.js.map +1 -1
  758. package/dist/frontend/lowering/text-decoder-encoding.js +236 -24
  759. package/dist/frontend/lowering/text-decoder-encoding.js.map +1 -1
  760. package/dist/frontend/lowering/text-decoder-encoding.test.js +84 -12
  761. package/dist/frontend/lowering/text-decoder-encoding.test.js.map +1 -1
  762. package/dist/frontend/lowering/union-narrow.js +59 -16
  763. package/dist/frontend/lowering/union-narrow.js.map +1 -1
  764. package/dist/frontend/lowering/union-narrow.test.js +24 -7
  765. package/dist/frontend/lowering/union-narrow.test.js.map +1 -1
  766. package/dist/frontend/lowering/union-retag.js +155 -40
  767. package/dist/frontend/lowering/union-retag.js.map +1 -1
  768. package/dist/frontend/lowering/union-retag.test.js +131 -33
  769. package/dist/frontend/lowering/union-retag.test.js.map +1 -1
  770. package/dist/frontend/lowering/unregistered-class-types.js.map +1 -1
  771. package/dist/frontend/lowering/unregistered-class-types.test.js +34 -8
  772. package/dist/frontend/lowering/unregistered-class-types.test.js.map +1 -1
  773. package/dist/frontend/module-syntax.js +21 -8
  774. package/dist/frontend/module-syntax.js.map +1 -1
  775. package/dist/frontend/module-syntax.test.js +37 -13
  776. package/dist/frontend/module-syntax.test.js.map +1 -1
  777. package/dist/frontend/npm-fetch-analysis.js +13 -4
  778. package/dist/frontend/npm-fetch-analysis.js.map +1 -1
  779. package/dist/frontend/npm-fetch-analysis.test.js +33 -10
  780. package/dist/frontend/npm-fetch-analysis.test.js.map +1 -1
  781. package/dist/frontend/npm-fetch-node.js.map +1 -1
  782. package/dist/frontend/npm-fetch-syntax.js +4 -9
  783. package/dist/frontend/npm-fetch-syntax.js.map +1 -1
  784. package/dist/frontend/npm-node.js +3 -1
  785. package/dist/frontend/npm-node.js.map +1 -1
  786. package/dist/frontend/npm-static-bundled-cjs.js +88 -29
  787. package/dist/frontend/npm-static-bundled-cjs.js.map +1 -1
  788. package/dist/frontend/npm-static-bundled-cjs.test.js +29 -10
  789. package/dist/frontend/npm-static-bundled-cjs.test.js.map +1 -1
  790. package/dist/frontend/npm-static-declaration-syntax.js +148 -56
  791. package/dist/frontend/npm-static-declaration-syntax.js.map +1 -1
  792. package/dist/frontend/npm-static-declarations.d.ts +1 -1
  793. package/dist/frontend/npm-static-declarations.js.map +1 -1
  794. package/dist/frontend/npm-static-declarations.test.js +33 -7
  795. package/dist/frontend/npm-static-declarations.test.js.map +1 -1
  796. package/dist/frontend/npm-static-prune.js +26 -12
  797. package/dist/frontend/npm-static-prune.js.map +1 -1
  798. package/dist/frontend/npm-static-prune.test.js +17 -3
  799. package/dist/frontend/npm-static-prune.test.js.map +1 -1
  800. package/dist/frontend/npm-static-rewrite-host.js +2 -3
  801. package/dist/frontend/npm-static-rewrite-host.js.map +1 -1
  802. package/dist/frontend/npm-static-rewrite-syntax.js +64 -21
  803. package/dist/frontend/npm-static-rewrite-syntax.js.map +1 -1
  804. package/dist/frontend/npm-static-rewrite.js.map +1 -1
  805. package/dist/frontend/npm-static-subtyping.js +9 -4
  806. package/dist/frontend/npm-static-subtyping.js.map +1 -1
  807. package/dist/frontend/npm-static-subtyping.test.js +30 -6
  808. package/dist/frontend/npm-static-subtyping.test.js.map +1 -1
  809. package/dist/frontend/npm-static.js +15 -4
  810. package/dist/frontend/npm-static.js.map +1 -1
  811. package/dist/frontend/npm.js +122 -36
  812. package/dist/frontend/npm.js.map +1 -1
  813. package/dist/frontend/npm.test.js +30 -10
  814. package/dist/frontend/npm.test.js.map +1 -1
  815. package/dist/frontend/pipeline-native.js.map +1 -1
  816. package/dist/frontend/pipeline.js +25 -8
  817. package/dist/frontend/pipeline.js.map +1 -1
  818. package/dist/frontend/pipeline.test.js +21 -7
  819. package/dist/frontend/pipeline.test.js.map +1 -1
  820. package/dist/frontend/program-node.js +5 -3
  821. package/dist/frontend/program-node.js.map +1 -1
  822. package/dist/frontend/program.d.ts +2 -2
  823. package/dist/frontend/program.js +234 -101
  824. package/dist/frontend/program.js.map +1 -1
  825. package/dist/frontend/program.test.js +27 -27
  826. package/dist/frontend/program.test.js.map +1 -1
  827. package/dist/frontend/provenance-core.js +8 -4
  828. package/dist/frontend/provenance-core.js.map +1 -1
  829. package/dist/frontend/provenance-registry.js +1 -4
  830. package/dist/frontend/provenance-registry.js.map +1 -1
  831. package/dist/frontend/resolve.js +32 -20
  832. package/dist/frontend/resolve.js.map +1 -1
  833. package/dist/frontend/resolve.test.js +1 -1
  834. package/dist/frontend/resolve.test.js.map +1 -1
  835. package/dist/frontend/runtime-resolve.js +13 -4
  836. package/dist/frontend/runtime-resolve.js.map +1 -1
  837. package/dist/frontend/runtime-resolve.test.js +25 -9
  838. package/dist/frontend/runtime-resolve.test.js.map +1 -1
  839. package/dist/frontend/services-node.js +6 -2
  840. package/dist/frontend/services-node.js.map +1 -1
  841. package/dist/frontend/services-node.test.js +18 -6
  842. package/dist/frontend/services-node.test.js.map +1 -1
  843. package/dist/frontend/services.js +8 -4
  844. package/dist/frontend/services.js.map +1 -1
  845. package/dist/frontend/services.test.js +6 -2
  846. package/dist/frontend/services.test.js.map +1 -1
  847. package/dist/frontend/ts7/api.js +12 -4
  848. package/dist/frontend/ts7/api.js.map +1 -1
  849. package/dist/frontend/ts7/ast-bytes.js +10 -3
  850. package/dist/frontend/ts7/ast-bytes.js.map +1 -1
  851. package/dist/frontend/ts7/ast-bytes.test.js +23 -4
  852. package/dist/frontend/ts7/ast-bytes.test.js.map +1 -1
  853. package/dist/frontend/ts7/ast-guards.test.js +14 -5
  854. package/dist/frontend/ts7/ast-guards.test.js.map +1 -1
  855. package/dist/frontend/ts7/ast-node.d.ts +6 -1
  856. package/dist/frontend/ts7/ast-node.js +484 -164
  857. package/dist/frontend/ts7/ast-node.js.map +1 -1
  858. package/dist/frontend/ts7/ast-node.test.js +109 -36
  859. package/dist/frontend/ts7/ast-node.test.js.map +1 -1
  860. package/dist/frontend/ts7/ast-text.js +13 -3
  861. package/dist/frontend/ts7/ast-text.js.map +1 -1
  862. package/dist/frontend/ts7/ast-text.test.js.map +1 -1
  863. package/dist/frontend/ts7/ast-types.js.map +1 -1
  864. package/dist/frontend/ts7/ast-wire.d.ts +1 -1
  865. package/dist/frontend/ts7/ast-wire.js +55 -20
  866. package/dist/frontend/ts7/ast-wire.js.map +1 -1
  867. package/dist/frontend/ts7/ast-wire.test.js +53 -8
  868. package/dist/frontend/ts7/ast-wire.test.js.map +1 -1
  869. package/dist/frontend/ts7/ast.js +47 -28
  870. package/dist/frontend/ts7/ast.js.map +1 -1
  871. package/dist/frontend/ts7/census-check.js +1 -1
  872. package/dist/frontend/ts7/census-check.js.map +1 -1
  873. package/dist/frontend/ts7/checker-cache.js.map +1 -1
  874. package/dist/frontend/ts7/checker.js +5 -3
  875. package/dist/frontend/ts7/checker.js.map +1 -1
  876. package/dist/frontend/ts7/checker.test.js +54 -17
  877. package/dist/frontend/ts7/checker.test.js.map +1 -1
  878. package/dist/frontend/ts7/enums.test.js +9 -4
  879. package/dist/frontend/ts7/enums.test.js.map +1 -1
  880. package/dist/frontend/ts7/native-api.js.map +1 -1
  881. package/dist/frontend/ts7/native-host.js.map +1 -1
  882. package/dist/frontend/ts7/native-process.js +9 -3
  883. package/dist/frontend/ts7/native-process.js.map +1 -1
  884. package/dist/frontend/ts7/program-adapter.js +1 -1
  885. package/dist/frontend/ts7/program-adapter.js.map +1 -1
  886. package/dist/frontend/ts7/program-host.js +7 -4
  887. package/dist/frontend/ts7/program-host.js.map +1 -1
  888. package/dist/frontend/ts7/program-host.test.js +43 -11
  889. package/dist/frontend/ts7/program-host.test.js.map +1 -1
  890. package/dist/frontend/ts7/rpc-api.js +3 -1
  891. package/dist/frontend/ts7/rpc-api.js.map +1 -1
  892. package/dist/frontend/ts7/rpc-client.js +15 -5
  893. package/dist/frontend/ts7/rpc-client.js.map +1 -1
  894. package/dist/frontend/ts7/rpc-client.test.js +26 -8
  895. package/dist/frontend/ts7/rpc-client.test.js.map +1 -1
  896. package/dist/frontend/ts7/rpc-filesystem.js.map +1 -1
  897. package/dist/frontend/ts7/rpc-filesystem.test.js +43 -10
  898. package/dist/frontend/ts7/rpc-filesystem.test.js.map +1 -1
  899. package/dist/frontend/ts7/rpc-process.js +16 -6
  900. package/dist/frontend/ts7/rpc-process.js.map +1 -1
  901. package/dist/frontend/ts7/rpc-process.test.js.map +1 -1
  902. package/dist/frontend/ts7/rpc-wire.d.ts +1 -0
  903. package/dist/frontend/ts7/rpc-wire.js +41 -14
  904. package/dist/frontend/ts7/rpc-wire.js.map +1 -1
  905. package/dist/frontend/ts7/rpc-wire.test.js +36 -6
  906. package/dist/frontend/ts7/rpc-wire.test.js.map +1 -1
  907. package/dist/frontend/ts7/semantic-checker.js +209 -68
  908. package/dist/frontend/ts7/semantic-checker.js.map +1 -1
  909. package/dist/frontend/ts7/semantic-checker.test.js +29 -14
  910. package/dist/frontend/ts7/semantic-checker.test.js.map +1 -1
  911. package/dist/frontend/ts7/semantic-json.js +7 -1
  912. package/dist/frontend/ts7/semantic-json.js.map +1 -1
  913. package/dist/frontend/ts7/semantic-json.test.js +17 -3
  914. package/dist/frontend/ts7/semantic-json.test.js.map +1 -1
  915. package/dist/frontend/ts7/semantic-model.js +147 -51
  916. package/dist/frontend/ts7/semantic-model.js.map +1 -1
  917. package/dist/frontend/ts7/semantic-model.test.js +72 -19
  918. package/dist/frontend/ts7/semantic-model.test.js.map +1 -1
  919. package/dist/frontend/ts7/semantic-types.d.ts +2 -2
  920. package/dist/frontend/ts7/session-cache.js +10 -3
  921. package/dist/frontend/ts7/session-cache.js.map +1 -1
  922. package/dist/frontend/ts7/session-cache.test.js +13 -4
  923. package/dist/frontend/ts7/session-cache.test.js.map +1 -1
  924. package/dist/frontend/ts7/session-path.js +25 -10
  925. package/dist/frontend/ts7/session-path.js.map +1 -1
  926. package/dist/frontend/ts7/session-path.test.js +47 -4
  927. package/dist/frontend/ts7/session-path.test.js.map +1 -1
  928. package/dist/frontend/ts7/session-timing.js +22 -3
  929. package/dist/frontend/ts7/session-timing.js.map +1 -1
  930. package/dist/frontend/ts7/session-timing.test.js +12 -3
  931. package/dist/frontend/ts7/session-timing.test.js.map +1 -1
  932. package/dist/frontend/ts7/session.d.ts +1 -0
  933. package/dist/frontend/ts7/session.js +109 -35
  934. package/dist/frontend/ts7/session.js.map +1 -1
  935. package/dist/frontend/ts7/session.test.js +69 -15
  936. package/dist/frontend/ts7/session.test.js.map +1 -1
  937. package/dist/frontend/ts7/source-parser.js +17 -6
  938. package/dist/frontend/ts7/source-parser.js.map +1 -1
  939. package/dist/frontend/ts7/source-parser.test.js +32 -9
  940. package/dist/frontend/ts7/source-parser.test.js.map +1 -1
  941. package/dist/frontend/tsc-codes.js +56 -11
  942. package/dist/frontend/tsc-codes.js.map +1 -1
  943. package/dist/frontend/tsc-codes.test.d.ts +1 -0
  944. package/dist/frontend/tsc-codes.test.js +16 -0
  945. package/dist/frontend/tsc-codes.test.js.map +1 -0
  946. package/dist/frontend/type-mapper.js +547 -206
  947. package/dist/frontend/type-mapper.js.map +1 -1
  948. package/dist/frontend/type-mapper.test.js +108 -33
  949. package/dist/frontend/type-mapper.test.js.map +1 -1
  950. package/dist/frontend/union-discriminants.js +8 -2
  951. package/dist/frontend/union-discriminants.js.map +1 -1
  952. package/dist/frontend/union-discriminants.test.js +77 -20
  953. package/dist/frontend/union-discriminants.test.js.map +1 -1
  954. package/dist/index.d.ts +9 -8
  955. package/dist/index.js +150 -81
  956. package/dist/index.js.map +1 -1
  957. package/dist/ir/analysis.js +97 -38
  958. package/dist/ir/analysis.js.map +1 -1
  959. package/dist/ir/analysis.test.js +91 -15
  960. package/dist/ir/analysis.test.js.map +1 -1
  961. package/dist/ir/api.d.ts +4 -0
  962. package/dist/ir/api.js +6 -0
  963. package/dist/ir/api.js.map +1 -0
  964. package/dist/ir/build.d.ts +7 -0
  965. package/dist/ir/build.js +27 -1
  966. package/dist/ir/build.js.map +1 -1
  967. package/dist/ir/builtin-effects.d.ts +9 -0
  968. package/dist/ir/builtin-effects.js +631 -0
  969. package/dist/ir/builtin-effects.js.map +1 -0
  970. package/dist/ir/builtin-signatures.d.ts +15 -0
  971. package/dist/ir/builtin-signatures.js +3396 -0
  972. package/dist/ir/builtin-signatures.js.map +1 -0
  973. package/dist/ir/byte-numbers.d.ts +20 -0
  974. package/dist/ir/byte-numbers.js +116 -0
  975. package/dist/ir/byte-numbers.js.map +1 -0
  976. package/dist/ir/byte-numbers.test.d.ts +1 -0
  977. package/dist/ir/byte-numbers.test.js +55 -0
  978. package/dist/ir/byte-numbers.test.js.map +1 -0
  979. package/dist/ir/constant-tables.js +13 -5
  980. package/dist/ir/constant-tables.js.map +1 -1
  981. package/dist/ir/constant-tables.test.js +47 -7
  982. package/dist/ir/constant-tables.test.js.map +1 -1
  983. package/dist/ir/control-flow.js +2 -1
  984. package/dist/ir/control-flow.js.map +1 -1
  985. package/dist/ir/control-flow.test.js +35 -11
  986. package/dist/ir/control-flow.test.js.map +1 -1
  987. package/dist/ir/initializer-bindings.d.ts +9 -0
  988. package/dist/ir/initializer-bindings.js +115 -0
  989. package/dist/ir/initializer-bindings.js.map +1 -0
  990. package/dist/ir/initializer-bindings.test.d.ts +1 -0
  991. package/dist/ir/initializer-bindings.test.js +118 -0
  992. package/dist/ir/initializer-bindings.test.js.map +1 -0
  993. package/dist/ir/integer-loop-facts.d.ts +12 -0
  994. package/dist/ir/integer-loop-facts.js +137 -0
  995. package/dist/ir/integer-loop-facts.js.map +1 -0
  996. package/dist/ir/integer-loops.d.ts +19 -0
  997. package/dist/ir/integer-loops.js +172 -11
  998. package/dist/ir/integer-loops.js.map +1 -1
  999. package/dist/ir/integer-loops.test.js +122 -9
  1000. package/dist/ir/integer-loops.test.js.map +1 -1
  1001. package/dist/ir/integer-ranges.d.ts +8 -6
  1002. package/dist/ir/integer-ranges.js +416 -90
  1003. package/dist/ir/integer-ranges.js.map +1 -1
  1004. package/dist/ir/integer-ranges.test.js +239 -10
  1005. package/dist/ir/integer-ranges.test.js.map +1 -1
  1006. package/dist/ir/intrinsic-signatures.d.ts +20 -0
  1007. package/dist/ir/intrinsic-signatures.js +57 -0
  1008. package/dist/ir/intrinsic-signatures.js.map +1 -0
  1009. package/dist/ir/ir.d.ts +14 -2155
  1010. package/dist/ir/ir.js +169 -1394
  1011. package/dist/ir/ir.js.map +1 -1
  1012. package/dist/ir/ir.test.js +98 -77
  1013. package/dist/ir/ir.test.js.map +1 -1
  1014. package/dist/ir/runtime-features.d.ts +221 -0
  1015. package/dist/ir/runtime-features.js +551 -0
  1016. package/dist/ir/runtime-features.js.map +1 -0
  1017. package/dist/ir/runtime-features.test.d.ts +1 -0
  1018. package/dist/ir/runtime-features.test.js +98 -0
  1019. package/dist/ir/runtime-features.test.js.map +1 -0
  1020. package/dist/ir/scalar-records.js +130 -40
  1021. package/dist/ir/scalar-records.js.map +1 -1
  1022. package/dist/ir/scalar-records.test.js +146 -27
  1023. package/dist/ir/scalar-records.test.js.map +1 -1
  1024. package/dist/ir/serialize.js +4 -2
  1025. package/dist/ir/serialize.js.map +1 -1
  1026. package/dist/ir/serialize.test.js +44 -9
  1027. package/dist/ir/serialize.test.js.map +1 -1
  1028. package/dist/ir/traverse.js +156 -43
  1029. package/dist/ir/traverse.js.map +1 -1
  1030. package/dist/ir/traverse.test.js +99 -24
  1031. package/dist/ir/traverse.test.js.map +1 -1
  1032. package/dist/ir/validate.d.ts +1 -31
  1033. package/dist/ir/validate.js +826 -1915
  1034. package/dist/ir/validate.js.map +1 -1
  1035. package/dist/ir/validate.test.js +627 -111
  1036. package/dist/ir/validate.test.js.map +1 -1
  1037. package/dist/library/cache-primitives.js +9 -10
  1038. package/dist/library/cache-primitives.js.map +1 -1
  1039. package/dist/library/cache-reset.test.js +2 -1
  1040. package/dist/library/cache-reset.test.js.map +1 -1
  1041. package/dist/library/compiler-self-identity.js +11 -5
  1042. package/dist/library/compiler-self-identity.js.map +1 -1
  1043. package/dist/library/compiler-self-identity.test.js +10 -3
  1044. package/dist/library/compiler-self-identity.test.js.map +1 -1
  1045. package/dist/library/fence-eval.js +24 -7
  1046. package/dist/library/fence-eval.js.map +1 -1
  1047. package/dist/library/fence-eval.test.js +31 -7
  1048. package/dist/library/fence-eval.test.js.map +1 -1
  1049. package/dist/library/int-infer.js +199 -59
  1050. package/dist/library/int-infer.js.map +1 -1
  1051. package/dist/library/int-infer.test.js +133 -57
  1052. package/dist/library/int-infer.test.js.map +1 -1
  1053. package/dist/library/ir-policy.d.ts +27 -0
  1054. package/dist/library/ir-policy.js +232 -0
  1055. package/dist/library/ir-policy.js.map +1 -0
  1056. package/dist/library/library-cache.js +40 -17
  1057. package/dist/library/library-cache.js.map +1 -1
  1058. package/dist/library/library-cache.test.js +24 -13
  1059. package/dist/library/library-cache.test.js.map +1 -1
  1060. package/dist/library/library-profile.js +68 -13
  1061. package/dist/library/library-profile.js.map +1 -1
  1062. package/dist/library/prepare.js +48 -20
  1063. package/dist/library/prepare.js.map +1 -1
  1064. package/dist/library/semantic-source.js +16 -14
  1065. package/dist/library/semantic-source.js.map +1 -1
  1066. package/dist/library/semantic-source.test.js +9 -14
  1067. package/dist/library/semantic-source.test.js.map +1 -1
  1068. package/dist/library/sidecar-validate.js +53 -12
  1069. package/dist/library/sidecar-validate.js.map +1 -1
  1070. package/dist/library/sidecar.js +85 -24
  1071. package/dist/library/sidecar.js.map +1 -1
  1072. package/dist/library/trap-teaching.js +11 -2
  1073. package/dist/library/trap-teaching.js.map +1 -1
  1074. package/dist/native/cache.js +10 -4
  1075. package/dist/native/cache.js.map +1 -1
  1076. package/dist/native/cli.js +34 -9
  1077. package/dist/native/cli.js.map +1 -1
  1078. package/dist/native/compiler.js +167 -43
  1079. package/dist/native/compiler.js.map +1 -1
  1080. package/dist/native/compiler.test.js +129 -32
  1081. package/dist/native/compiler.test.js.map +1 -1
  1082. package/dist/native/comptime.js +23 -7
  1083. package/dist/native/comptime.js.map +1 -1
  1084. package/dist/native/comptime.test.js +26 -6
  1085. package/dist/native/comptime.test.js.map +1 -1
  1086. package/dist/native/executable-cache.js +77 -27
  1087. package/dist/native/executable-cache.js.map +1 -1
  1088. package/dist/native/executable-cache.test.js +41 -6
  1089. package/dist/native/executable-cache.test.js.map +1 -1
  1090. package/dist/native/file-identity.js +9 -2
  1091. package/dist/native/file-identity.js.map +1 -1
  1092. package/dist/native/file-identity.test.js.map +1 -1
  1093. package/dist/native/library.js +50 -12
  1094. package/dist/native/library.js.map +1 -1
  1095. package/dist/native/prepare.js +119 -34
  1096. package/dist/native/prepare.js.map +1 -1
  1097. package/dist/native/prepare.test.js +22 -6
  1098. package/dist/native/prepare.test.js.map +1 -1
  1099. package/dist/native/runtime-typescript.js +24 -11
  1100. package/dist/native/runtime-typescript.js.map +1 -1
  1101. package/dist/native/runtime-typescript.test.js.map +1 -1
  1102. package/dist/native/sanitizer.js +71 -18
  1103. package/dist/native/sanitizer.js.map +1 -1
  1104. package/dist/native/sanitizer.test.js +77 -20
  1105. package/dist/native/sanitizer.test.js.map +1 -1
  1106. package/dist/native/task.js.map +1 -1
  1107. package/dist/native/task.test.js +7 -2
  1108. package/dist/native/task.test.js.map +1 -1
  1109. package/dist/native/toolchain.js +74 -29
  1110. package/dist/native/toolchain.js.map +1 -1
  1111. package/dist/native/toolchain.test.js +95 -18
  1112. package/dist/native/toolchain.test.js.map +1 -1
  1113. package/dist/startup-cache.d.ts +1 -1
  1114. package/dist/startup-cache.js +1 -1
  1115. package/dist/startup-cache.js.map +1 -1
  1116. package/dist/timing.js.map +1 -1
  1117. package/package.json +20 -20
  1118. package/surface-manifest.json +1 -1
  1119. package/dist/frontend/lowering/lower-builtins.d.ts +0 -601
  1120. package/dist/frontend/lowering/lower-builtins.js +0 -8984
  1121. package/dist/frontend/lowering/lower-builtins.js.map +0 -1
  1122. package/dist/frontend/lowering/lower-containers.d.ts +0 -382
  1123. package/dist/frontend/lowering/lower-containers.js +0 -7366
  1124. package/dist/frontend/lowering/lower-containers.js.map +0 -1
package/dist/ir/ir.js CHANGED
@@ -1,11 +1,25 @@
1
1
  import { InternalCompilerError } from "../errors.js";
2
- import { everyModuleNode, everyExprChild, everyStmtChild } from "./traverse.js";
3
2
  export const BYTES_ELEMENT_SIZE = {
4
- u8: 1, u8c: 1, i8: 1, u16: 2, i16: 2, u32: 4, i32: 4, f32: 4, f64: 8,
3
+ u8: 1,
4
+ u8c: 1,
5
+ i8: 1,
6
+ u16: 2,
7
+ i16: 2,
8
+ u32: 4,
9
+ i32: 4,
10
+ f32: 4,
11
+ f64: 8,
5
12
  };
6
13
  export const BYTES_ELEMENT_NAME = {
7
- u8: "Uint8Array", u8c: "Uint8ClampedArray", i8: "Int8Array", u16: "Uint16Array", i16: "Int16Array",
8
- u32: "Uint32Array", i32: "Int32Array", f32: "Float32Array", f64: "Float64Array",
14
+ u8: "Uint8Array",
15
+ u8c: "Uint8ClampedArray",
16
+ i8: "Int8Array",
17
+ u16: "Uint16Array",
18
+ i16: "Int16Array",
19
+ u32: "Uint32Array",
20
+ i32: "Int32Array",
21
+ f32: "Float32Array",
22
+ f64: "Float64Array",
9
23
  };
10
24
  const POINTER_HANDLE_KINDS = [
11
25
  "stats",
@@ -33,10 +47,7 @@ function irKindSet(kinds) {
33
47
  }
34
48
  /** The opaque runtime handle kinds. procStream is the one scalar handle;
35
49
  * every other handle has pointer representation. */
36
- const HANDLE_KIND_LIST = [
37
- ...POINTER_HANDLE_KINDS,
38
- "procStream",
39
- ];
50
+ const HANDLE_KIND_LIST = [...POINTER_HANDLE_KINDS, "procStream"];
40
51
  export const HANDLE_KINDS = irKindSet(HANDLE_KIND_LIST);
41
52
  /** The IR kinds represented as pointers in native code. */
42
53
  const POINTER_KIND_LIST = [
@@ -140,9 +151,38 @@ export const REF_TRUTHY_KINDS = new Set([
140
151
  // symbol is not a JS object, but every symbol is truthy — the same
141
152
  // constant-true answer.
142
153
  "symbol",
143
- "date", "array", "map", "set", "regex", "url", "searchParams", "stats", "fileHandle", "spawnRes", "child",
144
- "netServer", "netSocket", "http2Session", "http2Stream", "dgramSocket", "testCtx", "httpReq", "httpRes", "httpClientReq",
145
- "secureCtx", "cryptoHash", "cryptoHmac", "fsWatcher", "childStream", "childWriter", "procStream", "bytes", "func", "object", "record", "promise",
154
+ "date",
155
+ "array",
156
+ "map",
157
+ "set",
158
+ "regex",
159
+ "url",
160
+ "searchParams",
161
+ "stats",
162
+ "fileHandle",
163
+ "spawnRes",
164
+ "child",
165
+ "netServer",
166
+ "netSocket",
167
+ "http2Session",
168
+ "http2Stream",
169
+ "dgramSocket",
170
+ "testCtx",
171
+ "httpReq",
172
+ "httpRes",
173
+ "httpClientReq",
174
+ "secureCtx",
175
+ "cryptoHash",
176
+ "cryptoHmac",
177
+ "fsWatcher",
178
+ "childStream",
179
+ "childWriter",
180
+ "procStream",
181
+ "bytes",
182
+ "func",
183
+ "object",
184
+ "record",
185
+ "promise",
146
186
  // A generator object is a JS object: always truthy.
147
187
  "generator",
148
188
  // A class object is a JS object (constructors are functions): always truthy.
@@ -244,15 +284,39 @@ export function setOf(elem) {
244
284
  * classes and arrays can point back at their collection, so constructors
245
285
  * must carry key tracing as well as retain/release adapters. */
246
286
  export function isIdentityCollectionKey(t) {
247
- return t.kind === "record" || t.kind === "object" || t.kind === "array" ||
248
- t.kind === "netServer" || t.kind === "symbol";
287
+ return (t.kind === "record" ||
288
+ t.kind === "object" ||
289
+ t.kind === "array" ||
290
+ t.kind === "netServer" ||
291
+ t.kind === "symbol");
292
+ }
293
+ /** Primitive keys compare by value and reference keys by identity. Union
294
+ * wrappers carry either domain without becoming observable key identities;
295
+ * null and undefined are distinct tag-only keys inside a union. */
296
+ export function isPrimitiveCollectionKey(t, unionArms) {
297
+ if (t.kind === "union")
298
+ return !!unionArms?.length && unionArms.every((arm) => isPrimitiveCollectionKey(arm));
299
+ return (t.kind === "f64" ||
300
+ t.kind === "string" ||
301
+ t.kind === "bigint" ||
302
+ t.kind === "bool" ||
303
+ t.kind === "symbol" ||
304
+ isUnitType(t));
249
305
  }
250
- /** Numbers use SameValueZero, strings use content, and reference keys use
251
- * identity. A union of identity arms hashes its payload, never its temporary
252
- * wrapper. Mixed scalar/reference unions remain outside this contract. */
253
306
  export function isSupportedMapKey(t, unionArms) {
254
- return t.kind === "f64" || t.kind === "string" || t.kind === "dyn" || isIdentityCollectionKey(t) ||
255
- (t.kind === "union" && unionArms !== undefined && unionArms.length > 0 && unionArms.every(isIdentityCollectionKey));
307
+ return (isCollectionValueKey(t) ||
308
+ t.kind === "dyn" ||
309
+ (t.kind === "union" &&
310
+ unionArms !== undefined &&
311
+ unionArms.length > 0 &&
312
+ unionArms.every((arm) => isCollectionValueKey(arm) || isUnitType(arm))));
313
+ }
314
+ function isCollectionValueKey(t) {
315
+ return (t.kind === "f64" ||
316
+ t.kind === "string" ||
317
+ t.kind === "bigint" ||
318
+ t.kind === "bool" ||
319
+ isIdentityCollectionKey(t));
256
320
  }
257
321
  /** Set elements and Map keys share storage, equality and ownership rules. */
258
322
  export function isSupportedSetElem(t, unionArms) {
@@ -326,9 +390,7 @@ export function isSupportedMapValue(t) {
326
390
  * Nested index-signature RECORDS ride the record kind like any other.
327
391
  * Shared frontend (mapType) / validator. */
328
392
  export function isSupportedIndexValue(t) {
329
- return (t.kind === "dyn" ||
330
- t.kind === "func" ||
331
- isSupportedMapValue(t));
393
+ return t.kind === "dyn" || t.kind === "func" || isSupportedMapValue(t);
332
394
  }
333
395
  export function funcOf(params, ret) {
334
396
  return { kind: "func", params, ret };
@@ -338,7 +400,8 @@ export function funcOf(params, ret) {
338
400
  * arbitrary data siblings require a separate runtime narrowing operation.
339
401
  * Share this rule across checker mapping, synthesized unions and validation. */
340
402
  export function unionContainerArmsOk(arms) {
341
- return arms.every((a, i) => (a.kind !== "map" && a.kind !== "set" && a.kind !== "promise") || arms.every((b, j) => j === i || isUnitType(b)));
403
+ return arms.every((a, i) => (a.kind !== "map" && a.kind !== "set" && a.kind !== "promise") ||
404
+ arms.every((b, j) => j === i || isUnitType(b)));
342
405
  }
343
406
  /** Canonical, injective text form of an IrType — the building block of
344
407
  * shape/union identity keys, generic-function instantiation keys, and the
@@ -403,10 +466,14 @@ export function typeEquals(a, b) {
403
466
  // Dispatch once: a chain of negative narrowing checks repeatedly retags
404
467
  // the remaining variants when this comparator runs in the native compiler.
405
468
  switch (a.kind) {
406
- case "array": return b.kind === "array" && typeEquals(a.elem, b.elem);
407
- case "bytes": return b.kind === "bytes" && a.elem === b.elem;
408
- case "map": return b.kind === "map" && typeEquals(a.key, b.key) && typeEquals(a.value, b.value);
409
- case "set": return b.kind === "set" && typeEquals(a.elem, b.elem);
469
+ case "array":
470
+ return b.kind === "array" && typeEquals(a.elem, b.elem);
471
+ case "bytes":
472
+ return b.kind === "bytes" && a.elem === b.elem;
473
+ case "map":
474
+ return b.kind === "map" && typeEquals(a.key, b.key) && typeEquals(a.value, b.value);
475
+ case "set":
476
+ return b.kind === "set" && typeEquals(a.elem, b.elem);
410
477
  case "func":
411
478
  return (b.kind === "func" &&
412
479
  a.params.length === b.params.length &&
@@ -415,20 +482,27 @@ export function typeEquals(a, b) {
415
482
  a.argumentsAll === b.argumentsAll &&
416
483
  a.params.every((p, i) => typeEquals(p, b.params[i])) &&
417
484
  typeEquals(a.ret, b.ret));
418
- case "object": return b.kind === "object" && a.className === b.className;
419
- case "classval": return b.kind === "classval" && a.className === b.className;
420
- case "moduleNs": return b.kind === "moduleNs" && a.moduleId === b.moduleId;
485
+ case "object":
486
+ return b.kind === "object" && a.className === b.className;
487
+ case "classval":
488
+ return b.kind === "classval" && a.className === b.className;
489
+ case "moduleNs":
490
+ return b.kind === "moduleNs" && a.moduleId === b.moduleId;
421
491
  // Shapes and unions are interned, so their ids determine equality.
422
- case "record": return b.kind === "record" && a.shapeId === b.shapeId;
423
- case "union": return b.kind === "union" && a.unionId === b.unionId;
424
- case "promise": return b.kind === "promise" && typeEquals(a.inner, b.inner);
492
+ case "record":
493
+ return b.kind === "record" && a.shapeId === b.shapeId;
494
+ case "union":
495
+ return b.kind === "union" && a.unionId === b.unionId;
496
+ case "promise":
497
+ return b.kind === "promise" && typeEquals(a.inner, b.inner);
425
498
  case "generator":
426
499
  return (b.kind === "generator" &&
427
500
  (a.async === true) === (b.async === true) &&
428
501
  typeEquals(a.yieldT, b.yieldT) &&
429
502
  typeEquals(a.retT, b.retT) &&
430
503
  typeEquals(a.nextT, b.nextT));
431
- default: return a.kind === b.kind;
504
+ default:
505
+ return a.kind === b.kind;
432
506
  }
433
507
  }
434
508
  /** True for types whose values are heap-allocated and reference-counted.
@@ -723,9 +797,9 @@ export function isJsonStringifySafeType(t, getRecord, getUnion) {
723
797
  * the type-directed serializer, checked-island boundary, or root-undefined
724
798
  * contract; callers must select the checked runtime traversal explicitly. */
725
799
  export function isJsonStringifyDynamicType(t, getRecord, getUnion) {
726
- return (t.kind === "record" || t.kind === "array" || t.kind === "union") &&
800
+ return ((t.kind === "record" || t.kind === "array" || t.kind === "union") &&
727
801
  isJsonSafeAt(t, getRecord, getUnion, true, false, new Set(), true) &&
728
- !isJsonStringifySafeType(t, getRecord, getUnion);
802
+ !isJsonStringifySafeType(t, getRecord, getUnion));
729
803
  }
730
804
  /** The recursion shared by checked JSON conversion and stringification.
731
805
  * Ordinary record fields always admit undefined by dropping the key. Array
@@ -776,7 +850,9 @@ function isJsonSafeAt(t, getRecord, getUnion, stringify, undefinedAllowed, visit
776
850
  return true; // the recursive knot, union-flavored
777
851
  visiting.add(key);
778
852
  for (const arm of def.arms) {
779
- if (!(arm.kind === "undefinedT" ? undefinedAllowed : isJsonSafeAt(arm, getRecord, getUnion, stringify, undefinedAllowed, visiting, nativeFields)))
853
+ if (!(arm.kind === "undefinedT"
854
+ ? undefinedAllowed
855
+ : isJsonSafeAt(arm, getRecord, getUnion, stringify, undefinedAllowed, visiting, nativeFields)))
780
856
  return false;
781
857
  }
782
858
  return true;
@@ -851,8 +927,11 @@ export function canMarshalFuncIntoIsland(t) {
851
927
  t.rest !== true &&
852
928
  t.params.length <= MAX_ISLAND_CALLBACK_ARITY &&
853
929
  t.params.every((p) => p.kind === "jsval") &&
854
- (t.ret.kind === "jsval" || t.ret.kind === "void" ||
855
- t.ret.kind === "f64" || t.ret.kind === "bool" || t.ret.kind === "string"));
930
+ (t.ret.kind === "jsval" ||
931
+ t.ret.kind === "void" ||
932
+ t.ret.kind === "f64" ||
933
+ t.ret.kind === "bool" ||
934
+ t.ret.kind === "string"));
856
935
  }
857
936
  /** Parameter types a TYPED closure may declare when it crosses INTO the
858
937
  * island as a host function: jsval params take the engine argument as a
@@ -874,7 +953,8 @@ export function isIslandCallbackParamType(t, getRecord, getUnion) {
874
953
  // A bare undefined-armed union: every non-undefined arm must be
875
954
  // JSON-safe (arms never nest unions, so plain isJsonSafeType applies).
876
955
  const def = getUnion(t.unionId);
877
- return !!def && def.arms.every((a) => a.kind === "undefinedT" || isJsonSafeType(a, getRecord, getUnion));
956
+ return (!!def &&
957
+ def.arms.every((a) => a.kind === "undefinedT" || isJsonSafeType(a, getRecord, getUnion)));
878
958
  }
879
959
  return false;
880
960
  }
@@ -888,7 +968,11 @@ export function isIslandCallbackParamType(t, getRecord, getUnion) {
888
968
  * the `.action(async ...)` case). Null for anything else (Promise of
889
969
  * composites: still fenced). */
890
970
  export function islandCallbackRet(t, getRecord, getUnion) {
891
- const tagOf = (r) => r.kind === "void" || r.kind === "jsval" || r.kind === "f64" || r.kind === "bool" || r.kind === "string"
971
+ const tagOf = (r) => r.kind === "void" ||
972
+ r.kind === "jsval" ||
973
+ r.kind === "f64" ||
974
+ r.kind === "bool" ||
975
+ r.kind === "string"
892
976
  ? r.kind
893
977
  : null;
894
978
  if (t.kind === "promise") {
@@ -1060,10 +1144,14 @@ export function canConvertToDyn(t, getRecord, getUnion, visiting = new Set()) {
1060
1144
  // invalid-input probes iterate `[1, null, () => {}, true]` — the
1061
1145
  // union's func arm crosses through the checked-dynamic function
1062
1146
  // boundary exactly like a bare func dynFrom).
1063
- return !!def && def.arms.every((a) => a.kind === "undefinedT" || isJsonSafeType(a, getRecord, getUnion) ||
1064
- isDynTypedRefType(a) || a.kind === "classval" || DYN_HANDLE_KINDS.has(a.kind) ||
1065
- (a.kind === "func" && canBoxFuncIntoDyn(a, getRecord, getUnion, visiting)) ||
1066
- (a.kind === "promise" && canConvertToDyn(a, getRecord, getUnion, visiting)));
1147
+ return (!!def &&
1148
+ def.arms.every((a) => a.kind === "undefinedT" ||
1149
+ isJsonSafeType(a, getRecord, getUnion) ||
1150
+ isDynTypedRefType(a) ||
1151
+ a.kind === "classval" ||
1152
+ DYN_HANDLE_KINDS.has(a.kind) ||
1153
+ (a.kind === "func" && canBoxFuncIntoDyn(a, getRecord, getUnion, visiting)) ||
1154
+ (a.kind === "promise" && canConvertToDyn(a, getRecord, getUnion, visiting))));
1067
1155
  }
1068
1156
  return false;
1069
1157
  }
@@ -1105,16 +1193,19 @@ function canBoxDynCompositeAt(t, getRecord, getUnion, visiting) {
1105
1193
  case "func":
1106
1194
  return canBoxFuncIntoDyn(t, getRecord, getUnion, visiting);
1107
1195
  case "set":
1108
- return canConvertToDyn(t.elem, getRecord, getUnion, visiting) && canDynCheckTo(t.elem, getRecord, getUnion, visiting);
1196
+ return (canConvertToDyn(t.elem, getRecord, getUnion, visiting) &&
1197
+ canDynCheckTo(t.elem, getRecord, getUnion, visiting));
1109
1198
  case "map":
1110
- return canConvertToDyn(t.key, getRecord, getUnion, visiting) && canDynCheckTo(t.key, getRecord, getUnion, visiting) &&
1111
- canConvertToDyn(t.value, getRecord, getUnion, visiting) && canDynCheckTo(t.value, getRecord, getUnion, visiting);
1199
+ return (canConvertToDyn(t.key, getRecord, getUnion, visiting) &&
1200
+ canDynCheckTo(t.key, getRecord, getUnion, visiting) &&
1201
+ canConvertToDyn(t.value, getRecord, getUnion, visiting) &&
1202
+ canDynCheckTo(t.value, getRecord, getUnion, visiting));
1112
1203
  case "object":
1113
1204
  return RUNTIME_ERROR_CLASSES.has(t.className) || isDynTypedRefType(t);
1114
1205
  case "array":
1115
1206
  // Process streams have scalar storage only in fields, closures and
1116
1207
  // unions. A direct procStream array has no native ScrArr layout.
1117
- return t.elem.kind !== "procStream" && canBoxDynComposite(t.elem, getRecord, getUnion, visiting);
1208
+ return (t.elem.kind !== "procStream" && canBoxDynComposite(t.elem, getRecord, getUnion, visiting));
1118
1209
  case "record": {
1119
1210
  const shape = getRecord(t.shapeId);
1120
1211
  if (!shape)
@@ -1130,7 +1221,7 @@ function canBoxDynCompositeAt(t, getRecord, getUnion, visiting) {
1130
1221
  if (!canBoxDynComposite(field.type, getRecord, getUnion, visiting))
1131
1222
  return false;
1132
1223
  }
1133
- return !shape.indexValue || canBoxDynComposite(shape.indexValue, getRecord, getUnion, visiting);
1224
+ return (!shape.indexValue || canBoxDynComposite(shape.indexValue, getRecord, getUnion, visiting));
1134
1225
  }
1135
1226
  finally {
1136
1227
  visiting.delete(t.shapeId);
@@ -1204,7 +1295,9 @@ function canDynCheckToAt(t, getRecord, getUnion, visiting) {
1204
1295
  if (t.kind === "generator")
1205
1296
  return true;
1206
1297
  if (t.kind === "promise")
1207
- return t.inner.kind === "dyn" || t.inner.kind === "void" || canDynCheckToAt(t.inner, getRecord, getUnion, visiting);
1298
+ return (t.inner.kind === "dyn" ||
1299
+ t.inner.kind === "void" ||
1300
+ canDynCheckToAt(t.inner, getRecord, getUnion, visiting));
1208
1301
  if (t.kind === "object" && t.className === "%Error")
1209
1302
  return true;
1210
1303
  // Native class capsules already support checked extraction at ordinary
@@ -1244,7 +1337,8 @@ function canDynCheckToAt(t, getRecord, getUnion, visiting) {
1244
1337
  // Optional native callbacks and handles retain the same checked
1245
1338
  // conversion as their bare value. The union matcher selects the arm
1246
1339
  // before its adapter/extractor runs.
1247
- return !!def && def.arms.every((a) => isUnitType(a) || (a.kind !== "union" && canDynCheckTo(a, getRecord, getUnion, visiting)));
1340
+ return (!!def &&
1341
+ def.arms.every((a) => isUnitType(a) || (a.kind !== "union" && canDynCheckTo(a, getRecord, getUnion, visiting))));
1248
1342
  }
1249
1343
  return false;
1250
1344
  }
@@ -1257,7 +1351,8 @@ export function canBoxFuncIntoDyn(t, getRecord, getUnion, visiting = new Set())
1257
1351
  // Typed rest occupies the final native array parameter; its thunk
1258
1352
  // checks a fresh array containing all remaining call arguments.
1259
1353
  // Island rest keeps its separate engine host-callback adapter.
1260
- (t.rest !== true || t.restAbi === undefined ||
1354
+ (t.rest !== true ||
1355
+ t.restAbi === undefined ||
1261
1356
  (t.restAbi === "typed" && t.params.at(-1)?.kind === "array")) &&
1262
1357
  // A jsval (island) param converts through scr_jsval_from_dyn in the
1263
1358
  // thunk (wrapped cells unwrap by reference, dyn data deep-copies) —
@@ -1267,7 +1362,10 @@ export function canBoxFuncIntoDyn(t, getRecord, getUnion, visiting = new Set())
1267
1362
  // A jsval return converts through the by-reference wrap
1268
1363
  // (dynFromJsval — the thunk's result conversion), so engine-returning
1269
1364
  // callbacks box too: the routed-dispatch lane's flatMap shape.
1270
- (t.ret.kind === "void" || t.ret.kind === "dyn" || t.ret.kind === "jsval" || canConvertToDyn(t.ret, getRecord, getUnion, visiting)));
1365
+ (t.ret.kind === "void" ||
1366
+ t.ret.kind === "dyn" ||
1367
+ t.ret.kind === "jsval" ||
1368
+ canConvertToDyn(t.ret, getRecord, getUnion, visiting)));
1271
1369
  }
1272
1370
  /** A closure type a dyn function value can ADAPT to (dynCheck): every
1273
1371
  * param dyn or dyn-convertible (the adapter converts typed arguments into
@@ -1279,7 +1377,9 @@ export function canAdaptDynFuncTo(t, getRecord, getUnion, visiting = new Set())
1279
1377
  // and island rest ABIs still require their own conversion plan.
1280
1378
  (t.rest !== true || t.restAbi === undefined) &&
1281
1379
  t.params.every((p) => p.kind === "dyn" || canConvertToDyn(p, getRecord, getUnion, visiting)) &&
1282
- (t.ret.kind === "void" || t.ret.kind === "dyn" || canDynCheckTo(t.ret, getRecord, getUnion, visiting)));
1380
+ (t.ret.kind === "void" ||
1381
+ t.ret.kind === "dyn" ||
1382
+ canDynCheckTo(t.ret, getRecord, getUnion, visiting)));
1283
1383
  }
1284
1384
  /** The MARSHAL-direction boundary (jsMarshal): everything that can cross
1285
1385
  * out and back (canCrossIslandBoundary) plus qualifying closures — those
@@ -1303,13 +1403,20 @@ export function canMarshalIntoIsland(t, getRecord, getUnion) {
1303
1403
  * Promise.all arm). Null = outside the domain (the boundary fence). */
1304
1404
  export function islandPromisePayloadTag(inner) {
1305
1405
  switch (inner.kind) {
1306
- case "void": return "void";
1307
- case "f64": return "f64";
1308
- case "bool": return "bool";
1309
- case "string": return "string";
1310
- case "jsval": return "jsval";
1311
- case "array": return inner.elem.kind === "jsval" ? "jsvalArr" : null;
1312
- default: return null;
1406
+ case "void":
1407
+ return "void";
1408
+ case "f64":
1409
+ return "f64";
1410
+ case "bool":
1411
+ return "bool";
1412
+ case "string":
1413
+ return "string";
1414
+ case "jsval":
1415
+ return "jsval";
1416
+ case "array":
1417
+ return inner.elem.kind === "jsval" ? "jsvalArr" : null;
1418
+ default:
1419
+ return null;
1313
1420
  }
1314
1421
  }
1315
1422
  export function canExitIslandToType(t, getRecord, getUnion) {
@@ -1334,1340 +1441,8 @@ export function canExitIslandToType(t, getRecord, getUnion) {
1334
1441
  // jsval-element-array data arm beside units — the engine's undefined
1335
1442
  // takes the undefined arm, everything else the array exit.
1336
1443
  const dataArms = def.arms.filter((a) => !isUnitType(a));
1337
- return dataArms.length === 1 && dataArms[0].kind === "array" && dataArms[0].elem.kind === "jsval";
1444
+ return (dataArms.length === 1 && dataArms[0].kind === "array" && dataArms[0].elem.kind === "jsval");
1338
1445
  }
1339
1446
  return false;
1340
1447
  }
1341
- const DYN_ASYNC_LIB_FNS = new Set([
1342
- "fs.callbackValue", "fs.callbackCall",
1343
- "async.awaitDyn", "timers.immediatePromise", "crypto.native",
1344
- "dyn.promiseAll",
1345
- "process.onUncaughtException", "process.offUncaughtException",
1346
- "process.onUnhandledRejection", "process.offUnhandledRejection",
1347
- "process.onRejectionHandled", "process.offRejectionHandled",
1348
- "process.onWarning", "process.offWarning", "process.emitWarning", "util.styleText",
1349
- "als.new", "als.get", "als.run", "als.exitRun", "als.enterWith", "als.disable",
1350
- "dc.chanBindStore", "dc.chanUnbindStore", "dc.chanRunStores",
1351
- ]);
1352
- /** Inspect types and expressions together in one traversal. This is a fresh
1353
- * snapshot: callers may mutate an IR module between compilation passes. */
1354
- export function moduleRuntimeFeatures(mod) {
1355
- return scanRuntimeFeatures(mod);
1356
- }
1357
- function scanRuntimeFeatures(mod, stopAt) {
1358
- const features = {
1359
- regex: false, copying: false, legacyTextDecoder: false, fileHandle: false,
1360
- fetch: mod.embedded?.modules.some((m) => m.usesFetch === true) ?? false,
1361
- processEvents: false, emitter: (mod.classes ?? []).some((c) => c.name === RUNTIME_EMITTER_CLASS),
1362
- stream: (mod.classes ?? []).some((c) => RUNTIME_STREAM_CLASSES.has(c.name)),
1363
- zlib: mod.embedded?.edges.some((e) => e.to === "node:zlib") ?? false,
1364
- dc: false, assert: false, dynInvoke: false,
1365
- dynAsync: mod.functions.some((fn) => fn.async === true && fn.generator === undefined && fn.returnType.kind === "dyn"),
1366
- inspect: false,
1367
- childProcess: false, net: false, symbol: false, bigint: false, searchParams: false,
1368
- qs: false, parseArgs: false, fsWatch: false, nodeTest: false, dgram: false,
1369
- http: false, http2: false, tls: false, tlsCa: false,
1370
- };
1371
- const keepGoing = () => stopAt === undefined || !features[stopAt];
1372
- const expr = (node) => {
1373
- if (node.kind === "libCall") {
1374
- const fn = node.fn;
1375
- if (fn === "regexp.escape" || fn === "dyn.nativeRegexIs" || fn === "util.stripVTControlCharacters")
1376
- features.regex = true;
1377
- if (fn === "text.decodeLegacy" || fn === "text.decodeLegacyOptions" || fn === "text.decodeStream")
1378
- features.legacyTextDecoder = true;
1379
- if (fn.startsWith("fetch."))
1380
- features.fetch = true;
1381
- if (PROCESS_EVENT_LIB_FNS.has(fn))
1382
- features.processEvents = true;
1383
- if (fn.startsWith("emitter."))
1384
- features.emitter = true;
1385
- if (fn.startsWith("readable.") || fn.startsWith("writable.") || fn.startsWith("duplex.") ||
1386
- fn.startsWith("transform.") || fn.startsWith("passthrough.") || fn.startsWith("sc.") ||
1387
- fn.startsWith("stream.set") || fn === "stream.destroy" || fn === "stream.destroyErr" ||
1388
- fn === "stream.prop" || fn === "stream.errored" || fn === "sp.finished" || fn === "sp.pipeline")
1389
- features.stream = true;
1390
- if (fn.startsWith("zlib."))
1391
- features.zlib = true;
1392
- if (fn.startsWith("dc."))
1393
- features.dc = true;
1394
- if (fn.startsWith("assert."))
1395
- features.assert = true;
1396
- if (fn === "dyn.defineProps" || fn === "dyn.definePrototypeProps" || fn === "dyn.defineProperty" || fn === "dyn.objCreateWithProperties" || fn === "dyn.arrayProtoCall" || fn === "dyn.arrayPrototype" || fn === "dyn.functionApply" || fn === "dyn.builtinMethod")
1397
- features.dynInvoke = true;
1398
- if (DYN_ASYNC_LIB_FNS.has(fn))
1399
- features.dynAsync = true;
1400
- if (fn.startsWith("insp.") || fn === "console.native" || fn === "global.native" || fn === "util.styleText")
1401
- features.inspect = true;
1402
- if (fn.startsWith("cp.") || fn.startsWith("child.") || fn.startsWith("writer.") || fn.startsWith("spawnRes.") ||
1403
- fn === "process.forkTarget" || fn === "process.connected" || fn === "process.send" || fn === "process.sendCb" ||
1404
- fn === "process.disconnect" || fn === "process.onMessage" || fn === "process.onDisconnect")
1405
- features.childProcess = true;
1406
- if (fn.startsWith("net."))
1407
- features.net = true;
1408
- if (fn.startsWith("http.")) {
1409
- features.net = true;
1410
- features.http = true;
1411
- }
1412
- if (fn.startsWith("tls.") || fn.startsWith("https.") || fn.startsWith("http2.")) {
1413
- features.net = true;
1414
- features.http = true;
1415
- features.tls = true;
1416
- }
1417
- if (fn.startsWith("http2.") && !HTTP2_LEGACY_FNS.has(fn))
1418
- features.http2 = true;
1419
- if (fn.startsWith("sym.") || fn === "util.isDeepStrictEqual")
1420
- features.symbol = true;
1421
- if (fn === "process.hrtimeValue")
1422
- features.bigint = true;
1423
- if (fn.startsWith("bigint."))
1424
- features.bigint = true;
1425
- if (fn.startsWith("sp.") || fn === "url.searchParams")
1426
- features.searchParams = true;
1427
- if (fn === "qs.parse" || fn === "qs.stringify" || fn === "qs.unescape")
1428
- features.qs = true;
1429
- if (fn === "util.parseArgs" || fn === "util.isDeepStrictEqual" || fn === "util.styleText")
1430
- features.parseArgs = true;
1431
- if (fn === "util.styleText")
1432
- features.processEvents = true;
1433
- if (fn.startsWith("fs.watch") || fn.startsWith("watcher."))
1434
- features.fsWatch = true;
1435
- if (fn.startsWith("test."))
1436
- features.nodeTest = true;
1437
- if (fn.startsWith("dgram.") || fn.startsWith("dns."))
1438
- features.dgram = true;
1439
- if (fn.startsWith("tlsca."))
1440
- features.tlsCa = true;
1441
- }
1442
- else {
1443
- switch (node.kind) {
1444
- case "regexLit":
1445
- case "regexIntrinsic":
1446
- features.regex = true;
1447
- break;
1448
- case "strIntrinsic":
1449
- if (node.method === "toLowerCase" || node.method === "toUpperCase" || node.method === "normalize")
1450
- features.regex = true;
1451
- break;
1452
- case "arrIntrinsic":
1453
- if (node.method === "toReversed" || node.method === "toSpliced" || node.method === "with" || node.method === "withUndefined")
1454
- features.copying = true;
1455
- break;
1456
- case "bytesIntrinsic":
1457
- if (node.method === "toReversed" || node.method === "with" || node.method === "join" || node.method === "toArray")
1458
- features.copying = true;
1459
- break;
1460
- case "jsOp":
1461
- if (node.op === "globalGet" && node.name === "fetch")
1462
- features.fetch = true;
1463
- break;
1464
- case "dynInvoke":
1465
- features.dynInvoke = true;
1466
- break;
1467
- case "awaitExpr":
1468
- if (node.type.kind === "dyn")
1469
- features.dynAsync = true;
1470
- break;
1471
- case "dynFrom": {
1472
- const boxed = node.value.type;
1473
- if (boxed.kind === "promise" || (boxed.kind === "func" && boxed.ret.kind === "promise"))
1474
- features.dynAsync = true;
1475
- break;
1476
- }
1477
- }
1478
- }
1479
- return keepGoing();
1480
- };
1481
- const type = (node) => {
1482
- switch (node.kind) {
1483
- case "regex":
1484
- features.regex = true;
1485
- break;
1486
- case "fileHandle":
1487
- features.fileHandle = true;
1488
- break;
1489
- case "procStream":
1490
- features.processEvents = true;
1491
- break;
1492
- case "child":
1493
- case "childStream":
1494
- case "childWriter":
1495
- case "spawnRes":
1496
- features.childProcess = true;
1497
- break;
1498
- case "netServer":
1499
- case "netSocket":
1500
- features.net = true;
1501
- break;
1502
- case "http2Session":
1503
- case "http2Stream":
1504
- features.net = true;
1505
- features.http2 = true;
1506
- break;
1507
- case "httpReq":
1508
- case "httpRes":
1509
- case "httpClientReq":
1510
- features.net = true;
1511
- features.http = true;
1512
- break;
1513
- case "secureCtx":
1514
- features.net = true;
1515
- features.http = true;
1516
- features.tls = true;
1517
- break;
1518
- case "symbol":
1519
- features.symbol = true;
1520
- break;
1521
- case "bigint":
1522
- features.bigint = true;
1523
- break;
1524
- case "searchParams":
1525
- features.searchParams = true;
1526
- break;
1527
- case "fsWatcher":
1528
- features.fsWatch = true;
1529
- break;
1530
- case "testCtx":
1531
- features.nodeTest = true;
1532
- break;
1533
- case "dgramSocket":
1534
- features.dgram = true;
1535
- break;
1536
- }
1537
- return keepGoing();
1538
- };
1539
- if (keepGoing())
1540
- everyModuleNode(mod, { expr, stmt: keepGoing, type });
1541
- return features;
1542
- }
1543
- /** True when the module contains any regex construct — a regexLit /
1544
- * regexIntrinsic node or a regex-typed slot anywhere. This is the link
1545
- * switch that pulls scr_regex.c + the vendored libregexp into the binary
1546
- * (native-toolchain.ts); regex-free programs keep the historical command line. The
1547
- * typed traversal visits type slots as well as executable nodes. */
1548
- export function moduleUsesRegex(mod) {
1549
- return scanRuntimeFeatures(mod, "regex").regex;
1550
- }
1551
- /** True when the module contains an intrinsic whose implementation lives
1552
- * in scr_copying.c. This is the link switch that keeps the optional
1553
- * Array-copying and typed-array bridge TU out of unrelated binaries. */
1554
- export function moduleUsesCopying(mod) {
1555
- return scanRuntimeFeatures(mod, "copying").copying;
1556
- }
1557
- /** True when a non-UTF-8 TextDecoder call survives lowering. This gates the
1558
- * generated legacy mapping tables inside scr_bytes.c; the default UTF-8
1559
- * decoder and unrelated Buffer users keep their prior runtime object. */
1560
- export function moduleUsesLegacyTextDecoder(mod) {
1561
- return scanRuntimeFeatures(mod, "legacyTextDecoder").legacyTextDecoder;
1562
- }
1563
- /** True when a FileHandle type survives in the module. This is the link
1564
- * switch for scr_file_handle.c; fs/promises.open carries the type inside its
1565
- * promise result even when no handle method is called. */
1566
- export function moduleUsesFileHandle(mod) {
1567
- return scanRuntimeFeatures(mod, "fileHandle").fileHandle;
1568
- }
1569
- /** True when user code lowers static fetch or the embedded npm graph
1570
- * reaches the engine's global fetch — the link switch that pulls scr_fetch.c +
1571
- * its socket/tls/zlib dependencies into the binary (native-toolchain.ts) and has the
1572
- * emitted main call scr_fetch_install. The npm graph records the embedded
1573
- * source fact with a parser + binder, so comments, strings, property names,
1574
- * and local `fetch` bindings do not change the link or target capability.
1575
- * Fetch-free graphs keep their exact historical link lines. */
1576
- export function moduleUsesFetch(mod) {
1577
- return scanRuntimeFeatures(mod, "fetch").fetch;
1578
- }
1579
- /** The libCall fns served by the OPTIONAL events unit (scr_events.c):
1580
- * process signal/exit listeners and the piped-stdin surface. */
1581
- const PROCESS_EVENT_LIB_FNS = new Set([
1582
- "process.stdio",
1583
- "process.onSignal",
1584
- "process.offSignal",
1585
- "process.onExit",
1586
- "process.offExit",
1587
- "stdin.onData",
1588
- "stdin.onEnd",
1589
- "stdin.onError",
1590
- "stdin.nextChunk",
1591
- // node:readline rides the stdin unit (scr_readline.c links beside
1592
- // scr_events.c under the same gate).
1593
- "rl.create",
1594
- "rl.question",
1595
- "rl.close",
1596
- "rl.onClose",
1597
- ]);
1598
- /** True when the module uses the process-events surface — the link switch
1599
- * that pulls scr_events.c into the binary and has the emitted main call
1600
- * scr_events_install (native-toolchain.ts + emitter; the scr_regex/scr_fetch/scr_zlib
1601
- * gating precedent). Event-free programs pay zero bytes and keep their
1602
- * exact link line. Same generic-walk shape as moduleUsesRegex. */
1603
- export function moduleUsesProcessEvents(mod) {
1604
- return scanRuntimeFeatures(mod, "processEvents").processEvents;
1605
- }
1606
- /** True when the module uses the node:events EventEmitter surface — the
1607
- * link switch that pulls scr_events_emitter.c into the binary (native-toolchain.ts; the
1608
- * scr_events.c gating precedent, but pure data structure: no install, no
1609
- * loop hooks). Two signals: the `%EventEmitter` class def rides the
1610
- * module (any emitter-typed value or `extends EventEmitter` subclass
1611
- * references it, and the emitted RC/trace helpers call scr_emitter_*),
1612
- * or an emitter.* libCall survived (the defaultMaxListeners statics carry
1613
- * no emitter-typed value). Emitter-free programs pay zero bytes and keep
1614
- * their exact link line. */
1615
- export function moduleUsesEmitter(mod) {
1616
- return scanRuntimeFeatures(mod, "emitter").emitter;
1617
- }
1618
- /** True when the program touches the node:stream surface (scr_stream.c —
1619
- * the moduleUsesEmitter story: the class defs ride the module whenever a
1620
- * stream-typed value exists, and every stream libCall names its unit).
1621
- * Stream programs always use the emitter unit too — the stream class
1622
- * defs pull `%EventEmitter` through their base chain, so
1623
- * moduleUsesEmitter answers true whenever this does. Stream-free
1624
- * programs pay zero bytes and keep their exact link line. */
1625
- export function moduleUsesStream(mod) {
1626
- return scanRuntimeFeatures(mod, "stream").stream;
1627
- }
1628
- /** True when the embedded npm graph has an edge into `builtin` — the
1629
- * island shim needs the corresponding native bridge linked (zlib's is
1630
- * the first; the emitted main installs it before any island entry). */
1631
- export function moduleEmbedsBuiltin(mod, builtin) {
1632
- return mod.embedded !== undefined && mod.embedded.edges.some((e) => e.to === builtin);
1633
- }
1634
- /** Embedded module texts at least this long are DEFLATE-compressed into
1635
- * the emitted LLVM (island.ts; each stays plain when deflate does not
1636
- * shrink it) and inflated lazily by the island's module loader at first
1637
- * load. Below it the zlib round trip cannot pay for itself. */
1638
- export const NPM_COMPRESS_MIN = 1024;
1639
- /** True when the emitted npm tables will carry compressed module text —
1640
- * the SAME candidate test island.ts compresses by, so index.ts's
1641
- * zlib link switch and emitter.ts's inflater installation stay in
1642
- * lockstep with the emission (a candidate whose deflate happens not to
1643
- * shrink stays plain; the installed inflater is then just unused). */
1644
- export function moduleEmbedsCompressedNpm(mod) {
1645
- return (mod.embedded !== undefined &&
1646
- mod.embedded.modules.some((m) => m.source.length >= NPM_COMPRESS_MIN || (m.esm ?? "").length >= NPM_COMPRESS_MIN));
1647
- }
1648
- /** True when the module contains any zlib libCall (the static lowering)
1649
- * OR the embedded npm graph imports node:zlib (the island shim) — the
1650
- * link switch that pulls scr_zlib.c + the system libz into the binary
1651
- * (native-toolchain.ts); zlib-free programs keep their exact link line. Same
1652
- * generic-walk shape as moduleUsesRegex: `kind`/`fn` discriminants live
1653
- * only on IR objects. */
1654
- export function moduleUsesZlib(mod) {
1655
- return scanRuntimeFeatures(mod, "zlib").zlib;
1656
- }
1657
- /** True when the module contains any dc.* libCall — the link switch that
1658
- * pulls scr_dc.c (the diagnostics_channel registry and pub/sub) into the
1659
- * binary (native-toolchain.ts). Channel-free binaries keep their exact size class.
1660
- * Same walk shape as moduleUsesZlib. */
1661
- export function moduleUsesDc(mod) {
1662
- return scanRuntimeFeatures(mod, "dc").dc;
1663
- }
1664
- /** True when the module contains any assert libCall — the link switch
1665
- * that pulls scr_assert.c into the binary (native-toolchain.ts). scr_regex.c calls the
1666
- * assert throw/inspect helpers (assert.match lives there), so the regex
1667
- * switch also pulls scr_assert.c; assert-free, regex-free binaries keep
1668
- * the historical command line and size. Same walk shape as
1669
- * moduleUsesZlib. */
1670
- export function moduleUsesAssert(mod) {
1671
- return scanRuntimeFeatures(mod, "assert").assert;
1672
- }
1673
- /** True when the module contains any dynInvoke node or dyn.defineProps
1674
- * libCall — the link switch that pulls scr_dyn_invoke.c (the prototype-
1675
- * method dispatch on dyn receivers, plus scr_dyn_display and
1676
- * scr_dyn_define_props) into the binary (native-toolchain.ts; the assert gating
1677
- * precedent — dispatch-free binaries keep their exact size class). Same
1678
- * walk shape as moduleUsesZlib. */
1679
- export function moduleUsesDynInvoke(mod) {
1680
- return scanRuntimeFeatures(mod, "dynInvoke").dynInvoke;
1681
- }
1682
- /** True when the module contains any insp libCall — the link switch that
1683
- * pulls scr_inspect.c into the binary (native-toolchain.ts; the assert gating
1684
- * precedent — inspect-free binaries keep the historical command line and
1685
- * size class). Same walk shape as moduleUsesZlib. */
1686
- /** True when the module needs scr_async_dyn.c — the checked-dynamic
1687
- * async surfaces (dyn-promise then/catch/finally reactions, await of a
1688
- * dyn value, `new Promise(setImmediate)`, AsyncLocalStorage, the
1689
- * unhandledRejection/warning process events). Also pulled by the
1690
- * dynInvoke and dc gates (their TUs call into this one) — native-toolchain.ts. Same
1691
- * walk shape as moduleUsesZlib. */
1692
- export function moduleUsesDynAsync(mod) {
1693
- return scanRuntimeFeatures(mod, "dynAsync").dynAsync;
1694
- }
1695
- export function moduleUsesInspect(mod) {
1696
- return scanRuntimeFeatures(mod, "inspect").inspect;
1697
- }
1698
- /** True when the module reaches child_process or carries one of its runtime
1699
- * handle/result types. Besides the existing link consequence, this gates the
1700
- * checked-dynamic ChildProcess handle table installed from scr_child.c. */
1701
- export function moduleUsesChildProcess(mod) {
1702
- return scanRuntimeFeatures(mod, "childProcess").childProcess;
1703
- }
1704
- /** True when the module contains any net libCall — the link switch that
1705
- * pulls scr_net.c into the binary and has the emitted main call
1706
- * scr_net_install (native-toolchain.ts + emitter; the scr_events gating precedent).
1707
- * Net-free programs pay zero bytes and keep their exact link line. Same
1708
- * generic-walk shape as moduleUsesZlib. */
1709
- export function moduleUsesNet(mod) {
1710
- return scanRuntimeFeatures(mod, "net").net;
1711
- }
1712
- /** True when the module contains any sym.* libCall or a symbol-kind type
1713
- * anywhere in the IR — the link switch that pulls scr_symbol.c into the
1714
- * binary (native-toolchain.ts; the scr_net gating precedent — no install call, the
1715
- * Symbol.for registry initializes lazily). The TYPE check matters like
1716
- * net's: a symbol-typed local whose initializer compiled to a runtime
1717
- * fence still emits release calls that need the unit linked. Symbol-free
1718
- * programs pay zero bytes and keep their exact link line. */
1719
- export function moduleUsesSymbol(mod) {
1720
- return scanRuntimeFeatures(mod, "symbol").symbol;
1721
- }
1722
- /** True when bigint runtime operations or bigint-typed storage appears in
1723
- * the IR. The type check keeps retain/release references link-safe even
1724
- * when a producing statement was replaced by a runtime fence. */
1725
- export function moduleUsesBigInt(mod) {
1726
- return scanRuntimeFeatures(mod, "bigint").bigint;
1727
- }
1728
- /** True when the module uses the URLSearchParams surface — sp.* libCalls,
1729
- * the url.searchParams getter, or a searchParams-kind type anywhere on
1730
- * the IR (a fenced statement can leave a typed local whose release call
1731
- * still needs the unit linked) — the link switch that pulls
1732
- * scr_url_params.c into the binary (the moduleUsesSymbol precedent: pure
1733
- * data structure, no loop hooks, cross-compiles everywhere). sp-free
1734
- * programs keep their exact link line; scr_url.c itself stays
1735
- * always-linked and never references the unit. */
1736
- export function moduleUsesSearchParams(mod) {
1737
- return scanRuntimeFeatures(mod, "searchParams").searchParams;
1738
- }
1739
- /** True when the module uses the node:querystring surface — the qs.*
1740
- * libCalls that live in scr_qs.c (parse/stringify/unescape; qs.escape
1741
- * emits the always-linked component encoder and deliberately does NOT
1742
- * flip this switch) — the link switch that pulls scr_qs.c into the
1743
- * binary (the moduleUsesSearchParams precedent: pure data transforms, no
1744
- * loop hooks, cross-compiles everywhere). qs-free programs keep their
1745
- * exact link line. Same generic-walk shape as moduleUsesZlib. */
1746
- export function moduleUsesQs(mod) {
1747
- return scanRuntimeFeatures(mod, "qs").qs;
1748
- }
1749
- /** True when the module uses native util parsing, comparison, or styling.
1750
- * The utility units also follow their required symbol, inspection, and
1751
- * warning features, independently of the island's node:util shim. */
1752
- export function moduleUsesParseArgs(mod) {
1753
- return scanRuntimeFeatures(mod, "parseArgs").parseArgs;
1754
- }
1755
- /** True when the module contains any fs.watch/watcher.* libCall — the
1756
- * link switch that pulls scr_watch.c into the binary and has the emitted
1757
- * main call scr_watch_install (native-toolchain.ts + emitter; the scr_net gating
1758
- * precedent). Watch-free programs pay zero bytes and keep their exact
1759
- * link line. Same generic-walk shape as moduleUsesZlib. */
1760
- export function moduleUsesFsWatch(mod) {
1761
- return scanRuntimeFeatures(mod, "fsWatch").fsWatch;
1762
- }
1763
- /** True when the module contains any test.* libCall or a testCtx handle
1764
- * type — the link switch that pulls scr_test.c into the binary and has
1765
- * the emitted main return scr_test_exit_code() after the loop drains
1766
- * (native-toolchain.ts + emitter; the moduleUsesDgram shape). Test-free programs pay
1767
- * zero bytes and keep their exact link line. */
1768
- export function moduleUsesNodeTest(mod) {
1769
- return scanRuntimeFeatures(mod, "nodeTest").nodeTest;
1770
- }
1771
- /** True when the module contains any dgram.* or dns.* libCall — the
1772
- * link switch that pulls scr_dgram.c into the binary and has the emitted
1773
- * main call scr_dgram_install (native-toolchain.ts + emitter; the scr_net gating
1774
- * precedent — dns.lookup lives in the same unit, so either prefix
1775
- * answers). Dgram-free programs pay zero bytes and keep their exact link
1776
- * line. Same generic-walk shape as moduleUsesZlib. */
1777
- export function moduleUsesDgram(mod) {
1778
- return scanRuntimeFeatures(mod, "dgram").dgram;
1779
- }
1780
- /** True when the module contains any http.* libCall — the link switch
1781
- * that pulls scr_http.c into the binary (native-toolchain.ts; moduleUsesNet already
1782
- * answers true for these, so scr_net.c comes along). */
1783
- export function moduleUsesHttpServer(mod) {
1784
- return scanRuntimeFeatures(mod, "http").http;
1785
- }
1786
- /** The legacy http2.* libCalls implemented by scr_http.c/scr_tls.c (the
1787
- * allowHTTP1 compatibility slice) — they must NOT pull scr_http2.c, so
1788
- * divergence-57 binaries keep their exact link line. */
1789
- const HTTP2_LEGACY_FNS = new Set([
1790
- "http2.streamNoop", "http2.streamUndefCall",
1791
- ]);
1792
- /** True when the module uses the REAL h2 surface (scr_http2.c): any core
1793
- * http2.* libCall, or an h2 handle type left behind by a fenced statement
1794
- * (its emitted release call needs the unit — the moduleUsesNet story). */
1795
- export function moduleUsesHttp2(mod) {
1796
- return scanRuntimeFeatures(mod, "http2").http2;
1797
- }
1798
- /** True when the module contains any tls.* or https.* libCall — the link
1799
- * switch that pulls scr_tls.c and the vendored mbedTLS archive into the
1800
- * binary (native-toolchain.ts; moduleUsesNet and moduleUsesHttpServer already answer
1801
- * true for these, so scr_net.c and scr_http.c come along). TLS-free
1802
- * programs keep their exact link line and never build mbedTLS. */
1803
- export function moduleUsesTls(mod) {
1804
- return scanRuntimeFeatures(mod, "tls").tls;
1805
- }
1806
- /** True when the module contains any tlsca.* libCall — the link switch
1807
- * for scr_tls_ca.c, the CA-store introspection unit (getCACertificates /
1808
- * rootCertificates / setDefaultCACertificates). Deliberately SEPARATE
1809
- * from moduleUsesTls: the unit is plain PEM-block bookkeeping, so a
1810
- * program that only inspects the CA store never pulls mbedTLS. native-toolchain.ts
1811
- * also compiles the unit whenever TLS itself links — scr_tls.c consults
1812
- * the unit's default-set override for its trust anchors. */
1813
- export function moduleUsesTlsCa(mod) {
1814
- return scanRuntimeFeatures(mod, "tlsCa").tlsCa;
1815
- }
1816
- /* ── library mode's async_free gate ──────────────────────────────────────
1817
- * v1 library mode REQUIRES an async_free module graph (ratified): no async
1818
- * functions, no generators, no timers, no event-loop or ambient-process
1819
- * surface anywhere the entry reaches — a static fact of the graph, never a
1820
- * runtime observation. The detector below answers "what does this graph
1821
- * reach that a library artifact cannot link?", first offender with its source anchor;
1822
- * the structural consequence (scr_async.c / scr_child.c and every
1823
- * loop-hooked unit never join a library link) is safe exactly because this
1824
- * refusal ran first. */
1825
- /** libCall families a v1 library artifact refuses, with the surface name the SC4005
1826
- * teaching uses. Prefix match over IrLibFn spellings. */
1827
- const LIB_MODE_REFUSED_PREFIXES = [
1828
- // fs.exists is the one CALLBACK-async fs op with a real implementation:
1829
- // its fire rides the timer queue (scr_bytes_io.c), which library links
1830
- // exclude — refuse the surface like the rest of the event-loop family.
1831
- ["fs.existsChk", "the async fs callback surface (fs.exists)"],
1832
- ["fs.renameCb", "the async fs callback surface (fs.rename)"],
1833
- ["fs.callback", "the async filesystem callback surface"],
1834
- ["zlib.deflateCb", "the async node:zlib callback surface"],
1835
- ["zlib.inflateCb", "the async node:zlib callback surface"],
1836
- ["zlib.deflateRawCb", "the async node:zlib callback surface"],
1837
- ["zlib.inflateRawCb", "the async node:zlib callback surface"],
1838
- ["zlib.gzipCb", "the async node:zlib callback surface"],
1839
- ["zlib.gunzipCb", "the async node:zlib callback surface"],
1840
- ["zlib.unzipCb", "the async node:zlib callback surface"],
1841
- ["process.stdoutWriteBytesCb", "process.stdout.write completion callbacks"],
1842
- ["process.stderrWriteBytesCb", "process.stderr.write completion callbacks"],
1843
- ["timers.", "the timers surface (setTimeout family)"],
1844
- ["tp.", "the timers/promises surface"],
1845
- ["cp.", "the child_process surface"],
1846
- ["child.", "the child_process surface"],
1847
- ["spawnRes.", "the child_process surface"],
1848
- ["process.on", "process signal/exit listeners"],
1849
- ["process.off", "process signal/exit listeners"],
1850
- ["stdin.", "the stdin event surface"],
1851
- ["rl.", "the node:readline surface"],
1852
- ["net.", "the node:net surface"],
1853
- ["http.", "the node:http surface"],
1854
- ["https.", "the node:https surface"],
1855
- ["http2.", "the node:http2 surface"],
1856
- ["h2.", "the node:http2 surface"],
1857
- ["dgram.", "the node:dgram surface"],
1858
- ["dns.", "the node:dns surface"],
1859
- ["tls.", "the node:tls surface"],
1860
- ["fs.watch", "fs.watch"],
1861
- ["watcher.", "fs.watch"],
1862
- ["test.", "the node:test surface"],
1863
- ["readable.", "the node:stream surface"],
1864
- ["writable.", "the node:stream surface"],
1865
- ["duplex.", "the node:stream surface"],
1866
- ["transform.", "the node:stream surface"],
1867
- ["passthrough.", "the node:stream surface"],
1868
- ["stream.", "the node:stream surface"],
1869
- ["als.", "AsyncLocalStorage"],
1870
- ["urj.", "unhandled-rejection tracking"],
1871
- ["dc.", "the diagnostics_channel surface"],
1872
- ];
1873
- /** Value/type kinds whose mere presence means an excluded unit's code (or
1874
- * a fiber) would have to link. */
1875
- const LIB_MODE_REFUSED_KINDS = new Map([
1876
- ["promise", "promise values"],
1877
- ["generator", "generator values"],
1878
- ["awaitExpr", "await"],
1879
- ["awaitUnionExpr", "await"],
1880
- ["yieldExpr", "yield"],
1881
- ["child", "the child_process surface"],
1882
- ["spawnRes", "the child_process surface"],
1883
- ["childStream", "the child_process surface"],
1884
- ["childWriter", "the child_process surface"],
1885
- ["netServer", "the node:net surface"],
1886
- ["netSocket", "the node:net surface"],
1887
- ["http2Session", "the node:http2 surface"],
1888
- ["http2Stream", "the node:http2 surface"],
1889
- ["dgramSocket", "the node:dgram surface"],
1890
- ["fsWatcher", "fs.watch"],
1891
- ["testCtx", "the node:test surface"],
1892
- ["httpReq", "the node:http surface"],
1893
- ["httpRes", "the node:http surface"],
1894
- ["httpClientReq", "the node:http surface"],
1895
- ["secureCtx", "the node:tls surface"],
1896
- ]);
1897
- /** First async/event-loop/ambient-process surface the module graph
1898
- * reaches, or null when the graph is async_free (the v1 library requirement).
1899
- * Typed slots use their declaration location and executable nodes use their
1900
- * own location, so the refusal anchors at the reaching construct; the
1901
- * coarse moduleUses* predicates are the safety net behind the fine-grained
1902
- * table (a surface reached only through a spelling the table misses still
1903
- * refuses, anchored at the entry). */
1904
- export function moduleLibAsyncSurface(mod) {
1905
- for (const fn of mod.functions) {
1906
- if (fn.async === true)
1907
- return { surface: `an async function ('${fn.name.replace(/^%/, "")}')`, loc: fn.loc };
1908
- if (fn.generator !== undefined) {
1909
- return { surface: `a generator function ('${fn.name.replace(/^%/, "")}')`, loc: fn.loc };
1910
- }
1911
- }
1912
- const entryLoc = { file: mod.sourceFile, start: 0, end: 0 };
1913
- let found = null;
1914
- const checkKind = (kind, loc) => {
1915
- const surface = LIB_MODE_REFUSED_KINDS.get(kind);
1916
- if (surface === undefined)
1917
- return true;
1918
- found = { surface, loc };
1919
- return false;
1920
- };
1921
- everyModuleNode(mod, {
1922
- type: (node, loc) => checkKind(node.kind, loc),
1923
- stmt: () => true,
1924
- expr: (node) => {
1925
- if (!checkKind(node.kind, node.loc))
1926
- return false;
1927
- if (node.kind === "libCall") {
1928
- for (const [prefix, surface] of LIB_MODE_REFUSED_PREFIXES) {
1929
- if (node.fn.startsWith(prefix)) {
1930
- found = { surface, loc: node.loc };
1931
- return false;
1932
- }
1933
- }
1934
- }
1935
- return true;
1936
- },
1937
- });
1938
- if (found !== null)
1939
- return found;
1940
- // Safety net: the coarse unit predicates, entry-anchored. Every one of
1941
- // these units is excluded from library links, so a true answer that the
1942
- // fine-grained table missed must still refuse.
1943
- const features = moduleRuntimeFeatures(mod);
1944
- const coarse = [
1945
- [features.processEvents, "process signal/exit listeners or the stdin event surface"],
1946
- [features.net, "the node:net surface"],
1947
- [features.http, "the node:http surface"],
1948
- [features.http2, "the node:http2 surface"],
1949
- [features.dgram, "the node:dgram surface"],
1950
- [features.fsWatch, "fs.watch"],
1951
- [features.stream, "the node:stream surface"],
1952
- [features.tls, "the node:tls surface"],
1953
- [features.fetch, "fetch"],
1954
- [features.nodeTest, "the node:test surface"],
1955
- [features.dynAsync, "the checked-dynamic async surface"],
1956
- [features.dc, "the diagnostics_channel surface"],
1957
- ];
1958
- for (const [on, surface] of coarse) {
1959
- if (on)
1960
- return { surface, loc: entryLoc };
1961
- }
1962
- return null;
1963
- }
1964
- /* ── the sidecar's determinism attestation ───────────────────────────────
1965
- * `deterministic` is true exactly when the compiled module graph reaches
1966
- * no ambient-nondeterminism or ambient-authority surface (random, live
1967
- * clock, environment, filesystem, machine identity) — a static fact of
1968
- * the graph, proven at compile time, never a runtime hope. Network,
1969
- * timers, scheduling, and child processes are already impossible here:
1970
- * the SC4005 async_free gate refused them before any library artifact
1971
- * emitted. The scan is CONSERVATIVE by design: an ambient family reached
1972
- * anywhere in the graph demotes the attestation even when a finer
1973
- * analysis might prove the specific call pure (e.g. date formatting of a
1974
- * stored value) — the attestation may honestly under-claim, never
1975
- * over-claim (schema rule V14: computed, never defaulted). */
1976
- /** libCall families that demote `deterministic` (prefix match over
1977
- * IrLibFn spellings). process.stdout/stderr writes are deliberately NOT
1978
- * here: output is an effect, not a nondeterminism input, and console
1979
- * policy is the profile's ask-5 business. process.platform/arch and the
1980
- * version constants fold at compile time, so they are per-binary
1981
- * constants, not ambient reads. Exported for the attestation-parity test
1982
- * (tests/harness/surface-manifest.test.ts): every spelling this table
1983
- * demotes on must be deniable by a manifest-id fence, or the ask-5 §4
1984
- * invariant (compiles under full fences ⇒ deterministic) cannot be
1985
- * stated. */
1986
- export const LIB_NONDETERMINISTIC_PREFIXES = [
1987
- ["math.random", "Math.random"],
1988
- ["crypto.random", "crypto randomness"],
1989
- ["date.", "the live clock (Date)"],
1990
- ["perf.", "the live clock (performance)"],
1991
- ["process.env", "environment reads"],
1992
- ["process.argv", "process.argv"],
1993
- ["process.cwd", "process.cwd"],
1994
- ["process.chdir", "process.chdir"],
1995
- ["process.pid", "process identity"],
1996
- ["process.getuid", "process identity"],
1997
- ["process.getgid", "process identity"],
1998
- ["process.execPath", "process identity"],
1999
- ["process.uptime", "the live clock (process.uptime)"],
2000
- ["process.availableMemory", "machine memory state"],
2001
- ["process.constrainedMemory", "machine memory state"],
2002
- // process.memoryUsage carries NO row: nothing lowers it — no IrLibFn
2003
- // spelling exists for it, so a prefix here would be dead. If a lowering
2004
- // ever lands, its spellings must join this table AND the manifest's
2005
- // ambient projection (the parity test fails until both agree).
2006
- ["process.rusage", "machine resource usage (process.resourceUsage)"],
2007
- ["process.cpu", "the process CPU clock (process.cpuUsage)"],
2008
- ["process.threadCpu", "the thread CPU clock (process.threadCpuUsage)"],
2009
- ["process.isTTY", "terminal attachment (isTTY)"],
2010
- ["process.columns", "terminal geometry (columns)"],
2011
- ["process.rows", "terminal geometry (rows)"],
2012
- ["process.kill", "process authority (kill)"],
2013
- ["process.umask", "process authority (umask)"],
2014
- ["process.exit", "process authority (exit)"],
2015
- ["process.setExitCode", "process authority (exit status)"],
2016
- ["fs.", "the filesystem"],
2017
- ["os.", "machine/OS identity"],
2018
- // The CA-store surface reads the host's certificate bundle (and the
2019
- // NODE_EXTRA_CA_CERTS environment) — machine identity by another name.
2020
- ["tlsca.", "the host CA store"],
2021
- ];
2022
- /** First ambient-nondeterminism or ambient-authority surface the module
2023
- * graph reaches, or null when the graph is clean (the sidecar then
2024
- * attests `deterministic: true`). */
2025
- export function moduleLibNondeterministicSurface(mod) {
2026
- let found = null;
2027
- const expr = (node) => {
2028
- if (node.kind === "libCall") {
2029
- for (const [prefix, surface] of LIB_NONDETERMINISTIC_PREFIXES) {
2030
- if (node.fn.startsWith(prefix)) {
2031
- found = surface;
2032
- return false;
2033
- }
2034
- }
2035
- }
2036
- return everyExprChild(node, expr, stmt);
2037
- };
2038
- const stmt = (node) => everyStmtChild(node, expr, stmt);
2039
- for (const fn of mod.functions) {
2040
- if (!fn.body.every(stmt))
2041
- break;
2042
- }
2043
- return found;
2044
- }
2045
- /** The may-throw seed: libCall members that can raise. Every fs.* member
2046
- * EXCEPT existsSync (which, like Node's, swallows errors and returns false)
2047
- * throws a catchable error on failure; json.parse throws a catchable
2048
- * SyntaxError-shaped string on malformed input. Backends' may-throw analyses must treat a function containing one
2049
- * of these as throwing, exactly like a `throw` statement (and must ALSO
2050
- * seed on `dynCheck` and `awaitExpr` nodes, which throw on validation
2051
- * failure / promise rejection). */
2052
- export const MAY_THROW_LIB_FNS = new Set([
2053
- "text.encodeInto",
2054
- "buffer.isAscii",
2055
- "buffer.isUtf8",
2056
- "buffer.transcode",
2057
- "cp.spawnDynamic",
2058
- "child.onDyn",
2059
- "text.decoderEncoding",
2060
- "dyn.construct",
2061
- "dyn.reflectApply",
2062
- "dyn.reflectGet",
2063
- "dyn.reflectSet",
2064
- "dyn.reflectDefine",
2065
- "dyn.abstractEq",
2066
- "text.decodeOptions",
2067
- "text.decodeStream",
2068
- "text.decodeLegacyOptions",
2069
- "dyn.nativeSetNew",
2070
- "ffi.argument",
2071
- "ffi.memoryModule",
2072
- "process.stdoutWrite",
2073
- "process.stderrWrite",
2074
- "process.stdoutWriteBytes",
2075
- "process.stderrWriteBytes",
2076
- "procStream.write",
2077
- "weakMap.new",
2078
- "weakSet.new",
2079
- "dyn.fromEntries",
2080
- "bytes.constructor",
2081
- "bytes.instanceOf",
2082
- "buffer.byteLenDyn",
2083
- "bytes.construct",
2084
- "arrayBuffer.new",
2085
- "arrayBuffer.byteLengthGetter",
2086
- "arrayBuffer.viewU8C",
2087
- "arrayBuffer.viewI8",
2088
- "arrayBuffer.viewU16",
2089
- "arrayBuffer.viewI16",
2090
- "arrayBuffer.viewU8",
2091
- "arrayBuffer.viewU32",
2092
- "arrayBuffer.viewI32",
2093
- "arrayBuffer.viewF32",
2094
- "arrayBuffer.viewF64",
2095
- "arrayBuffer.viewDV",
2096
- "bytes.bufferSource",
2097
- "text.decodeBufferSource",
2098
- "bigint.parse",
2099
- "bigint.fromF64",
2100
- "bigint.div",
2101
- "bigint.mod",
2102
- "bigint.pow",
2103
- "bigint.shl",
2104
- "bigint.shr",
2105
- "bigint.toString",
2106
- "bigint.asUintN",
2107
- "bigint.asIntN",
2108
- "bigint.bufferRead",
2109
- "bigint.bufferWrite",
2110
- "bigint.dataViewGet",
2111
- "bigint.dataViewSet",
2112
- "fetch.requestNew",
2113
- "fetch.headersNew",
2114
- "fetch.responseNew",
2115
- "fetch.abortTimeout",
2116
- "fetch.abortAny",
2117
- "abort.timeout",
2118
- "abort.any",
2119
- "fetch.streamNew",
2120
- "fetch.streamFrom",
2121
- "num.toFixed",
2122
- "num.toStringRadix",
2123
- "insp.jsonDyn",
2124
- // diagnostics_channel: publish runs subscribers synchronously (a throw
2125
- // propagates — the documented divergence from triggerUncaughtException);
2126
- // the subscribe/unsubscribe forms throw Node's ERR_INVALID_ARG_TYPE for
2127
- // non-function subscribers.
2128
- "dc.publish",
2129
- "dc.subscribe",
2130
- "dc.unsubscribe",
2131
- "dc.chanSubscribe",
2132
- "dc.chanUnsubscribe",
2133
- "dc.tcSubscribe",
2134
- "dc.tcUnsubscribe",
2135
- "dc.tcTraceSync",
2136
- "dc.tcTraceCallback",
2137
- "dc.tcTracePromise",
2138
- "process.onUncaughtException",
2139
- "process.offUncaughtException",
2140
- "process.onSignal",
2141
- "process.offSignal",
2142
- "process.onUnhandledRejection",
2143
- "process.onRejectionHandled",
2144
- "async.awaitDyn",
2145
- "als.run",
2146
- "als.exitRun",
2147
- "dc.chanBindStore",
2148
- "dc.chanRunStores",
2149
- "http.resWriteHeadDyn",
2150
- "http.resWriteContinue",
2151
- "http.resWriteProcessing",
2152
- "http.resWriteEarlyHints",
2153
- "http.validateHeaderName",
2154
- "http.validateHeaderValue",
2155
- "http.serverTimeoutGet",
2156
- "http.serverTimeoutOptionSet",
2157
- "net.sockSetEncoding",
2158
- "http.reqSetEncoding",
2159
- "fs.readFileSyncBuf",
2160
- "fs.readFileSyncDyn",
2161
- // tls/https runtime options records: the walks throw the catchable
2162
- // runtime fence for out-of-bounds members and non-PEM values (the
2163
- // divergence-66 stance).
2164
- "tls.pemDyn",
2165
- "tls.createServerDyn",
2166
- "tls.createSecureContextDyn",
2167
- "tls.caCertsChk",
2168
- "tls.createServerDynCb",
2169
- "https.createServerDyn",
2170
- "https.createServerDynCb",
2171
- "http2.createSecureServerDyn",
2172
- "http2.createSecureServerDynCb",
2173
- "tls.connect",
2174
- "tls.connectCb",
2175
- // The CA-store surface: an unknown getCACertificates type throws
2176
- // Node's ERR_INVALID_ARG_VALUE TypeError; setDefaultCACertificates
2177
- // throws Node's ERR_CRYPTO_OPERATION_FAILED on a certificate-free
2178
- // array.
2179
- "tlsca.get",
2180
- "tlsca.set",
2181
- // EventEmitter dispatch runs user listeners synchronously (emit), and
2182
- // the mutation forms fire the newListener/removeListener meta events —
2183
- // any of them can throw. emitError additionally THROWS its payload when
2184
- // 'error' has no listener, Node's unhandled-'error' contract.
2185
- "emitter.emit",
2186
- "emitter.emitFlex",
2187
- "emitter.emitError",
2188
- "emitter.on",
2189
- "emitter.off",
2190
- "emitter.checkListener",
2191
- "emitter.onDyn",
2192
- "emitter.onFlex",
2193
- "emitter.offDyn",
2194
- "emitter.onData",
2195
- "emitter.onDataDyn",
2196
- "emitter.emitData",
2197
- "readable.nextChunk",
2198
- "readable.nextChunkDyn",
2199
- // The checked-dynamic chunk forms throw Node's ERR_INVALID_ARG_TYPE
2200
- // chunk TypeError on a non-string/Buffer dyn kind.
2201
- "net.sockWriteDyn",
2202
- "net.sockEndDyn",
2203
- "http.resWriteDyn",
2204
- "http.resEndDyn",
2205
- "http.resAddTrailers",
2206
- "http.resFlushHeaders",
2207
- "http.resUncork",
2208
- "http.resWriteHead",
2209
- "http.resWriteHeadN",
2210
- "http.resWriteHeadPairs",
2211
- "http.resWrite",
2212
- "http.resWriteBytes",
2213
- "http.resEnd",
2214
- "http.resEndStr",
2215
- "http.resEndBytes",
2216
- "http.clientWriteDyn",
2217
- "http.clientEndDyn",
2218
- "http.clientAddTrailers",
2219
- "http.clientFlushHeaders",
2220
- "http.clientUncork",
2221
- "http.clientWrite",
2222
- "http.clientWriteBytes",
2223
- "http.clientEnd",
2224
- "http.clientEndStr",
2225
- "http.clientEndBytes",
2226
- // The URL-string client form throws catchably on an unparsable input
2227
- // ("Invalid URL") or a non-http scheme (ERR_INVALID_PROTOCOL).
2228
- "http.requestUrl",
2229
- "http.requestUrlCb",
2230
- // The h2 client's throwing entries: connect on a bad/non-http
2231
- // authority (ERR_INVALID_URL / ERR_INVALID_PROTOCOL), request on a
2232
- // closed/destroyed session (ERR_HTTP2_INVALID_SESSION), setEncoding on
2233
- // an unknown name (ERR_UNKNOWN_ENCODING). Event fires run user code
2234
- // synchronously (the stream-operations stance below), so the data/
2235
- // write paths that can fire inline join too.
2236
- "http2.connect",
2237
- "http2.connectCb",
2238
- "http2.sessionRequest",
2239
- "http2.streamSetEncoding",
2240
- "http2.streamRespond",
2241
- "http2.streamWrite",
2242
- "http2.streamWriteBytes",
2243
- "http2.streamEnd",
2244
- "http2.streamEndStr",
2245
- "http2.streamEndBytes",
2246
- "emitter.removeAll",
2247
- // Stream operations run user code synchronously (option callbacks and
2248
- // 'data'/'drain'/... listeners on the caller's stack, like emit) — any
2249
- // of them may leave a listener's throw pending. destroy with no 'error'
2250
- // listener throws the payload itself (the emitter.emitError contract).
2251
- // The dyn-options constructors walk the record at runtime: a consumed-
2252
- // but-unlowered option (objectMode, construct, ...) throws the compile
2253
- // fence's runtime twin; a bad encoding throws ERR_UNKNOWN_ENCODING.
2254
- "stream.finished",
2255
- "stream.finishedDyn",
2256
- "stream.pipeline",
2257
- "stream.pipelineDyn",
2258
- "sp.finished",
2259
- "sp.pipeline",
2260
- "sc.text",
2261
- "sc.json",
2262
- "sc.buffer",
2263
- "readable.newDyn",
2264
- "writable.newDyn",
2265
- "duplex.newDyn",
2266
- "transform.newDyn",
2267
- "passthrough.newDyn",
2268
- "readable.initDyn",
2269
- "writable.initDyn",
2270
- "duplex.initDyn",
2271
- "transform.initDyn",
2272
- "passthrough.initDyn",
2273
- "readable.push",
2274
- "readable.pushStr",
2275
- "readable.pushStrEnc",
2276
- "readable.pushNull",
2277
- "readable.pushU",
2278
- "readable.pushDyn",
2279
- "readable.unshift",
2280
- "readable.unshiftStr",
2281
- "readable.read",
2282
- "readable.readDyn",
2283
- "stream.onDyn",
2284
- "readable.resume",
2285
- "readable.pipe",
2286
- "readable.unpipe",
2287
- "writable.write",
2288
- "writable.writeStr",
2289
- "writable.writeU",
2290
- "writable.writeDyn",
2291
- "writable.end",
2292
- "writable.uncork",
2293
- "stream.destroy",
2294
- "stream.destroyErr",
2295
- "stream.iteratorClose",
2296
- // setMaxListeners(n) throws Node's ERR_OUT_OF_RANGE RangeError for
2297
- // negative/NaN arguments; the static form's default-max write validates
2298
- // identically (Node's validateNumber(n, "setMaxListeners", 0)).
2299
- "emitter.setMax",
2300
- "emitter.setDefaultMax",
2301
- // The createConnection request forms run the caller's dialer closure
2302
- // synchronously — a throw there propagates like Node's.
2303
- "http.requestConn",
2304
- "http.requestConnCb",
2305
- "process.kill",
2306
- "process.killNum",
2307
- "process.setExitCode",
2308
- // cpuUsage(prev)'s field validation: negative/non-finite prev fields
2309
- // throw Node's ERR_INVALID_ARG_VALUE RangeError, catchably.
2310
- "process.cpuPrevValidate",
2311
- // Non-TTY stdin: Node's stdin has no setRawMode member, so the call is
2312
- // the exact catchable TypeError.
2313
- "process.stdinSetRawMode",
2314
- // The unguarded h2-only stream call: always throws Node's TypeError.
2315
- "http2.streamUndefCall",
2316
- "http.reqH2StreamOrThrow",
2317
- // A read of a declare-d const nothing defines: always throws Node's
2318
- // catchable ReferenceError.
2319
- "global.undefRead",
2320
- // The compiler-resolved Node-parity throw: always throws, catchably.
2321
- "error.nodeThrow",
2322
- // USVString coercion runs user toString/valueOf — throws propagate.
2323
- "dyn.toStringCoerce",
2324
- "dyn.stringConstructor",
2325
- "dyn.propertyKey",
2326
- "dyn.toNumeric",
2327
- "dyn.increment",
2328
- // Error messages use the same coercion protocol before installing cause.
2329
- "error.newOptions",
2330
- "error.ctorOptions",
2331
- "error.toString",
2332
- "error.stack",
2333
- "error.cause",
2334
- "error.setCause",
2335
- "error.deleteCause",
2336
- "dyn.objectTag",
2337
- // Numeric coercion runs user valueOf/toString — throws propagate.
2338
- "dyn.numberConstructor",
2339
- "dyn.bigintConstructor",
2340
- "dyn.toNumberCoerce",
2341
- "dyn.add",
2342
- "dyn.arithmetic",
2343
- "dyn.compare",
2344
- "dyn.bitwise",
2345
- "dyn.proxyNew",
2346
- "dyn.classBasePrototype",
2347
- "dyn.classInherit",
2348
- "dyn.classSuper",
2349
- "dyn.hasKey",
2350
- "child.kill",
2351
- // The caller's lookup runs synchronously inside the connect call — a
2352
- // throw there propagates like Node's.
2353
- "net.connectLookup",
2354
- "cp.execSync",
2355
- "cp.execCapture",
2356
- // The client request constructors validate the method token
2357
- // synchronously (Node's ClientRequest ctor throw:
2358
- // ERR_INVALID_HTTP_TOKEN).
2359
- "http.request",
2360
- "http.requestCb",
2361
- "http.requestConn",
2362
- "http.requestConnCb",
2363
- // The agent rows add the runtime agent-value gates (a non-Agent value
2364
- // is Node's ERR_INVALID_ARG_TYPE); agentNew's keepAlive: true throws
2365
- // the named pooling fence.
2366
- "http.agentNew",
2367
- "http.requestAgent",
2368
- "http.requestAgentCb",
2369
- "https.requestAgent",
2370
- "https.requestAgentCb",
2371
- "https.request",
2372
- "https.requestCb",
2373
- // The URL-string form's parse, exactly http.requestUrl's (an
2374
- // unparsable input, or a scheme that is not https).
2375
- "https.requestUrl",
2376
- "https.requestUrlCb",
2377
- "https.requestFn",
2378
- "https.requestFnCb",
2379
- "rl.question",
2380
- "island.eval",
2381
- "island.import",
2382
- "island.castFail",
2383
- "json.parse",
2384
- "json.parseReviver",
2385
- "json.stringifyReplacer",
2386
- "json.stringifyValue",
2387
- "date.nativeNew",
2388
- "date.checkedValue",
2389
- "util.parseArgs",
2390
- "util.parseEnv",
2391
- "util.getSystemErrorName",
2392
- "util.getSystemErrorMessage",
2393
- "util.stripVTControlCharacters",
2394
- "util.isDeepStrictEqual",
2395
- "util.styleText",
2396
- "util.toUSVString",
2397
- // decodeURIComponent throws the spec's URIError on bad hex/invalid
2398
- // UTF-8 octets (encodeURIComponent never throws — see the IrLibFn doc).
2399
- "str.decodeUriComponent",
2400
- "str.decodeUri",
2401
- // The base64 globals: atob/btoa throw the catchable DOMException
2402
- // InvalidCharacterError on malformed input; the zero-argument form
2403
- // always throws Node's TypeError [ERR_MISSING_ARGS].
2404
- "str.atob",
2405
- "str.btoa",
2406
- "str.b64Missing",
2407
- // queueMicrotask's checked-dynamic form throws ERR_INVALID_ARG_TYPE
2408
- // synchronously on a non-function argument (the closure form never
2409
- // throws — the callback's own throw surfaces at drain, uncaught).
2410
- "timers.queueMicrotaskDyn",
2411
- // structuredClone: option validation throws Node's TypeErrors,
2412
- // functions/handles the spec's DataCloneError, cycles the scriptc
2413
- // fence; the zero-argument form always throws ERR_MISSING_ARGS. The
2414
- // DOMException clone shares the option validation.
2415
- "dyn.structuredClone",
2416
- "dyn.cloneMissing",
2417
- "dyn.cloneTransferFail",
2418
- // the dyn Object walks throw on null/undefined receivers
2419
- "dyn.objKeys",
2420
- "dyn.forInKeys",
2421
- "dyn.hasOwn",
2422
- "dyn.propertyIsEnumerable",
2423
- "dyn.assign",
2424
- "dyn.copyDataProperties",
2425
- "dyn.objectRest",
2426
- // variadic Object.assign: spread flattening throws V8's spread-call
2427
- // TypeErrors; the final copy throws ToObject on a nullish target
2428
- "dyn.packPushSpread",
2429
- "dyn.packPushSpreadIter",
2430
- "dyn.assignAll",
2431
- "dyn.objCreate",
2432
- "dyn.objCreateWithProperties",
2433
- "dyn.getPrototype",
2434
- "dyn.setPrototype",
2435
- "dyn.getOwnPropertyNames",
2436
- "dyn.ownKeys",
2437
- "dyn.getOwnPropertySymbols",
2438
- "dyn.getOwnPropertyDescriptors",
2439
- "dyn.preventExtensions",
2440
- "dyn.isExtensible",
2441
- "dyn.seal",
2442
- "dyn.isSealed",
2443
- "dyn.objValues",
2444
- "dyn.objEntries",
2445
- "error.domClone",
2446
- // new RegExp compiles the pattern eagerly: an invalid pattern or flag
2447
- // throws Node's catchable SyntaxError at construction.
2448
- "regex.new",
2449
- "regex.resetLastIndex",
2450
- "regex.newChecked",
2451
- "dyn.keySet",
2452
- "dyn.keySetComputed",
2453
- "process.builtinId",
2454
- "process.builtinModule",
2455
- "process.builtinUnsupported",
2456
- "fs.callbackValue",
2457
- "fs.callbackCall",
2458
- "dyn.keyDelete",
2459
- "dyn.keyDeleteComputed",
2460
- "dyn.hasKeyComputed",
2461
- "dyn.hasOwnComputed",
2462
- "dyn.propertyIsEnumerableComputed",
2463
- // the destructuring pack throws V8's TypeError on non-iterable dyn kinds
2464
- "dyn.iterPack",
2465
- "dyn.arrayFromIterator",
2466
- "dyn.iterator",
2467
- "dyn.iteratorResult",
2468
- "dyn.mapSeedEntries",
2469
- "dyn.mapSeedEntry",
2470
- "dyn.freeze",
2471
- "dyn.isFrozen",
2472
- "dyn.toString",
2473
- "string.fromCodePoint",
2474
- "dyn.defineProps",
2475
- "dyn.definePrototypeProps",
2476
- "dyn.bagGet",
2477
- "dyn.bagSet",
2478
- "dyn.defineProperty",
2479
- "dyn.getOwnPropertyDescriptor",
2480
- "dyn.arrayProtoCall",
2481
- "process.chdir",
2482
- "process.loadEnvFile",
2483
- "fs.realpathSync",
2484
- "fs.realpathNativeSync",
2485
- "fs.readFileSync",
2486
- "fs.writeFileSync",
2487
- "fs.appendFileSync",
2488
- "fs.mkdirSync",
2489
- "fs.rmSync",
2490
- "fs.rmdirSync",
2491
- "fs.readdirSync",
2492
- "fs.readdirTypesSync",
2493
- "url.new",
2494
- "url.newBase",
2495
- "url.set",
2496
- "url.setChecked",
2497
- "url.fileURLToPathUrl",
2498
- "url.fileURLToPathChecked",
2499
- "url.fileURLToPathOptions",
2500
- "url.fileURLToPathBuffer",
2501
- "url.pathToFileURLChecked",
2502
- "url.fileURLToPathStr",
2503
- // The win32-target flavor of pathToFileURL (same runtime entry point —
2504
- // the bridge dispatches by the binary's platform): Node's win32 arm
2505
- // raises ERR_INVALID_ARG_VALUE TypeErrors for malformed UNC inputs, so
2506
- // only THIS flavor seeds may-throw — posix emission stays untouched.
2507
- "url.pathToFileURLWin32",
2508
- "url.pathToFileURLPlatform",
2509
- // URLSearchParams from a string[][]: Node's ERR_INVALID_TUPLE TypeError
2510
- // on a row that is not a [name, value] pair. The rest of the sp family
2511
- // never throws.
2512
- "sp.fromPairs",
2513
- "sp.newChecked",
2514
- "fs.statSync",
2515
- "crypto.randomBytesToString",
2516
- "crypto.randomBytes",
2517
- "crypto.hashDigestStr",
2518
- "crypto.hashDigestBytes",
2519
- "crypto.hashNew",
2520
- "crypto.hmacNewStr",
2521
- "crypto.hmacNewBytes",
2522
- "crypto.hashUpdateStr",
2523
- "crypto.hashUpdateBytes",
2524
- "crypto.hmacUpdateStr",
2525
- "crypto.hmacUpdateBytes",
2526
- "crypto.hashCopy",
2527
- "crypto.hashDigestString",
2528
- "crypto.hashDigestBuffer",
2529
- "crypto.hmacDigestString",
2530
- "crypto.hmacDigestBuffer",
2531
- "crypto.timingSafeEqual",
2532
- "crypto.randomFill",
2533
- "crypto.randomFillRest",
2534
- "crypto.randomInt",
2535
- "crypto.pbkdf2",
2536
- "crypto.randomBytesCb",
2537
- "crypto.pbkdf2Cb",
2538
- "crypto.hkdf",
2539
- "crypto.hkdfCb",
2540
- "crypto.scrypt",
2541
- "crypto.scryptCb",
2542
- "buffer.concat",
2543
- "buffer.concatLen",
2544
- "buffer.fromDyn",
2545
- // The checked-dynamic compare/equals validators: Node's argument
2546
- // ladders throw ERR_INVALID_ARG_TYPE / ERR_OUT_OF_RANGE catchably.
2547
- "buffer.compareChk",
2548
- "bytes.equalsChk",
2549
- "bytes.compareChk",
2550
- "buffer.newStringFail",
2551
- "fs.toUnixTimestamp",
2552
- "fs.existsChk",
2553
- "fs.mkdtempChk",
2554
- "fs.mkdtempSyncChk",
2555
- "fs.readFileChk",
2556
- "fs.opendirChk",
2557
- "fs.watchFileChk",
2558
- "fs.lchmodChk",
2559
- "fs.lchmodSyncChk",
2560
- "fsp.lchmodChk",
2561
- "fs.readChk",
2562
- "fs.streamOptsChk",
2563
- "net.connectAttempt",
2564
- "net.connectOptsChk",
2565
- "net.setAutoSelTimeout",
2566
- "error.argTypeThrow",
2567
- "error.propTypeThrow",
2568
- "emitter.setMaxChk",
2569
- "emitter.setDefaultMaxChk",
2570
- "fs.readFileSyncBytes",
2571
- "fs.writeFileSyncBytes",
2572
- "fs.appendFileSyncBytes",
2573
- "zlib.inflateSync",
2574
- "zlib.inflateRawSync",
2575
- "zlib.gunzipSync",
2576
- "zlib.unzipSync",
2577
- "zlib.crc32",
2578
- "date.toISOString",
2579
- "date.toISOStringValue",
2580
- "fs.mkdirRecursiveSync",
2581
- "fs.rmOptsSync",
2582
- "fs.rmRetrySync",
2583
- "fs.mkdtempSync",
2584
- "fs.accessSync",
2585
- "fs.readFdSync",
2586
- "fs.readFdSyncBytes",
2587
- // node:dgram state errors (Node throws synchronously): bind on a bound
2588
- // socket, connect on a connected one, send/close/address on a closed or
2589
- // never-bound one.
2590
- "dgram.bind",
2591
- "dgram.bindCb",
2592
- "dgram.connect",
2593
- "dgram.connectCb",
2594
- "dgram.sendStr",
2595
- "dgram.sendBytes",
2596
- "dgram.sendChk",
2597
- "dgram.address",
2598
- "dgram.close",
2599
- "dgram.closeCb",
2600
- // The assert surface: every entry point except sameValue, bytesDeepEq,
2601
- // and the shape accumulator's begin/slot/test calls throws the
2602
- // catchable AssertionError on failure.
2603
- "assert.ok",
2604
- "assert.eqF64",
2605
- "assert.eqBigInt",
2606
- "assert.eqStr",
2607
- "assert.eqBool",
2608
- "assert.eqSym",
2609
- "assert.eqDyn",
2610
- "assert.looseResult",
2611
- "assert.deepResult",
2612
- "assert.match",
2613
- "assert.refEqBytes",
2614
- "assert.refEqFn",
2615
- "assert.throwsNone",
2616
- "assert.throwsMismatch",
2617
- "assert.throwsRegex",
2618
- "assert.shapeEnd",
2619
- "assert.unwantedRejection",
2620
- "assert.unwantedError",
2621
- "assert.noErrorPredicate",
2622
- "assert.regexDynTest",
2623
- "assert.expectsErrDyn",
2624
- "assert.ifErrorErr",
2625
- "assert.ifErrorF64",
2626
- "assert.ifErrorStr",
2627
- "assert.ifErrorBool",
2628
- "assert.ifErrorDyn",
2629
- // util.inspect of an island `any` composite: the runtime tag is all
2630
- // there is, so the honest answer is a catchable TypeError.
2631
- "insp.jsval",
2632
- // The wider sync fs slice: same catchable errno throws as the rest.
2633
- "fs.unlinkSync",
2634
- "fs.chmodSync",
2635
- "fs.chownSync",
2636
- "fs.copyFileSync",
2637
- "fs.renameSync",
2638
- "fs.lstatSync",
2639
- "fs.fstatSync",
2640
- "fs.fchmodSync",
2641
- "fs.fsyncSync",
2642
- "fs.fdatasyncSync",
2643
- "fs.ftruncateSync",
2644
- "fs.utimesSync",
2645
- "fs.futimesSync",
2646
- "fs.lutimesSync",
2647
- "fs.readvSync",
2648
- "fs.writevSync",
2649
- "fs.linkSync",
2650
- "fs.symlinkSync",
2651
- "fs.readlinkSync",
2652
- "fs.statfsSync",
2653
- "fs.readlinkSyncStr",
2654
- "fs.readlinkSyncBuffer",
2655
- "fs.writeFileModeSync",
2656
- "fs.mkdirModeSync",
2657
- "fs.mkdirRecursiveModeSync",
2658
- "fs.openSync",
2659
- "fs.openNumericSync",
2660
- "fs.readSync",
2661
- "fs.writeSync",
2662
- "fs.writeStrSync",
2663
- "fs.closeSync",
2664
- "fs.watch",
2665
- "fs.watchCb",
2666
- "crypto.x509Fingerprint",
2667
- "crypto.x509FingerprintStr",
2668
- "crypto.x509ValidFrom",
2669
- "crypto.x509ValidFromStr",
2670
- "crypto.x509ValidTo",
2671
- "crypto.x509ValidToStr",
2672
- ]);
2673
1448
  //# sourceMappingURL=ir.js.map