@scriptc/compiler 0.0.34 → 0.0.36

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 (424) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +7 -6
  2. package/dist/backend/build-cache.d.ts +44 -0
  3. package/dist/backend/build-cache.js +241 -0
  4. package/dist/backend/build-cache.js.map +1 -0
  5. package/dist/backend/{emission/emit-async.d.ts → c/async.d.ts} +21 -30
  6. package/dist/backend/{emission/emit-async.js → c/async.js} +270 -286
  7. package/dist/backend/c/async.js.map +1 -0
  8. package/dist/backend/{emission/emitter.d.ts → c/c-emitter.d.ts} +6 -23
  9. package/dist/backend/{emission/emitter.js → c/c-emitter.js} +53 -107
  10. package/dist/backend/c/c-emitter.js.map +1 -0
  11. package/dist/backend/c/exprs.d.ts +8 -0
  12. package/dist/backend/c/exprs.js +7913 -0
  13. package/dist/backend/c/exprs.js.map +1 -0
  14. package/dist/backend/{emission/emit-island.d.ts → c/island.d.ts} +5 -5
  15. package/dist/backend/{emission/emit-island.js → c/island.js} +24 -22
  16. package/dist/backend/c/island.js.map +1 -0
  17. package/dist/backend/{emission → c}/may-throw.d.ts +1 -1
  18. package/dist/backend/{emission → c}/may-throw.js +1 -1
  19. package/dist/backend/c/may-throw.js.map +1 -0
  20. package/dist/backend/{emission/emit-shapes.d.ts → c/shapes.d.ts} +19 -19
  21. package/dist/backend/{emission/emit-shapes.js → c/shapes.js} +78 -87
  22. package/dist/backend/c/shapes.js.map +1 -0
  23. package/dist/backend/{emission/emit-stmts.d.ts → c/stmts.d.ts} +12 -12
  24. package/dist/backend/{emission/emit-stmts.js → c/stmts.js} +377 -343
  25. package/dist/backend/c/stmts.js.map +1 -0
  26. package/dist/backend/{emission/emit-types.d.ts → c/types.d.ts} +1 -1
  27. package/dist/backend/{emission/emit-types.js → c/types.js} +42 -286
  28. package/dist/backend/c/types.js.map +1 -0
  29. package/dist/backend/c/types.test.js +25 -0
  30. package/dist/backend/c/types.test.js.map +1 -0
  31. package/dist/backend/{emission/emit-walkers.d.ts → c/walkers.d.ts} +19 -41
  32. package/dist/backend/{emission/emit-walkers.js → c/walkers.js} +238 -298
  33. package/dist/backend/c/walkers.js.map +1 -0
  34. package/dist/backend/ffi-callbacks.d.ts +1 -1
  35. package/dist/backend/ffi-callbacks.js +4 -3
  36. package/dist/backend/ffi-callbacks.js.map +1 -1
  37. package/dist/backend/{library-identity.d.ts → library-identity-markers.d.ts} +0 -4
  38. package/dist/backend/{library-identity.js → library-identity-markers.js} +10 -9
  39. package/dist/backend/library-identity-markers.js.map +1 -0
  40. package/dist/backend/llvm/blocks.d.ts +4 -0
  41. package/dist/backend/llvm/blocks.js +29 -0
  42. package/dist/backend/llvm/blocks.js.map +1 -1
  43. package/dist/backend/llvm/classes.d.ts +2 -19
  44. package/dist/backend/llvm/classes.js +20 -52
  45. package/dist/backend/llvm/classes.js.map +1 -1
  46. package/dist/backend/llvm/common.d.ts +4 -0
  47. package/dist/backend/llvm/common.js +27 -0
  48. package/dist/backend/llvm/common.js.map +1 -0
  49. package/dist/backend/llvm/dyn.d.ts +3 -8
  50. package/dist/backend/llvm/dyn.js +152 -224
  51. package/dist/backend/llvm/dyn.js.map +1 -1
  52. package/dist/backend/llvm/emitter.d.ts +4 -1
  53. package/dist/backend/llvm/emitter.js +514 -9981
  54. package/dist/backend/llvm/emitter.js.map +1 -1
  55. package/dist/backend/llvm/expr-async.d.ts +4 -0
  56. package/dist/backend/llvm/expr-async.js +726 -0
  57. package/dist/backend/llvm/expr-async.js.map +1 -0
  58. package/dist/backend/llvm/expr-bytes.d.ts +13 -0
  59. package/dist/backend/llvm/expr-bytes.js +456 -0
  60. package/dist/backend/llvm/expr-bytes.js.map +1 -0
  61. package/dist/backend/llvm/expr-callbacks.d.ts +22 -0
  62. package/dist/backend/llvm/expr-callbacks.js +520 -0
  63. package/dist/backend/llvm/expr-callbacks.js.map +1 -0
  64. package/dist/backend/llvm/expr-calls.d.ts +2 -0
  65. package/dist/backend/llvm/expr-calls.js +618 -0
  66. package/dist/backend/llvm/expr-calls.js.map +1 -0
  67. package/dist/backend/llvm/expr-containers.d.ts +25 -0
  68. package/dist/backend/llvm/expr-containers.js +623 -0
  69. package/dist/backend/llvm/expr-containers.js.map +1 -0
  70. package/dist/backend/llvm/expr-context.d.ts +255 -0
  71. package/dist/backend/llvm/expr-context.js +2 -0
  72. package/dist/backend/llvm/expr-context.js.map +1 -0
  73. package/dist/backend/llvm/expr-control.d.ts +2 -0
  74. package/dist/backend/llvm/expr-control.js +473 -0
  75. package/dist/backend/llvm/expr-control.js.map +1 -0
  76. package/dist/backend/llvm/expr-dispatch.d.ts +4 -0
  77. package/dist/backend/llvm/expr-dispatch.js +151 -0
  78. package/dist/backend/llvm/expr-dispatch.js.map +1 -0
  79. package/dist/backend/llvm/expr-dynamic.d.ts +2 -0
  80. package/dist/backend/llvm/expr-dynamic.js +810 -0
  81. package/dist/backend/llvm/expr-dynamic.js.map +1 -0
  82. package/dist/backend/llvm/expr-island.d.ts +15 -0
  83. package/dist/backend/llvm/expr-island.js +690 -0
  84. package/dist/backend/llvm/expr-island.js.map +1 -0
  85. package/dist/backend/llvm/expr-primitives.d.ts +6 -0
  86. package/dist/backend/llvm/expr-primitives.js +622 -0
  87. package/dist/backend/llvm/expr-primitives.js.map +1 -0
  88. package/dist/backend/llvm/expr-records.d.ts +9 -0
  89. package/dist/backend/llvm/expr-records.js +299 -0
  90. package/dist/backend/llvm/expr-records.js.map +1 -0
  91. package/dist/backend/llvm/expr-stream-bridges.d.ts +13 -0
  92. package/dist/backend/llvm/expr-stream-bridges.js +396 -0
  93. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -0
  94. package/dist/backend/llvm/expr-stream-callbacks.d.ts +12 -0
  95. package/dist/backend/llvm/expr-stream-callbacks.js +360 -0
  96. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -0
  97. package/dist/backend/llvm/lib-dispatch.d.ts +5 -0
  98. package/dist/backend/llvm/lib-dispatch.js +267 -0
  99. package/dist/backend/llvm/lib-dispatch.js.map +1 -0
  100. package/dist/backend/llvm/lib-filesystem.d.ts +6 -0
  101. package/dist/backend/llvm/lib-filesystem.js +594 -0
  102. package/dist/backend/llvm/lib-filesystem.js.map +1 -0
  103. package/dist/backend/llvm/lib-network.d.ts +2 -0
  104. package/dist/backend/llvm/lib-network.js +429 -0
  105. package/dist/backend/llvm/lib-network.js.map +1 -0
  106. package/dist/backend/llvm/lib-process.d.ts +5 -0
  107. package/dist/backend/llvm/lib-process.js +585 -0
  108. package/dist/backend/llvm/lib-process.js.map +1 -0
  109. package/dist/backend/llvm/lib-shared.d.ts +6 -0
  110. package/dist/backend/llvm/lib-shared.js +687 -0
  111. package/dist/backend/llvm/lib-shared.js.map +1 -0
  112. package/dist/backend/llvm/lib-stream.d.ts +2 -0
  113. package/dist/backend/llvm/lib-stream.js +470 -0
  114. package/dist/backend/llvm/lib-stream.js.map +1 -0
  115. package/dist/backend/llvm/shapes.d.ts +12 -2
  116. package/dist/backend/llvm/shapes.js +66 -307
  117. package/dist/backend/llvm/shapes.js.map +1 -1
  118. package/dist/backend/llvm/shapes.test.js +52 -0
  119. package/dist/backend/llvm/shapes.test.js.map +1 -0
  120. package/dist/backend/llvm/split.d.ts +43 -0
  121. package/dist/backend/llvm/split.js +227 -0
  122. package/dist/backend/llvm/split.js.map +1 -0
  123. package/dist/backend/llvm/split.test.d.ts +1 -0
  124. package/dist/backend/llvm/split.test.js +102 -0
  125. package/dist/backend/llvm/split.test.js.map +1 -0
  126. package/dist/backend/llvm/unsupported.d.ts +1 -1
  127. package/dist/backend/llvm/walkers.d.ts +2 -3
  128. package/dist/backend/llvm/walkers.js +164 -218
  129. package/dist/backend/llvm/walkers.js.map +1 -1
  130. package/dist/backend/native-codegen.d.ts +38 -0
  131. package/dist/backend/native-codegen.js +261 -0
  132. package/dist/backend/native-codegen.js.map +1 -0
  133. package/dist/backend/native-codegen.test.d.ts +1 -0
  134. package/dist/backend/native-codegen.test.js +188 -0
  135. package/dist/backend/native-codegen.test.js.map +1 -0
  136. package/dist/backend/native-link-info.d.ts +96 -0
  137. package/dist/backend/native-link-info.js +219 -0
  138. package/dist/backend/native-link-info.js.map +1 -0
  139. package/dist/backend/native-link-info.test.d.ts +1 -0
  140. package/dist/backend/native-link-info.test.js +134 -0
  141. package/dist/backend/native-link-info.test.js.map +1 -0
  142. package/dist/backend/{cc.d.ts → native-toolchain.d.ts} +139 -47
  143. package/dist/backend/{cc.js → native-toolchain.js} +1008 -910
  144. package/dist/backend/native-toolchain.js.map +1 -0
  145. package/dist/backend/native-toolchain.test.d.ts +1 -0
  146. package/dist/backend/{cc-cache.test.js → native-toolchain.test.js} +1297 -127
  147. package/dist/backend/native-toolchain.test.js.map +1 -0
  148. package/dist/backend/object-localize.js +1 -1
  149. package/dist/backend/object-localize.test.js +20 -0
  150. package/dist/backend/object-localize.test.js.map +1 -1
  151. package/dist/backend/runtime-abi.d.ts +10 -0
  152. package/dist/backend/runtime-abi.js +11 -0
  153. package/dist/backend/runtime-abi.js.map +1 -0
  154. package/dist/backend/runtime-pack.d.ts +137 -0
  155. package/dist/backend/runtime-pack.js +400 -0
  156. package/dist/backend/runtime-pack.js.map +1 -0
  157. package/dist/backend/runtime-pack.test.d.ts +1 -0
  158. package/dist/backend/runtime-pack.test.js +438 -0
  159. package/dist/backend/runtime-pack.test.js.map +1 -0
  160. package/dist/backend/targets.d.ts +30 -0
  161. package/dist/backend/targets.js +46 -0
  162. package/dist/backend/targets.js.map +1 -0
  163. package/dist/backend/targets.test.d.ts +1 -0
  164. package/dist/backend/targets.test.js +19 -0
  165. package/dist/backend/targets.test.js.map +1 -0
  166. package/dist/backend/vendor-archives.d.ts +41 -0
  167. package/dist/backend/vendor-archives.js +462 -0
  168. package/dist/backend/vendor-archives.js.map +1 -0
  169. package/dist/compat/fetch-profile.d.ts +0 -1
  170. package/dist/compat/fetch-profile.js +0 -1
  171. package/dist/compat/fetch-profile.js.map +1 -1
  172. package/dist/coverage/report.js +3 -3
  173. package/dist/coverage/report.js.map +1 -1
  174. package/dist/coverage/surface-manifest.js +25 -32
  175. package/dist/coverage/surface-manifest.js.map +1 -1
  176. package/dist/diagnostics/diagnostic.d.ts +11 -12
  177. package/dist/diagnostics/diagnostic.js +19 -17
  178. package/dist/diagnostics/diagnostic.js.map +1 -1
  179. package/dist/diagnostics/render.d.ts +1 -1
  180. package/dist/diagnostics/render.js +1 -1
  181. package/dist/diagnostics/render.js.map +1 -1
  182. package/dist/errors.d.ts +5 -0
  183. package/dist/errors.js +9 -0
  184. package/dist/errors.js.map +1 -0
  185. package/dist/executable/executable-cache.d.ts +86 -0
  186. package/dist/executable/executable-cache.js +398 -0
  187. package/dist/executable/executable-cache.js.map +1 -0
  188. package/dist/executable/executable-cache.test.d.ts +1 -0
  189. package/dist/executable/executable-cache.test.js +300 -0
  190. package/dist/executable/executable-cache.test.js.map +1 -0
  191. package/dist/ffi/{profile.d.ts → ffi-manifest.d.ts} +7 -2
  192. package/dist/ffi/{profile.js → ffi-manifest.js} +2 -1
  193. package/dist/ffi/ffi-manifest.js.map +1 -0
  194. package/dist/frontend/builtin-modules.d.ts +21 -0
  195. package/dist/frontend/builtin-modules.js +82 -0
  196. package/dist/frontend/builtin-modules.js.map +1 -0
  197. package/dist/frontend/cjs-lexer.d.ts +7 -0
  198. package/dist/frontend/cjs-lexer.js +15 -17
  199. package/dist/frontend/cjs-lexer.js.map +1 -1
  200. package/dist/frontend/dts-paths.d.ts +26 -0
  201. package/dist/frontend/dts-paths.js +41 -0
  202. package/dist/frontend/dts-paths.js.map +1 -0
  203. package/dist/frontend/input-tracker.d.ts +0 -2
  204. package/dist/frontend/input-tracker.js +1 -4
  205. package/dist/frontend/input-tracker.js.map +1 -1
  206. package/dist/frontend/lib-contract.d.ts +1 -5
  207. package/dist/frontend/lib-contract.js +1 -1
  208. package/dist/frontend/lib-contract.js.map +1 -1
  209. package/dist/frontend/lib-exports.d.ts +1 -1
  210. package/dist/frontend/lowering/call-position.d.ts +4 -0
  211. package/dist/frontend/lowering/call-position.js +7 -0
  212. package/dist/frontend/lowering/call-position.js.map +1 -0
  213. package/dist/frontend/lowering/callback-arg.d.ts +20 -0
  214. package/dist/frontend/lowering/callback-arg.js +44 -0
  215. package/dist/frontend/lowering/callback-arg.js.map +1 -0
  216. package/dist/frontend/lowering/lib-boundary.d.ts +1 -1
  217. package/dist/frontend/lowering/lib-boundary.js +34 -34
  218. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  219. package/dist/frontend/lowering/lower-assert.d.ts +3 -3
  220. package/dist/frontend/lowering/lower-assert.js +214 -241
  221. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  222. package/dist/frontend/lowering/lower-builtins.d.ts +74 -146
  223. package/dist/frontend/lowering/lower-builtins.js +1126 -1234
  224. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  225. package/dist/frontend/lowering/lower-calls.d.ts +56 -188
  226. package/dist/frontend/lowering/lower-calls.js +1409 -1494
  227. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  228. package/dist/frontend/lowering/lower-classes.d.ts +62 -125
  229. package/dist/frontend/lowering/lower-classes.js +832 -866
  230. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  231. package/dist/frontend/lowering/lower-comptime.d.ts +5 -12
  232. package/dist/frontend/lowering/lower-comptime.js +32 -31
  233. package/dist/frontend/lowering/lower-comptime.js.map +1 -1
  234. package/dist/frontend/lowering/lower-containers.d.ts +35 -135
  235. package/dist/frontend/lowering/lower-containers.js +1394 -1715
  236. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  237. package/dist/frontend/lowering/lower-dgram.d.ts +3 -7
  238. package/dist/frontend/lowering/lower-dgram.js +97 -111
  239. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  240. package/dist/frontend/lowering/lower-enums.d.ts +4 -4
  241. package/dist/frontend/lowering/lower-enums.js +30 -30
  242. package/dist/frontend/lowering/lower-enums.js.map +1 -1
  243. package/dist/frontend/lowering/{lower-emitter.d.ts → lower-event-emitter.d.ts} +7 -18
  244. package/dist/frontend/lowering/{lower-emitter.js → lower-event-emitter.js} +172 -174
  245. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -0
  246. package/dist/frontend/lowering/lower-expando.d.ts +5 -5
  247. package/dist/frontend/lowering/lower-expando.js +40 -40
  248. package/dist/frontend/lowering/lower-expando.js.map +1 -1
  249. package/dist/frontend/lowering/lower-exprs.d.ts +56 -264
  250. package/dist/frontend/lowering/lower-exprs.js +1644 -1704
  251. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  252. package/dist/frontend/lowering/lower-generators.d.ts +6 -6
  253. package/dist/frontend/lowering/lower-generators.js +73 -72
  254. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  255. package/dist/frontend/lowering/lower-inspect.d.ts +5 -17
  256. package/dist/frontend/lowering/lower-inspect.js +236 -238
  257. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  258. package/dist/frontend/lowering/lower-island.d.ts +34 -45
  259. package/dist/frontend/lowering/lower-island.js +440 -511
  260. package/dist/frontend/lowering/lower-island.js.map +1 -1
  261. package/dist/frontend/lowering/lower-mixins.d.ts +7 -10
  262. package/dist/frontend/lowering/lower-mixins.js +86 -86
  263. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  264. package/dist/frontend/lowering/lower-modules.d.ts +12 -18
  265. package/dist/frontend/lowering/lower-modules.js +284 -283
  266. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  267. package/dist/frontend/lowering/lower-namespaces.d.ts +23 -49
  268. package/dist/frontend/lowering/lower-namespaces.js +123 -115
  269. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  270. package/dist/frontend/lowering/lower-server.d.ts +18 -25
  271. package/dist/frontend/lowering/lower-server.js +899 -899
  272. package/dist/frontend/lowering/lower-server.js.map +1 -1
  273. package/dist/frontend/lowering/lower-stmts.d.ts +30 -149
  274. package/dist/frontend/lowering/lower-stmts.js +1176 -1229
  275. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  276. package/dist/frontend/lowering/lower-stream.d.ts +12 -12
  277. package/dist/frontend/lowering/lower-stream.js +300 -301
  278. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  279. package/dist/frontend/lowering/lower-test.d.ts +5 -5
  280. package/dist/frontend/lowering/lower-test.js +82 -82
  281. package/dist/frontend/lowering/lower-test.js.map +1 -1
  282. package/dist/frontend/lowering/lowerer.d.ts +66 -20
  283. package/dist/frontend/lowering/lowerer.js +421 -198
  284. package/dist/frontend/lowering/lowerer.js.map +1 -1
  285. package/dist/frontend/lowering/pairs-snapshot.d.ts +11 -0
  286. package/dist/frontend/lowering/pairs-snapshot.js +85 -0
  287. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -0
  288. package/dist/frontend/lowering/static-this.d.ts +6 -0
  289. package/dist/frontend/lowering/static-this.js +24 -0
  290. package/dist/frontend/lowering/static-this.js.map +1 -0
  291. package/dist/frontend/lowering/surfaces.d.ts +14 -33
  292. package/dist/frontend/lowering/surfaces.js +64 -64
  293. package/dist/frontend/lowering/surfaces.js.map +1 -1
  294. package/dist/frontend/npm-static-rewrite.js +6 -28
  295. package/dist/frontend/npm-static-rewrite.js.map +1 -1
  296. package/dist/frontend/npm-static.d.ts +0 -10
  297. package/dist/frontend/npm-static.js +4 -7
  298. package/dist/frontend/npm-static.js.map +1 -1
  299. package/dist/frontend/npm.d.ts +0 -24
  300. package/dist/frontend/npm.js +11 -85
  301. package/dist/frontend/npm.js.map +1 -1
  302. package/dist/frontend/program.d.ts +3 -1
  303. package/dist/frontend/program.js +51 -17
  304. package/dist/frontend/program.js.map +1 -1
  305. package/dist/frontend/provenance-registry.d.ts +0 -2
  306. package/dist/frontend/provenance-registry.js +0 -10
  307. package/dist/frontend/provenance-registry.js.map +1 -1
  308. package/dist/frontend/provenance.js +4 -7
  309. package/dist/frontend/provenance.js.map +1 -1
  310. package/dist/frontend/resolve.d.ts +7 -2
  311. package/dist/frontend/resolve.js +12 -17
  312. package/dist/frontend/resolve.js.map +1 -1
  313. package/dist/frontend/resolve.test.d.ts +1 -0
  314. package/dist/frontend/resolve.test.js +29 -0
  315. package/dist/frontend/resolve.test.js.map +1 -0
  316. package/dist/frontend/ts7/adapter.d.ts +2 -2
  317. package/dist/frontend/ts7/adapter.js +1 -1
  318. package/dist/frontend/ts7/adapter.js.map +1 -1
  319. package/dist/frontend/ts7/checker.d.ts +40 -2
  320. package/dist/frontend/ts7/checker.js +182 -54
  321. package/dist/frontend/ts7/checker.js.map +1 -1
  322. package/dist/frontend/ts7/enums.js +2 -1
  323. package/dist/frontend/ts7/enums.js.map +1 -1
  324. package/dist/frontend/ts7/{program.js → program-adapter.js} +7 -6
  325. package/dist/frontend/ts7/program-adapter.js.map +1 -0
  326. package/dist/frontend/ts7/world-check.d.ts +1 -3
  327. package/dist/frontend/ts7/world-check.js +3 -1
  328. package/dist/frontend/ts7/world-check.js.map +1 -1
  329. package/dist/frontend/tsc-codes.d.ts +8 -0
  330. package/dist/frontend/tsc-codes.js +109 -0
  331. package/dist/frontend/tsc-codes.js.map +1 -0
  332. package/dist/frontend/{types.d.ts → type-mapper.d.ts} +2 -25
  333. package/dist/frontend/{types.js → type-mapper.js} +31 -52
  334. package/dist/frontend/type-mapper.js.map +1 -0
  335. package/dist/frontend/workspace-registry.d.ts +26 -0
  336. package/dist/frontend/workspace-registry.js +71 -0
  337. package/dist/frontend/workspace-registry.js.map +1 -0
  338. package/dist/index.d.ts +115 -30
  339. package/dist/index.js +650 -146
  340. package/dist/index.js.map +1 -1
  341. package/dist/ir/analysis.d.ts +37 -0
  342. package/dist/ir/analysis.js +118 -0
  343. package/dist/ir/analysis.js.map +1 -0
  344. package/dist/ir/analysis.test.d.ts +1 -0
  345. package/dist/ir/analysis.test.js +21 -0
  346. package/dist/ir/analysis.test.js.map +1 -0
  347. package/dist/ir/build.d.ts +9 -0
  348. package/dist/ir/build.js +33 -0
  349. package/dist/ir/build.js.map +1 -0
  350. package/dist/ir/integer-loops.d.ts +1 -1
  351. package/dist/ir/{nodes.d.ts → ir.d.ts} +60 -26
  352. package/dist/ir/{nodes.js → ir.js} +173 -141
  353. package/dist/ir/ir.js.map +1 -0
  354. package/dist/ir/ir.test.d.ts +1 -0
  355. package/dist/ir/ir.test.js +17 -0
  356. package/dist/ir/ir.test.js.map +1 -0
  357. package/dist/ir/serialize.d.ts +1 -1
  358. package/dist/ir/serialize.js +2 -1
  359. package/dist/ir/serialize.js.map +1 -1
  360. package/dist/ir/validate.d.ts +1 -1
  361. package/dist/ir/validate.js +16 -5
  362. package/dist/ir/validate.js.map +1 -1
  363. package/dist/library/cache-primitives.d.ts +24 -0
  364. package/dist/library/cache-primitives.js +83 -0
  365. package/dist/library/cache-primitives.js.map +1 -0
  366. package/dist/library/cache-reset.test.d.ts +1 -0
  367. package/dist/library/cache-reset.test.js +47 -0
  368. package/dist/library/cache-reset.test.js.map +1 -0
  369. package/dist/library/compiler-self-identity.d.ts +23 -0
  370. package/dist/library/compiler-self-identity.js +84 -0
  371. package/dist/library/compiler-self-identity.js.map +1 -0
  372. package/dist/library/fence-eval.d.ts +3 -1
  373. package/dist/library/fence-eval.js +5 -1
  374. package/dist/library/fence-eval.js.map +1 -1
  375. package/dist/library/int-infer.d.ts +1 -36
  376. package/dist/library/int-infer.js +17 -17
  377. package/dist/library/int-infer.js.map +1 -1
  378. package/dist/library/{early-cache.d.ts → library-cache.d.ts} +1 -1
  379. package/dist/library/{early-cache.js → library-cache.js} +37 -111
  380. package/dist/library/library-cache.js.map +1 -0
  381. package/dist/library/library-cache.test.d.ts +1 -0
  382. package/dist/library/{early-cache.test.js → library-cache.test.js} +2 -2
  383. package/dist/library/library-cache.test.js.map +1 -0
  384. package/dist/library/{profile.d.ts → library-profile.d.ts} +4 -7
  385. package/dist/library/{profile.js → library-profile.js} +18 -11
  386. package/dist/library/library-profile.js.map +1 -0
  387. package/dist/library/semantic-source.js +2 -1
  388. package/dist/library/semantic-source.js.map +1 -1
  389. package/dist/library/sidecar.d.ts +5 -2
  390. package/dist/library/sidecar.js +11 -5
  391. package/dist/library/sidecar.js.map +1 -1
  392. package/dist/startup-cache.d.ts +6 -0
  393. package/dist/startup-cache.js +6 -0
  394. package/dist/startup-cache.js.map +1 -0
  395. package/package.json +7 -2
  396. package/surface-manifest.json +1 -1
  397. package/dist/backend/cc-cache.test.js.map +0 -1
  398. package/dist/backend/cc.js.map +0 -1
  399. package/dist/backend/emission/emit-async.js.map +0 -1
  400. package/dist/backend/emission/emit-exprs.d.ts +0 -13
  401. package/dist/backend/emission/emit-exprs.js +0 -7407
  402. package/dist/backend/emission/emit-exprs.js.map +0 -1
  403. package/dist/backend/emission/emit-island.js.map +0 -1
  404. package/dist/backend/emission/emit-shapes.js.map +0 -1
  405. package/dist/backend/emission/emit-stmts.js.map +0 -1
  406. package/dist/backend/emission/emit-types.js.map +0 -1
  407. package/dist/backend/emission/emit-walkers.js.map +0 -1
  408. package/dist/backend/emission/emitter.js.map +0 -1
  409. package/dist/backend/emission/may-throw.js.map +0 -1
  410. package/dist/backend/library-identity.js.map +0 -1
  411. package/dist/ffi/profile.js.map +0 -1
  412. package/dist/frontend/lowering/lower-emitter.js.map +0 -1
  413. package/dist/frontend/shared.d.ts +0 -82
  414. package/dist/frontend/shared.js +0 -308
  415. package/dist/frontend/shared.js.map +0 -1
  416. package/dist/frontend/ts7/program.js.map +0 -1
  417. package/dist/frontend/types.js.map +0 -1
  418. package/dist/ir/nodes.js.map +0 -1
  419. package/dist/library/early-cache.js.map +0 -1
  420. package/dist/library/early-cache.test.js.map +0 -1
  421. package/dist/library/profile.js.map +0 -1
  422. /package/dist/backend/{cc-cache.test.d.ts → c/types.test.d.ts} +0 -0
  423. /package/dist/{library/early-cache.test.d.ts → backend/llvm/shapes.test.d.ts} +0 -0
  424. /package/dist/frontend/ts7/{program.d.ts → program-adapter.d.ts} +0 -0
@@ -0,0 +1,109 @@
1
+ /** Compiler options adopted from the project during preflight. */
2
+ export const ADOPTED_OPTIONS = [
3
+ "strict",
4
+ "noImplicitAny",
5
+ "strictNullChecks",
6
+ "strictFunctionTypes",
7
+ "strictBindCallApply",
8
+ "strictPropertyInitialization",
9
+ "strictBuiltinIteratorReturn",
10
+ "noImplicitThis",
11
+ "alwaysStrict",
12
+ "useUnknownInCatchVariables",
13
+ "noUncheckedIndexedAccess",
14
+ "exactOptionalPropertyTypes",
15
+ "noImplicitOverride",
16
+ "noPropertyAccessFromIndexSignature",
17
+ "noImplicitReturns",
18
+ "noFallthroughCasesInSwitch",
19
+ "noUnusedLocals",
20
+ "noUnusedParameters",
21
+ "allowUnusedLabels",
22
+ "allowUnreachableCode",
23
+ "skipLibCheck",
24
+ // Import-form interop knobs: they only change which import FORMS
25
+ // typecheck (default imports of CJS-shaped types) — the import fence
26
+ // rejects unsupported forms with SC-diagnostics either way, and a
27
+ // SC1012 "not supported yet" beats a raw TS1259 at the same site.
28
+ "esModuleInterop",
29
+ "allowSyntheticDefaultImports",
30
+ ];
31
+ /* The JAVASCRIPT strictness stance (the JS-input design made real):
32
+ * JavaScript sources carry no annotations, so tsc's strictness families
33
+ * that exist to demand annotations — or to reject dynamically-typed
34
+ * idioms that are ordinary, working JS — cannot be satisfied by the
35
+ * program's author at all. The design already says where inference gaps
36
+ * land: exactly where `any` lands in TS (island under --dynamic, honest
37
+ * fences without). So for JS FILES ONLY, these tsc families are not
38
+ * preflight gates; the values involved stay `any`/loose and every use
39
+ * meets the lowerer's per-site fences instead. TypeScript sources keep
40
+ * the full strict gate — nothing here weakens the default for annotated
41
+ * programs. */
42
+ export const JS_RELAXED_TSC_CODES = new Set([
43
+ // implicit any (params, variables, elements, this, returns, rest,
44
+ // construct signatures, index reads over shapes with no index
45
+ // signature — typeof globalThis)
46
+ 2683, 7005, 7006, 7008, 7009, 7010, 7015, 7017, 7019, 7022, 7023, 7024, 7031, 7034, 7053,
47
+ // strict-null narrowing demands (possibly null/undefined receivers)
48
+ 2531, 2532, 2533, 18047, 18048, 18049,
49
+ // assignability/arity/callability of dynamic call shapes (valid JS,
50
+ // checked at runtime by Node; the lowerer re-checks every lowered form
51
+ // per site) and member/existence probes over dynamic shapes (expando
52
+ // properties, capability probes — the lowerer fences unknown members
53
+ // per site with the SC2020 family)
54
+ 2322, 2339, 2345, 2349, 2351, 2367, 2554, 2555, 2556, 2769,
55
+ 2740, // 2322's elaborated "missing the following properties" form
56
+ 2305, 2551, 2724, 2731,
57
+ // excess object-literal properties against a JSDoc-inferred contextual
58
+ // type (and the did-you-mean variant): ordinary, working JS — the extra
59
+ // key rides the object at runtime exactly as written (the formatter idiom's
60
+ // expand-patterns passes an ignoreUnknown member its own JSDoc type
61
+ // never declared)
62
+ 2353, 2561,
63
+ // JSDoc TYPE-SPACE claims that fail to check: a value name in a type
64
+ // position (2749/2702), generic constraints and index types spelled in
65
+ // typedefs (2344/2536/2538), an async @returns that is not Promise
66
+ // (1064), and 2366's no-ending-return against a JSDoc-declared return
67
+ // type. The claims are documentation — Node never reads them; the
68
+ // values keep their runtime behavior and every use meets the per-site
69
+ // fences (the pattern's source carries dozens of each).
70
+ 2749, 2702, 2344, 2536, 2538, 1064, 2366,
71
+ // strict-null demands on dynamic shapes, continued: iterating/invoking
72
+ // possibly-undefined values (runtime re-checks at the site)
73
+ 2488, 2721, 2722,
74
+ // an UNUSED @ts-expect-error: the directive annotated an error visible
75
+ // under the project's OWN tsconfig world — scriptc's world deliberately
76
+ // differs (adopted options, hidden declaration twins), and an unused
77
+ // suppression changes nothing at runtime
78
+ 2578,
79
+ // a lib-floor demand (es2024+ members under the es2023 lib): the member
80
+ // types as the error-any and its use fences per site with the honest
81
+ // no-lowering story instead of gating the whole program
82
+ 2550,
83
+ // `export *` ambiguity (2308): Node DEFINES this case — ambiguous names
84
+ // are excluded from the star surface — where tsc asks for an explicit
85
+ // re-export; and 2305's did-you-mean sibling 2614 joins 2305
86
+ 2308, 2614,
87
+ // 2740's sibling elaboration ("Property X is missing in type Y")
88
+ 2741,
89
+ // unresolvable modules: Node throws WHEN the require executes — the
90
+ // binding types as any and reached uses fence (never a silent pass)
91
+ 2307, 2792,
92
+ // useUnknownInCatchVariables' annotation demand ("'e' is of type
93
+ // 'unknown'", "Object is of type 'unknown'"): a JS catch clause CANNOT
94
+ // annotate its variable, so the demand is unsatisfiable in source —
95
+ // exactly the implicit-any story above. The values stay 'unknown' and
96
+ // every use meets the lowerer's per-site unknown fences (member reads
97
+ // ride the checked-dynamic tree; unsupported operations fence loudly).
98
+ 18046, 2571,
99
+ ]);
100
+ /* Arithmetic on an `any` operand (TS2362/2363/2365 fire when the other
101
+ * side is bigint-ish): plain JS — relaxed only when 'any' participates. */
102
+ export const JS_ANY_OPERATOR_CODES = new Set([2362, 2363, 2365]);
103
+ /** True for JavaScript source file NAMES (.js/.mjs/.cjs/.jsx) — the files
104
+ * whose types come entirely from inference (checkJs + JSDoc) and whose JS
105
+ * relaxation stance applies. */
106
+ export function isJsSourceFileName(fileName) {
107
+ return /\.(js|mjs|cjs|jsx)$/.test(fileName);
108
+ }
109
+ //# sourceMappingURL=tsc-codes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsc-codes.js","sourceRoot":"","sources":["../../src/frontend/tsc-codes.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ;IACR,eAAe;IACf,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;IACrB,8BAA8B;IAC9B,6BAA6B;IAC7B,gBAAgB;IAChB,cAAc;IACd,4BAA4B;IAC5B,0BAA0B;IAC1B,4BAA4B;IAC5B,oBAAoB;IACpB,oCAAoC;IACpC,mBAAmB;IACnB,4BAA4B;IAC5B,gBAAgB;IAChB,oBAAoB;IACpB,mBAAmB;IACnB,sBAAsB;IACtB,cAAc;IACd,iEAAiE;IACjE,qEAAqE;IACrE,kEAAkE;IAClE,kEAAkE;IAClE,iBAAiB;IACjB,8BAA8B;CACtB,CAAC;AAEX;;;;;;;;;;eAUe;AACf,MAAM,CAAC,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IAC/D,kEAAkE;IAClE,8DAA8D;IAC9D,iCAAiC;IACjC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IACxF,oEAAoE;IACpE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IACrC,oEAAoE;IACpE,uEAAuE;IACvE,qEAAqE;IACrE,qEAAqE;IACrE,mCAAmC;IACnC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC1D,IAAI,EAAE,4DAA4D;IAClE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IACtB,uEAAuE;IACvE,wEAAwE;IACxE,4EAA4E;IAC5E,oEAAoE;IACpE,kBAAkB;IAClB,IAAI,EAAE,IAAI;IACV,qEAAqE;IACrE,uEAAuE;IACvE,mEAAmE;IACnE,sEAAsE;IACtE,kEAAkE;IAClE,sEAAsE;IACtE,wDAAwD;IACxD,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IACxC,uEAAuE;IACvE,4DAA4D;IAC5D,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,uEAAuE;IACvE,wEAAwE;IACxE,qEAAqE;IACrE,yCAAyC;IACzC,IAAI;IACJ,wEAAwE;IACxE,qEAAqE;IACrE,wDAAwD;IACxD,IAAI;IACJ,wEAAwE;IACxE,sEAAsE;IACtE,6DAA6D;IAC7D,IAAI,EAAE,IAAI;IACV,iEAAiE;IACjE,IAAI;IACJ,oEAAoE;IACpE,oEAAoE;IACpE,IAAI,EAAE,IAAI;IACV,iEAAiE;IACjE,uEAAuE;IACvE,oEAAoE;IACpE,sEAAsE;IACtE,sEAAsE;IACtE,uEAAuE;IACvE,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC;AAEH;2EAC2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtF;;gCAEgC;AAChC,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as ts from "./ts7/adapter.js";
2
- import type { IrRecordShape, IrType, IrUnionDef } from "../ir/nodes.js";
3
- import { typeKey } from "../ir/nodes.js";
2
+ import type { IrRecordShape, IrType, IrUnionDef } from "../ir/ir.js";
3
+ import { typeKey } from "../ir/ir.js";
4
4
  export { typeKey };
5
5
  /** The ambient TYPE names of the fetch slice. Under --dynamic their
6
6
  * values live in the embedded engine and map to island handles (jsval).
@@ -158,16 +158,6 @@ export declare class UnionRegistry {
158
158
  * can't — it never sees IR types). `seen` breaks recursive shapes/unions:
159
159
  * a back-reference renders as "..." instead of expanding forever. */
160
160
  export declare function formatIrType(t: IrType, shapes: ShapeRegistry, unions: UnionRegistry, seen?: Set<string>): string;
161
- /** True when the declaration sits inside `declare module "<name>"` (or
162
- * its node:-prefixed twin) — the disambiguator for builtin-module type
163
- * names that repeat across modules (net.Server vs http.Server). Both
164
- * @types/node and the shipped fallback declare builtins this way. */
165
- /** ES OrdinaryOwnPropertyKeys order over string keys: canonical array
166
- * indices (the exact string spelling of an integer in [0, 2^32-1)) come
167
- * first in ascending numeric order, everything else follows in the given
168
- * (insertion/declaration) order. This is JS's enumeration order for the
169
- * objects records model — Object.keys, JSON.stringify, spread, inspect. */
170
- export declare function esOwnKeyOrder(names: string[]): string[];
171
161
  /** True when a type contains a record anywhere (the trigger for the
172
162
  * shape-mismatch diagnostic SC2002 — non-record mismatches are tsc's or
173
163
  * the validator's business). */
@@ -354,19 +344,6 @@ export declare function withUndefinedArm(t: IrType, unions: UnionRegistry): IrTy
354
344
  * Object.keys over such a shape omits the member (a pin — every excluded
355
345
  * member is a function the key walk would name). */
356
346
  export declare function isGenericCallableMemberType(t: ts.Type, checker: ts.TypeChecker): boolean;
357
- /** The `string | object`-family collapse domain (mapTypeInner's union
358
- * rule): arms the checked-dynamic representation holds FAITHFULLY, so a
359
- * union carrying a dyn arm beside only these maps to DYN wholesale.
360
- * Scalars and units are the checked-dynamic tree's own kinds (value-exact ===/typeof);
361
- * records and arrays qualify exactly when the dynFrom conversion can
362
- * build them (canConvertToDyn — JSON-safe data plus bytes-bearing
363
- * composites), entering as dyn data under the documented deep-copy
364
- * stance. Everything else — class instances, Maps/Sets, functions
365
- * (closure identity and `x === String` narrowing live in the typed union
366
- * machinery), promises, regexes, generators, handles, nested unions —
367
- * would DEGRADE (identity, methods, dispatch) riding dyn, so those arms
368
- * keep their existing homes and fences. */
369
- export declare function dynSubsumableUnionArm(arm: IrType, ctx: TypeMapperCtx): boolean;
370
347
  /** When an unmapped type is a SUPPORTED container/composite whose failure
371
348
  * lives in a component, answer a message tail naming the component (the
372
349
  * SC2009 story); null when the shape itself is the blocker (the caller
@@ -1,8 +1,9 @@
1
+ import { InternalCompilerError } from "../errors.js";
1
2
  import * as ts from "./ts7/adapter.js";
2
- import { arrayOf, BOOL, bytesOf, canConvertToDyn, CHILD_T, DATE_T, DYN, F64, funcOf, isSupportedIndexValue, isSupportedMapKey, isSupportedMapValue, isSupportedSetElem, isUnitType, JSVAL, mapOf, NULL_T, PROCSTREAM_T, RUNTIME_EMITTER_CLASS, RUNTIME_ERROR_CLASSES, RUNTIME_STREAM_CLASSES, setOf, STRING, SYMBOL_T, typeEquals, typeKey, UNDEFINED_T, VOID } from "../ir/nodes.js";
3
+ import { arrayOf, BOOL, bytesOf, canConvertToDyn, CHILD_T, DATE_T, DYN, F64, funcOf, isSupportedArrayElem, isSupportedIndexValue, isSupportedMapKey, isSupportedMapValue, isSupportedSetElem, isUnitType, JSVAL, mapOf, NULL_T, PROCSTREAM_T, RUNTIME_EMITTER_CLASS, RUNTIME_ERROR_CLASSES, RUNTIME_STREAM_CLASSES, setOf, STRING, SYMBOL_T, typeEquals, typeKey, UNDEFINED_T, VOID } from "../ir/ir.js";
3
4
  import { isJsSourceFile, isNodeTypesPath } from "./program.js";
4
- import { accessorSlotProp } from "../ir/nodes.js";
5
- // typeKey moved to ir/nodes.ts (the backend needs it too, for per-type
5
+ import { accessorSlotProp } from "../ir/ir.js";
6
+ // typeKey moved to ir/ir.ts (the backend needs it too, for per-type
6
7
  // helper interning); re-exported here so frontend call sites keep their
7
8
  // import path.
8
9
  export { typeKey };
@@ -226,7 +227,7 @@ export class ShapeRegistry {
226
227
  finalizeRecursive(t, fields, indexValue, declaredOrder) {
227
228
  const id = this.recIds.get(t);
228
229
  if (id === undefined)
229
- throw new Error("shape registry bug: finalizeRecursive without a placeholder");
230
+ throw new InternalCompilerError("shape registry bug: finalizeRecursive without a placeholder");
230
231
  if (this.pendingRec.has(id)) {
231
232
  const shape = this.byId.get(id);
232
233
  shape.fields = fields;
@@ -335,7 +336,7 @@ export class UnionRegistry {
335
336
  finalizeRecursive(t, arms) {
336
337
  const id = this.recIds.get(t);
337
338
  if (id === undefined)
338
- throw new Error("union registry bug: finalizeRecursive without a placeholder");
339
+ throw new InternalCompilerError("union registry bug: finalizeRecursive without a placeholder");
339
340
  if (this.pendingRec.has(id)) {
340
341
  const def = this.byId.get(id);
341
342
  def.arms.push(...arms);
@@ -512,7 +513,7 @@ export function formatIrType(t, shapes, unions, seen = new Set()) {
512
513
  default: {
513
514
  const _exhaustive = t;
514
515
  void _exhaustive;
515
- throw new Error("unreachable");
516
+ throw new InternalCompilerError("unreachable");
516
517
  }
517
518
  }
518
519
  }
@@ -525,7 +526,7 @@ export function formatIrType(t, shapes, unions, seen = new Set()) {
525
526
  * first in ascending numeric order, everything else follows in the given
526
527
  * (insertion/declaration) order. This is JS's enumeration order for the
527
528
  * objects records model — Object.keys, JSON.stringify, spread, inspect. */
528
- export function esOwnKeyOrder(names) {
529
+ function esOwnKeyOrder(names) {
529
530
  const isArrayIndex = (name) => {
530
531
  const n = Number(name);
531
532
  return Number.isInteger(n) && n >= 0 && n < 4294967295 && String(n) === name;
@@ -590,7 +591,7 @@ export function containsUnion(t) {
590
591
  return false;
591
592
  }
592
593
  }
593
- /** lower-calls.ts's bodyReadsArguments, duplicated here (types.ts must not
594
+ /** lower-calls.ts's bodyReadsArguments, duplicated here (type-mapper.ts must not
594
595
  * import from lowering/ — that edge is a module cycle): does the function's
595
596
  * OWN body read `arguments`? Nested plain functions/methods own theirs
596
597
  * (skipped); arrows see the enclosing one (descended). */
@@ -886,7 +887,7 @@ function mapTypeInner(type, ctx) {
886
887
  // falls through to the general union branch below, whose per-part
887
888
  // recursion re-enters here with the pure enum parts.
888
889
  if (flags & ts.TypeFlags.EnumLike) {
889
- const parts = widened.isUnionType() ? widened.getTypes() : [widened];
890
+ const parts = widened.isUnionType() ? ts.constituentTypes(widened) : [widened];
890
891
  if (parts.every((p) => p.flags & ts.TypeFlags.EnumLike)) {
891
892
  let hasNum = false;
892
893
  let hasStr = false;
@@ -982,35 +983,8 @@ function mapTypeInner(type, ctx) {
982
983
  // keeps its static array-of-handles representation.
983
984
  if (elem?.kind === "jsval" && !(elemTs.flags & ts.TypeFlags.Any))
984
985
  return JSVAL;
985
- // RegExp elements ride REF (scr_regex_retain_v/release_v, no trace —
986
- // a regex holds only its bytecode and source): the derived-pattern
987
- // idiom `[bases].map(ps => new RegExp(...))` builds real regex
988
- // arrays, elements flow into the regex intrinsics unchanged, and
989
- // indexOf/includes/=== are the REF kind's pointer identity — exactly
990
- // JS object identity for RegExp values.
991
- if (!elem ||
992
- elem.kind === "void" ||
993
- elem.kind === "date" ||
994
- elem.kind === "map" ||
995
- elem.kind === "set" ||
996
- elem.kind === "url" ||
997
- elem.kind === "searchParams" ||
998
- elem.kind === "stats" ||
999
- elem.kind === "fileHandle" ||
1000
- elem.kind === "spawnRes" ||
1001
- elem.kind === "netSocket" ||
1002
- elem.kind === "dgramSocket" ||
1003
- elem.kind === "testCtx" ||
1004
- elem.kind === "httpReq" ||
1005
- elem.kind === "httpRes" ||
1006
- elem.kind === "httpClientReq" ||
1007
- elem.kind === "secureCtx" ||
1008
- elem.kind === "fsWatcher" ||
1009
- elem.kind === "childStream" ||
1010
- elem.kind === "procStream" ||
1011
- elem.kind === "generator") {
1012
- return null; // ScrArr has no closure/map/regex/url element kinds yet
1013
- }
986
+ if (!elem)
987
+ return null;
1014
988
  // A dyn ELEMENT makes the WHOLE array the checked-dynamic value:
1015
989
  // `unknown[]`, `object[]`, and the collapsed `(string | object)[]`
1016
990
  // (the plugins-slot shape) — the checked-dynamic tree has real arrays, so length/
@@ -1021,6 +995,11 @@ function mapTypeInner(type, ctx) {
1021
995
  // array literal) and typed sources convert per element at the slot.
1022
996
  if (elem.kind === "dyn")
1023
997
  return DYN;
998
+ // The shared predicate is the runtime/backend storage contract. In
999
+ // particular, valid standalone values such as Map/Set/Date and opaque
1000
+ // handles do not automatically have an array element representation.
1001
+ if (!isSupportedArrayElem(elem))
1002
+ return null;
1024
1003
  // ChildProcess[] (the running-apps list) and Server[] (the [...set]
1025
1004
  // drain of the auxiliary-server registries): handles are ordinary
1026
1005
  // refcounted REF elements (their `_v` adapters, no trace — both drop
@@ -1112,7 +1091,7 @@ function mapTypeInner(type, ctx) {
1112
1091
  ]);
1113
1092
  let handle = null;
1114
1093
  let refined = true;
1115
- for (const part of widened.getTypes()) {
1094
+ for (const part of ts.constituentTypes(widened)) {
1116
1095
  const mapped = mapType(part, ctx);
1117
1096
  if (mapped && HANDLE_KINDS.has(mapped.kind)) {
1118
1097
  if (handle !== null && handle.kind !== mapped.kind) {
@@ -2295,7 +2274,7 @@ function mapTypeInner(type, ctx) {
2295
2274
  const sensitivityAtEntry = contextResolutions;
2296
2275
  try {
2297
2276
  const byKey = new Map();
2298
- for (const part of widened.getTypes()) {
2277
+ for (const part of ts.constituentTypes(widened)) {
2299
2278
  // A `void` PART is inhabited only by undefined (`Promise<void> |
2300
2279
  // void` return types, `string | void`): it becomes the undefinedT
2301
2280
  // unit arm, exactly like an undefined part — the value either
@@ -2324,7 +2303,7 @@ function mapTypeInner(type, ctx) {
2324
2303
  return JSVAL;
2325
2304
  if (!mapped) {
2326
2305
  // Before failing the whole union, let a LATER jsval part absorb.
2327
- for (const rest of widened.getTypes()) {
2306
+ for (const rest of ts.constituentTypes(widened)) {
2328
2307
  if (mapType(rest, ctx)?.kind === "jsval")
2329
2308
  return JSVAL;
2330
2309
  }
@@ -2442,13 +2421,13 @@ function mapNarrowedTypeParam(type, ctx) {
2442
2421
  return (allowNull = true);
2443
2422
  // A companion UNION (`T & ({} | null)`): each part is an allowance.
2444
2423
  if (c.isUnionType())
2445
- return c.getTypes().every(visitCompanion);
2424
+ return ts.constituentTypes(c).every(visitCompanion);
2446
2425
  return false;
2447
2426
  };
2448
2427
  const visitPart = (part) => {
2449
2428
  if (!part.isIntersectionType())
2450
2429
  return false;
2451
- for (const p of part.getTypes()) {
2430
+ for (const p of ts.constituentTypes(part)) {
2452
2431
  if (p.flags & ts.TypeFlags.TypeParameter) {
2453
2432
  if (tp && tp !== p)
2454
2433
  return false; // two different parameters: not this pattern
@@ -2460,7 +2439,7 @@ function mapNarrowedTypeParam(type, ctx) {
2460
2439
  }
2461
2440
  return true;
2462
2441
  };
2463
- const parts = type.isUnionType() ? type.getTypes() : [type];
2442
+ const parts = type.isUnionType() ? ts.constituentTypes(type) : [type];
2464
2443
  if (!parts.every(visitPart) || !tp)
2465
2444
  return undefined;
2466
2445
  const bound = resolveTypeParam(tp);
@@ -2765,7 +2744,7 @@ export function genResultRecord(yieldT, retT, shapes, unions) {
2765
2744
  * a value). */
2766
2745
  export function isUnitOnlyTsType(t) {
2767
2746
  const UNIT = ts.TypeFlags.Undefined | ts.TypeFlags.Void | ts.TypeFlags.Null;
2768
- const parts = t.isUnionType() ? t.getTypes() : [t];
2747
+ const parts = t.isUnionType() ? ts.constituentTypes(t) : [t];
2769
2748
  return parts.every((p) => (p.flags & UNIT) !== 0);
2770
2749
  }
2771
2750
  /** IR-level `t | undefined`, canonicalized and fenced exactly like the
@@ -2814,7 +2793,7 @@ function mapHybridCallableIntersection(widened, ctx) {
2814
2793
  if (checker.getCallSignatures(widened).length !== 1)
2815
2794
  return null;
2816
2795
  let funcPart = null;
2817
- for (const part of widened.getTypes()) {
2796
+ for (const part of ts.constituentTypes(widened)) {
2818
2797
  if (checker.getCallSignatures(part).length > 0) {
2819
2798
  if (funcPart)
2820
2799
  return null; // exactly one callable part
@@ -2872,7 +2851,7 @@ function isMappedShape(t) {
2872
2851
  function recordProvenanceOk(t, ctx) {
2873
2852
  const { checker } = ctx;
2874
2853
  if (t.isIntersectionType()) {
2875
- return t.getTypes().every((part) => {
2854
+ return ts.constituentTypes(t).every((part) => {
2876
2855
  const partSym = part.getSymbol();
2877
2856
  return (part.flags & ts.TypeFlags.Object) !== 0 &&
2878
2857
  !(partSym && partSym.flags & ts.SymbolFlags.Class) &&
@@ -2999,7 +2978,7 @@ function mapRecordTypeInner(widened, ctx) {
2999
2978
  if (indexInfos.length > 0) {
3000
2979
  const stringKey = (k) => (k.flags & ts.TypeFlags.String) !== 0 ||
3001
2980
  (k.isIntersectionType() &&
3002
- k.getTypes().every((p) => (p.flags & ts.TypeFlags.String) !== 0 ||
2981
+ ts.constituentTypes(k).every((p) => (p.flags & ts.TypeFlags.String) !== 0 ||
3003
2982
  ((p.flags & ts.TypeFlags.Object) !== 0 &&
3004
2983
  checker.getPropertiesOfType(p).length === 0 &&
3005
2984
  checker.getCallSignatures(p).length === 0 &&
@@ -3123,7 +3102,7 @@ function mapRecordTypeInner(widened, ctx) {
3123
3102
  // OBJECT-LITERAL get/set accessors (TS sources): the property has
3124
3103
  // no data slot — the shape carries reserved closure fields instead
3125
3104
  // (`%get:x` invoked per read, `%set:x` per write; see
3126
- // accessorSlotProp in ir/nodes.ts). Type-literal and interface
3105
+ // accessorSlotProp in ir/ir.ts). Type-literal and interface
3127
3106
  // accessor MEMBERS map the same way so accessor records cross
3128
3107
  // annotated boundaries (`function f(p: { get x(): number })`) —
3129
3108
  // tsc lets a plain DATA property satisfy such a member, but the
@@ -3283,7 +3262,7 @@ const STDLIB_CONTAINERS = {
3283
3262
  * machinery), promises, regexes, generators, handles, nested unions —
3284
3263
  * would DEGRADE (identity, methods, dispatch) riding dyn, so those arms
3285
3264
  * keep their existing homes and fences. */
3286
- export function dynSubsumableUnionArm(arm, ctx) {
3265
+ function dynSubsumableUnionArm(arm, ctx) {
3287
3266
  switch (arm.kind) {
3288
3267
  case "dyn":
3289
3268
  case "f64":
@@ -3392,7 +3371,7 @@ export function describeComponentBlocker(widened, ctx) {
3392
3371
  // arm kind with no union home. Unions have no symbol, so a null answer
3393
3372
  // falls through to the residual fence, never to a false lib claim.
3394
3373
  if (widened.isUnionType()) {
3395
- const parts = widened.getTypes();
3374
+ const parts = ts.constituentTypes(widened);
3396
3375
  const UNIT = ts.TypeFlags.Undefined | ts.TypeFlags.Void | ts.TypeFlags.Null;
3397
3376
  const dataArms = parts.filter((p) => (p.flags & UNIT) === 0);
3398
3377
  // A union carrying an 'object'/'unknown'-flavored arm rides the
@@ -3505,4 +3484,4 @@ export function describeRecordMemberBlocker(widened, ctx) {
3505
3484
  }
3506
3485
  return null;
3507
3486
  }
3508
- //# sourceMappingURL=types.js.map
3487
+ //# sourceMappingURL=type-mapper.js.map