@scriptc/compiler 0.2.7 → 0.2.8

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 (385) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +2 -0
  2. package/dist/backend/llvm/alloc.d.ts +3 -0
  3. package/dist/backend/llvm/alloc.js +54 -13
  4. package/dist/backend/llvm/alloc.js.map +1 -1
  5. package/dist/backend/llvm/blocks.d.ts +9 -0
  6. package/dist/backend/llvm/blocks.js +9 -0
  7. package/dist/backend/llvm/blocks.js.map +1 -1
  8. package/dist/backend/llvm/borrowed-receivers.d.ts +7 -0
  9. package/dist/backend/llvm/borrowed-receivers.js +39 -0
  10. package/dist/backend/llvm/borrowed-receivers.js.map +1 -1
  11. package/dist/backend/llvm/call-lifetimes.d.ts +4 -1
  12. package/dist/backend/llvm/call-lifetimes.js +14 -3
  13. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  14. package/dist/backend/llvm/call-lifetimes.test.js +8 -3
  15. package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
  16. package/dist/backend/llvm/checked-narrows.d.ts +24 -0
  17. package/dist/backend/llvm/checked-narrows.js +108 -0
  18. package/dist/backend/llvm/checked-narrows.js.map +1 -0
  19. package/dist/backend/llvm/checked-narrows.test.d.ts +1 -0
  20. package/dist/backend/llvm/checked-narrows.test.js +208 -0
  21. package/dist/backend/llvm/checked-narrows.test.js.map +1 -0
  22. package/dist/backend/llvm/classes.d.ts +13 -1
  23. package/dist/backend/llvm/classes.js +26 -18
  24. package/dist/backend/llvm/classes.js.map +1 -1
  25. package/dist/backend/llvm/classes.test.js +32 -3
  26. package/dist/backend/llvm/classes.test.js.map +1 -1
  27. package/dist/backend/llvm/debug-info.d.ts +6 -2
  28. package/dist/backend/llvm/debug-info.js +11 -1
  29. package/dist/backend/llvm/debug-info.js.map +1 -1
  30. package/dist/backend/llvm/dense-array-access.test.js +89 -0
  31. package/dist/backend/llvm/dense-array-access.test.js.map +1 -1
  32. package/dist/backend/llvm/dyn.d.ts +4 -0
  33. package/dist/backend/llvm/dyn.js +31 -20
  34. package/dist/backend/llvm/dyn.js.map +1 -1
  35. package/dist/backend/llvm/emitter.d.ts +184 -11
  36. package/dist/backend/llvm/emitter.js +1189 -125
  37. package/dist/backend/llvm/emitter.js.map +1 -1
  38. package/dist/backend/llvm/emitter.test.js +21 -1
  39. package/dist/backend/llvm/emitter.test.js.map +1 -1
  40. package/dist/backend/llvm/expr-async.js +4 -4
  41. package/dist/backend/llvm/expr-async.js.map +1 -1
  42. package/dist/backend/llvm/expr-bytes.d.ts +1 -1
  43. package/dist/backend/llvm/expr-bytes.js +85 -8
  44. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  45. package/dist/backend/llvm/expr-callbacks.js +29 -21
  46. package/dist/backend/llvm/expr-callbacks.js.map +1 -1
  47. package/dist/backend/llvm/expr-calls.d.ts +5 -0
  48. package/dist/backend/llvm/expr-calls.js +55 -10
  49. package/dist/backend/llvm/expr-calls.js.map +1 -1
  50. package/dist/backend/llvm/expr-containers.d.ts +7 -1
  51. package/dist/backend/llvm/expr-containers.js +230 -27
  52. package/dist/backend/llvm/expr-containers.js.map +1 -1
  53. package/dist/backend/llvm/expr-control.js +25 -10
  54. package/dist/backend/llvm/expr-control.js.map +1 -1
  55. package/dist/backend/llvm/expr-dynamic.js +72 -21
  56. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  57. package/dist/backend/llvm/expr-island.js +3 -8
  58. package/dist/backend/llvm/expr-island.js.map +1 -1
  59. package/dist/backend/llvm/expr-primitives.js +41 -12
  60. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  61. package/dist/backend/llvm/expr-primitives.test.js +50 -2
  62. package/dist/backend/llvm/expr-primitives.test.js.map +1 -1
  63. package/dist/backend/llvm/expr-records.js +28 -14
  64. package/dist/backend/llvm/expr-records.js.map +1 -1
  65. package/dist/backend/llvm/expr-stream-bridges.js +41 -31
  66. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  67. package/dist/backend/llvm/expr-stream-callbacks.js +6 -3
  68. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
  69. package/dist/backend/llvm/layouts.d.ts +2 -1
  70. package/dist/backend/llvm/layouts.js +2 -2
  71. package/dist/backend/llvm/layouts.js.map +1 -1
  72. package/dist/backend/llvm/lib-abi.js +10 -0
  73. package/dist/backend/llvm/lib-abi.js.map +1 -1
  74. package/dist/backend/llvm/lib-filesystem.js +7 -11
  75. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  76. package/dist/backend/llvm/lib-process.js +8 -8
  77. package/dist/backend/llvm/lib-process.js.map +1 -1
  78. package/dist/backend/llvm/lib-shared.js +1 -0
  79. package/dist/backend/llvm/lib-shared.js.map +1 -1
  80. package/dist/backend/llvm/local-array-reads.js +73 -13
  81. package/dist/backend/llvm/local-array-reads.js.map +1 -1
  82. package/dist/backend/llvm/local-array-reads.test.js +7 -3
  83. package/dist/backend/llvm/local-array-reads.test.js.map +1 -1
  84. package/dist/backend/llvm/local-union-storage.js +10 -6
  85. package/dist/backend/llvm/local-union-storage.js.map +1 -1
  86. package/dist/backend/llvm/local-union-storage.test.js +3 -2
  87. package/dist/backend/llvm/local-union-storage.test.js.map +1 -1
  88. package/dist/backend/llvm/map-number-lookup.d.ts +18 -0
  89. package/dist/backend/llvm/map-number-lookup.js +62 -0
  90. package/dist/backend/llvm/map-number-lookup.js.map +1 -0
  91. package/dist/backend/llvm/map-read-lifetimes.d.ts +6 -0
  92. package/dist/backend/llvm/map-read-lifetimes.js +24 -3
  93. package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
  94. package/dist/backend/llvm/map-read-lifetimes.test.js +38 -19
  95. package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
  96. package/dist/backend/llvm/nullable-unions.d.ts +68 -0
  97. package/dist/backend/llvm/nullable-unions.js +132 -0
  98. package/dist/backend/llvm/nullable-unions.js.map +1 -0
  99. package/dist/backend/llvm/publish.d.ts +58 -0
  100. package/dist/backend/llvm/publish.js +286 -0
  101. package/dist/backend/llvm/publish.js.map +1 -0
  102. package/dist/backend/llvm/rebound-parameters.d.ts +12 -0
  103. package/dist/backend/llvm/rebound-parameters.js +72 -0
  104. package/dist/backend/llvm/rebound-parameters.js.map +1 -0
  105. package/dist/backend/llvm/rebound-parameters.test.d.ts +1 -0
  106. package/dist/backend/llvm/rebound-parameters.test.js +67 -0
  107. package/dist/backend/llvm/rebound-parameters.test.js.map +1 -0
  108. package/dist/backend/llvm/reference-effects.d.ts +18 -2
  109. package/dist/backend/llvm/reference-effects.js +106 -16
  110. package/dist/backend/llvm/reference-effects.js.map +1 -1
  111. package/dist/backend/llvm/reference-effects.test.js +52 -1
  112. package/dist/backend/llvm/reference-effects.test.js.map +1 -1
  113. package/dist/backend/llvm/shapes.d.ts +45 -17
  114. package/dist/backend/llvm/shapes.js +131 -53
  115. package/dist/backend/llvm/shapes.js.map +1 -1
  116. package/dist/backend/llvm/shapes.test.js +33 -8
  117. package/dist/backend/llvm/shapes.test.js.map +1 -1
  118. package/dist/backend/llvm/stack-unions.test.js +5 -2
  119. package/dist/backend/llvm/stack-unions.test.js.map +1 -1
  120. package/dist/backend/llvm/string-construction.d.ts +10 -0
  121. package/dist/backend/llvm/string-construction.js +42 -0
  122. package/dist/backend/llvm/string-construction.js.map +1 -1
  123. package/dist/backend/llvm/string-key-hash.d.ts +9 -2
  124. package/dist/backend/llvm/string-key-hash.js +20 -3
  125. package/dist/backend/llvm/string-key-hash.js.map +1 -1
  126. package/dist/backend/llvm/string-key-hash.test.js +14 -3
  127. package/dist/backend/llvm/string-key-hash.test.js.map +1 -1
  128. package/dist/backend/llvm/string-lifetimes.test.js +24 -11
  129. package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
  130. package/dist/backend/llvm/string-reads.d.ts +7 -0
  131. package/dist/backend/llvm/string-reads.js +76 -0
  132. package/dist/backend/llvm/string-reads.js.map +1 -0
  133. package/dist/backend/llvm/switch-dispatch.test.js +1 -1
  134. package/dist/backend/llvm/switch-dispatch.test.js.map +1 -1
  135. package/dist/backend/llvm/test-boxed-unions.d.ts +5 -0
  136. package/dist/backend/llvm/test-boxed-unions.js +13 -0
  137. package/dist/backend/llvm/test-boxed-unions.js.map +1 -0
  138. package/dist/backend/llvm/union-repr.d.ts +15 -0
  139. package/dist/backend/llvm/union-repr.js +89 -0
  140. package/dist/backend/llvm/union-repr.js.map +1 -0
  141. package/dist/backend/llvm/virtual-borrows.d.ts +31 -0
  142. package/dist/backend/llvm/virtual-borrows.js +82 -0
  143. package/dist/backend/llvm/virtual-borrows.js.map +1 -0
  144. package/dist/backend/llvm/walk-borrows.d.ts +43 -0
  145. package/dist/backend/llvm/walk-borrows.js +150 -0
  146. package/dist/backend/llvm/walk-borrows.js.map +1 -0
  147. package/dist/backend/llvm/walk-borrows.test.d.ts +1 -0
  148. package/dist/backend/llvm/walk-borrows.test.js +119 -0
  149. package/dist/backend/llvm/walk-borrows.test.js.map +1 -0
  150. package/dist/backend/llvm/walkers.d.ts +5 -1
  151. package/dist/backend/llvm/walkers.js +24 -21
  152. package/dist/backend/llvm/walkers.js.map +1 -1
  153. package/dist/backend/may-throw.d.ts +29 -1
  154. package/dist/backend/may-throw.js +346 -3
  155. package/dist/backend/may-throw.js.map +1 -1
  156. package/dist/backend/may-throw.test.js +113 -1
  157. package/dist/backend/may-throw.test.js.map +1 -1
  158. package/dist/backend/native/runtime-inputs.d.ts +1 -1
  159. package/dist/backend/native/runtime-inputs.js +1 -0
  160. package/dist/backend/native/runtime-inputs.js.map +1 -1
  161. package/dist/backend/native-codegen-core.d.ts +7 -5
  162. package/dist/backend/native-codegen-core.js +14 -9
  163. package/dist/backend/native-codegen-core.js.map +1 -1
  164. package/dist/backend/native-codegen.d.ts +4 -0
  165. package/dist/backend/native-codegen.js +49 -2
  166. package/dist/backend/native-codegen.js.map +1 -1
  167. package/dist/backend/native-codegen.test.js +41 -10
  168. package/dist/backend/native-codegen.test.js.map +1 -1
  169. package/dist/backend/native-tools.d.ts +2 -0
  170. package/dist/backend/native-tools.js +3 -0
  171. package/dist/backend/native-tools.js.map +1 -1
  172. package/dist/backend/publication.d.ts +28 -0
  173. package/dist/backend/publication.js +155 -0
  174. package/dist/backend/publication.js.map +1 -0
  175. package/dist/backend/publication.test.d.ts +1 -0
  176. package/dist/backend/publication.test.js +72 -0
  177. package/dist/backend/publication.test.js.map +1 -0
  178. package/dist/backend/runtime-abi.d.ts +2 -2
  179. package/dist/backend/runtime-abi.js +2 -2
  180. package/dist/backend/runtime-pack-targets.test.js +1 -1
  181. package/dist/backend/runtime-pack.test.js +1 -1
  182. package/dist/cli/command.js +70 -7
  183. package/dist/cli/command.js.map +1 -1
  184. package/dist/cli/usage.d.ts +4 -1
  185. package/dist/cli/usage.js +8 -1
  186. package/dist/cli/usage.js.map +1 -1
  187. package/dist/compile-types.d.ts +12 -3
  188. package/dist/coverage/report.d.ts +25 -2
  189. package/dist/coverage/report.js +161 -33
  190. package/dist/coverage/report.js.map +1 -1
  191. package/dist/coverage/verdict-cache.d.ts +63 -0
  192. package/dist/coverage/verdict-cache.js +193 -0
  193. package/dist/coverage/verdict-cache.js.map +1 -0
  194. package/dist/coverage/verdict-cache.test.d.ts +1 -0
  195. package/dist/coverage/verdict-cache.test.js +52 -0
  196. package/dist/coverage/verdict-cache.test.js.map +1 -0
  197. package/dist/coverage/verdict-semantic.d.ts +2 -0
  198. package/dist/coverage/verdict-semantic.js +24 -0
  199. package/dist/coverage/verdict-semantic.js.map +1 -0
  200. package/dist/coverage/verdict-startup.d.ts +15 -0
  201. package/dist/coverage/verdict-startup.js +66 -0
  202. package/dist/coverage/verdict-startup.js.map +1 -0
  203. package/dist/diagnostics/diagnostic.d.ts +29 -1
  204. package/dist/diagnostics/diagnostic.js +74 -4
  205. package/dist/diagnostics/diagnostic.js.map +1 -1
  206. package/dist/diagnostics/envelope.d.ts +130 -0
  207. package/dist/diagnostics/envelope.js +257 -0
  208. package/dist/diagnostics/envelope.js.map +1 -0
  209. package/dist/diagnostics/envelope.test.d.ts +1 -0
  210. package/dist/diagnostics/envelope.test.js +91 -0
  211. package/dist/diagnostics/envelope.test.js.map +1 -0
  212. package/dist/diagnostics/render.d.ts +3 -0
  213. package/dist/diagnostics/render.js +13 -2
  214. package/dist/diagnostics/render.js.map +1 -1
  215. package/dist/executable/prepare.d.ts +4 -0
  216. package/dist/executable/prepare.js +7 -1
  217. package/dist/executable/prepare.js.map +1 -1
  218. package/dist/frontend/analysis.js +1 -0
  219. package/dist/frontend/analysis.js.map +1 -1
  220. package/dist/frontend/lowering/array-values.d.ts +7 -0
  221. package/dist/frontend/lowering/array-values.js +120 -4
  222. package/dist/frontend/lowering/array-values.js.map +1 -1
  223. package/dist/frontend/lowering/builtins/numbers.js +29 -1
  224. package/dist/frontend/lowering/builtins/numbers.js.map +1 -1
  225. package/dist/frontend/lowering/builtins/process.d.ts +4 -0
  226. package/dist/frontend/lowering/builtins/process.js +10 -0
  227. package/dist/frontend/lowering/builtins/process.js.map +1 -1
  228. package/dist/frontend/lowering/builtins/workers.js +4 -2
  229. package/dist/frontend/lowering/builtins/workers.js.map +1 -1
  230. package/dist/frontend/lowering/class-assertions.d.ts +8 -0
  231. package/dist/frontend/lowering/class-assertions.js +217 -1
  232. package/dist/frontend/lowering/class-assertions.js.map +1 -1
  233. package/dist/frontend/lowering/class-dynamic-dispatch.js +8 -5
  234. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  235. package/dist/frontend/lowering/coercions/state.d.ts +6 -0
  236. package/dist/frontend/lowering/coercions/state.js +2 -0
  237. package/dist/frontend/lowering/coercions/state.js.map +1 -1
  238. package/dist/frontend/lowering/coercions/unions.d.ts +8 -0
  239. package/dist/frontend/lowering/coercions/unions.js +67 -2
  240. package/dist/frontend/lowering/coercions/unions.js.map +1 -1
  241. package/dist/frontend/lowering/collation-repertoire.d.ts +1 -0
  242. package/dist/frontend/lowering/collation-repertoire.js +19 -0
  243. package/dist/frontend/lowering/collation-repertoire.js.map +1 -0
  244. package/dist/frontend/lowering/construction-escapes.d.ts +38 -0
  245. package/dist/frontend/lowering/construction-escapes.js +146 -0
  246. package/dist/frontend/lowering/construction-escapes.js.map +1 -0
  247. package/dist/frontend/lowering/construction-escapes.test.d.ts +1 -0
  248. package/dist/frontend/lowering/construction-escapes.test.js +150 -0
  249. package/dist/frontend/lowering/construction-escapes.test.js.map +1 -0
  250. package/dist/frontend/lowering/containers/array-callbacks.js +81 -44
  251. package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -1
  252. package/dist/frontend/lowering/containers/array-construction.js +15 -2
  253. package/dist/frontend/lowering/containers/array-construction.js.map +1 -1
  254. package/dist/frontend/lowering/containers/array-methods.js +231 -12
  255. package/dist/frontend/lowering/containers/array-methods.js.map +1 -1
  256. package/dist/frontend/lowering/containers/callback-arguments.js +43 -1
  257. package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -1
  258. package/dist/frontend/lowering/containers/string-and-regexp.js +7 -63
  259. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  260. package/dist/frontend/lowering/cycle-initialization.d.ts +6 -1
  261. package/dist/frontend/lowering/cycle-initialization.js +59 -33
  262. package/dist/frontend/lowering/cycle-initialization.js.map +1 -1
  263. package/dist/frontend/lowering/divergences.d.ts +9 -0
  264. package/dist/frontend/lowering/divergences.js +630 -0
  265. package/dist/frontend/lowering/divergences.js.map +1 -0
  266. package/dist/frontend/lowering/expressions/object-literals.js +40 -2
  267. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  268. package/dist/frontend/lowering/lower-calls.d.ts +5 -0
  269. package/dist/frontend/lowering/lower-calls.js +226 -157
  270. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  271. package/dist/frontend/lowering/lower-classes.d.ts +4 -0
  272. package/dist/frontend/lowering/lower-classes.js +72 -22
  273. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  274. package/dist/frontend/lowering/lower-exprs.d.ts +13 -0
  275. package/dist/frontend/lowering/lower-exprs.js +431 -107
  276. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  277. package/dist/frontend/lowering/lower-generators.d.ts +19 -13
  278. package/dist/frontend/lowering/lower-generators.js +67 -44
  279. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  280. package/dist/frontend/lowering/lower-inspect.js +3 -2
  281. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  282. package/dist/frontend/lowering/lower-island.d.ts +1 -1
  283. package/dist/frontend/lowering/lower-island.js +24 -7
  284. package/dist/frontend/lowering/lower-island.js.map +1 -1
  285. package/dist/frontend/lowering/lower-modules.js +90 -1
  286. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  287. package/dist/frontend/lowering/lower-stmts.js +36 -6
  288. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  289. package/dist/frontend/lowering/lowerer.d.ts +78 -2
  290. package/dist/frontend/lowering/lowerer.js +986 -73
  291. package/dist/frontend/lowering/lowerer.js.map +1 -1
  292. package/dist/frontend/lowering/runtime-optional-bounds.d.ts +19 -0
  293. package/dist/frontend/lowering/runtime-optional-bounds.js +354 -0
  294. package/dist/frontend/lowering/runtime-optional-bounds.js.map +1 -0
  295. package/dist/frontend/lowering/runtime-optional-bounds.test.d.ts +1 -0
  296. package/dist/frontend/lowering/runtime-optional-bounds.test.js +66 -0
  297. package/dist/frontend/lowering/runtime-optional-bounds.test.js.map +1 -0
  298. package/dist/frontend/lowering/runtime-optional-elements.d.ts +117 -0
  299. package/dist/frontend/lowering/runtime-optional-elements.js +738 -0
  300. package/dist/frontend/lowering/runtime-optional-elements.js.map +1 -0
  301. package/dist/frontend/lowering/runtime-optional-guards.d.ts +36 -0
  302. package/dist/frontend/lowering/runtime-optional-guards.js +375 -0
  303. package/dist/frontend/lowering/runtime-optional-guards.js.map +1 -0
  304. package/dist/frontend/lowering/runtime-optional-guards.test.d.ts +1 -0
  305. package/dist/frontend/lowering/runtime-optional-guards.test.js +92 -0
  306. package/dist/frontend/lowering/runtime-optional-guards.test.js.map +1 -0
  307. package/dist/frontend/lowering/runtime-optional-ownership.d.ts +63 -0
  308. package/dist/frontend/lowering/runtime-optional-ownership.js +382 -0
  309. package/dist/frontend/lowering/runtime-optional-ownership.js.map +1 -0
  310. package/dist/frontend/lowering/runtime-optional-provenance.d.ts +2 -1
  311. package/dist/frontend/lowering/runtime-optional-provenance.js +2 -1
  312. package/dist/frontend/lowering/runtime-optional-provenance.js.map +1 -1
  313. package/dist/frontend/lowering/string-index-bounds.d.ts +36 -0
  314. package/dist/frontend/lowering/string-index-bounds.js +537 -0
  315. package/dist/frontend/lowering/string-index-bounds.js.map +1 -0
  316. package/dist/frontend/lowering/string-index-bounds.test.d.ts +1 -0
  317. package/dist/frontend/lowering/string-index-bounds.test.js +223 -0
  318. package/dist/frontend/lowering/string-index-bounds.test.js.map +1 -0
  319. package/dist/frontend/lowering/union-narrow.d.ts +2 -0
  320. package/dist/frontend/lowering/union-narrow.js +10 -6
  321. package/dist/frontend/lowering/union-narrow.js.map +1 -1
  322. package/dist/frontend/program-analysis.d.ts +10 -0
  323. package/dist/frontend/program-analysis.js +7 -0
  324. package/dist/frontend/program-analysis.js.map +1 -1
  325. package/dist/frontend/program.d.ts +25 -0
  326. package/dist/frontend/program.js +613 -17
  327. package/dist/frontend/program.js.map +1 -1
  328. package/dist/frontend/program.test.js +64 -1
  329. package/dist/frontend/program.test.js.map +1 -1
  330. package/dist/frontend/resolve.d.ts +6 -0
  331. package/dist/frontend/resolve.js +14 -0
  332. package/dist/frontend/resolve.js.map +1 -1
  333. package/dist/frontend/threads-import.d.ts +5 -0
  334. package/dist/frontend/threads-import.js +21 -0
  335. package/dist/frontend/threads-import.js.map +1 -0
  336. package/dist/frontend/type-mapper.d.ts +3 -0
  337. package/dist/frontend/type-mapper.js +72 -6
  338. package/dist/frontend/type-mapper.js.map +1 -1
  339. package/dist/frontend/worker-target.d.ts +4 -0
  340. package/dist/frontend/worker-target.js +8 -1
  341. package/dist/frontend/worker-target.js.map +1 -1
  342. package/dist/index.d.ts +6 -1
  343. package/dist/index.js +47 -9
  344. package/dist/index.js.map +1 -1
  345. package/dist/ir/build.d.ts +5 -0
  346. package/dist/ir/build.js +7 -0
  347. package/dist/ir/build.js.map +1 -1
  348. package/dist/ir/builtin-signatures.d.ts +1 -1
  349. package/dist/ir/builtin-signatures.js +3 -0
  350. package/dist/ir/builtin-signatures.js.map +1 -1
  351. package/dist/ir/int32-slots.d.ts +72 -0
  352. package/dist/ir/int32-slots.js +837 -0
  353. package/dist/ir/int32-slots.js.map +1 -0
  354. package/dist/ir/int32-slots.test.d.ts +1 -0
  355. package/dist/ir/int32-slots.test.js +222 -0
  356. package/dist/ir/int32-slots.test.js.map +1 -0
  357. package/dist/ir/integer-ranges.d.ts +19 -3
  358. package/dist/ir/integer-ranges.js +168 -23
  359. package/dist/ir/integer-ranges.js.map +1 -1
  360. package/dist/ir/integer-ranges.test.js +74 -2
  361. package/dist/ir/integer-ranges.test.js.map +1 -1
  362. package/dist/ir/ir.d.ts +24 -6
  363. package/dist/ir/ir.js.map +1 -1
  364. package/dist/ir/validate.js +21 -2
  365. package/dist/ir/validate.js.map +1 -1
  366. package/dist/ir/validate.test.js +39 -0
  367. package/dist/ir/validate.test.js.map +1 -1
  368. package/dist/native/cache.d.ts +3 -0
  369. package/dist/native/cache.js +49 -1
  370. package/dist/native/cache.js.map +1 -1
  371. package/dist/native/cache.test.js +21 -1
  372. package/dist/native/cache.test.js.map +1 -1
  373. package/dist/native/cli.js +1 -1
  374. package/dist/native/cli.js.map +1 -1
  375. package/dist/native/compiler.d.ts +5 -0
  376. package/dist/native/compiler.js +51 -4
  377. package/dist/native/compiler.js.map +1 -1
  378. package/dist/native/prepare.d.ts +4 -0
  379. package/dist/native/prepare.js +2 -1
  380. package/dist/native/prepare.js.map +1 -1
  381. package/dist/startup-cache.d.ts +2 -0
  382. package/dist/startup-cache.js +2 -0
  383. package/dist/startup-cache.js.map +1 -1
  384. package/package.json +20 -20
  385. package/surface-manifest.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import { type CycleInitFlag } from "./cycle-initialization.js";
2
2
  import type { FieldLift } from "./coercions/structural-plans.js";
3
3
  import { CoercionState } from "./coercions/state.js";
4
+ import { StringIndexBounds } from "./string-index-bounds.js";
4
5
  import { RuntimeOptionalLocals } from "./runtime-optional-locals.js";
5
6
  import type { WidthLift } from "./width-lift.js";
6
7
  import { type FnCtx } from "./function-context.js";
@@ -77,6 +78,11 @@ export declare function boundIdentifiersOf(name: ts.BindingName): ts.Identifier[
77
78
  /** Inspect executable children directly, without boxing the statement tree
78
79
  * into checked-dynamic storage just to calculate coverage. */
79
80
  export declare function stmtUsesIsland(stmts: IrStmt | IrStmt[]): boolean;
81
+ /** Statements a never-lowered body would have contributed to the coverage
82
+ * totals: every element of a statement list (blocks, case clauses), plus
83
+ * the single-statement bodies of control flow, nested functions included —
84
+ * the same accounting lowerStmts applies to bodies that do lower. */
85
+ export declare function countBodyStatements(root: ts.Node): number;
80
86
  export interface LowerResult {
81
87
  /** Present iff diagnostics is empty. */
82
88
  module: IrModule | null;
@@ -100,7 +106,11 @@ export interface LowerResult {
100
106
  unreached?: {
101
107
  diagnostics: ScrDiagnostic[];
102
108
  stats: LowerStats;
109
+ runtimeFences?: ScrDiagnostic[];
103
110
  };
111
+ /** Compile-time-detectable behavior differences from Node (SC6xxx
112
+ * divergence warnings) in the program's own modules. Never failures. */
113
+ divergences?: ScrDiagnostic[];
104
114
  /** --dynamic only: every Node builtin the embedded npm graph imports,
105
115
  * shimmed or not — the coverage report's island honesty. */
106
116
  npmBuiltins?: NpmBuiltinUse[];
@@ -351,6 +361,11 @@ export declare class Lowerer {
351
361
  /** Per-symbol result of the never-reassigned file scan
352
362
  * (bindingNeverReassigned — object-literal generic-method receivers). */
353
363
  readonly neverReassignedCache: Map<ts.Symbol, boolean>;
364
+ private stringIndexBoundsCache;
365
+ /** Proofs that a string element read names an existing code unit. The
366
+ * indexed-read analysis and expression lowering share one instance, so a
367
+ * read's representation and its callers' signatures always agree. */
368
+ get stringIndexBounds(): StringIndexBounds;
354
369
  /** Syntactic writes indexed once per JS scope. Symbol and RHS type
355
370
  * checks remain contextual to each binding probe. */
356
371
  readonly jsBindingWritesByOwner: Map<import("../ts7/ast-node.js").AstNode, Map<string, ts.BinaryExpression[]>>;
@@ -472,6 +487,11 @@ export declare class Lowerer {
472
487
  * prepass. This includes explicit annotations: unchecked TS annotations do
473
488
  * not prove that an array property read produced a value. */
474
489
  readonly runtimeOptionalBindingTypes: Map<ts.Symbol, IrType>;
490
+ /** Bindings that receive an unchecked indexed read (or a value derived
491
+ * from one) through an initializer or assignment. The checker narrows a
492
+ * declared optional binding to that read's bare type, so presence tests
493
+ * on these bindings consult the stored tag instead. */
494
+ readonly runtimeOptionalAssignedSymbols: Set<ts.Symbol>;
475
495
  /** Concise callback/lambda returns promoted by the HOF callback prepass;
476
496
  * arrows have no declaration symbol to key in fnSigsBySymbol. */
477
497
  readonly runtimeOptionalFunctionReturns: Map<import("../ts7/ast-node.js").AstNode, IrType>;
@@ -489,6 +509,17 @@ export declare class Lowerer {
489
509
  * every name destructured from a present source optional. */
490
510
  readonly runtimeOptionalPatternTypes: Map<import("../ts7/ast-node.js").AstNode, IrType>;
491
511
  readonly runtimeOptionalReduceTypes: Map<ts.CallExpression, IrType>;
512
+ /** Non-null assertions whose value is forwarded into a slot promoted to
513
+ * hold undefined. `x!` has no runtime effect, so these keep the stored
514
+ * undefined state instead of trapping before any dereference. */
515
+ readonly runtimeOptionalAssertions: Set<ts.NonNullExpression>;
516
+ /** Array callback calls whose receiver the optional-read analysis proved
517
+ * never holds an explicit undefined (or a hole, for the find family):
518
+ * their callbacks take the element type itself. */
519
+ readonly presentElementCalls: Set<ts.CallExpression>;
520
+ /** for-of loops over arrays that can hold neither holes nor undefined:
521
+ * each pass reads the element payload directly. */
522
+ readonly presentElementLoops: Set<ts.ForOfStatement>;
492
523
  /** Capture entries and their origin share one mutable box. Normalize each
493
524
  * entry to the origin so writes and flow proofs stay synchronized. */
494
525
  readonly runtimeOptionalRoots: Map<IrLocal, IrLocal>;
@@ -522,6 +553,12 @@ export declare class Lowerer {
522
553
  promoteRuntimeOptionalParameter(node: ts.Node, type: IrType): IrType;
523
554
  promoteRuntimeOptionalFunctionReturn(node: ts.Node, type: IrType): IrType;
524
555
  runtimeOptionalFunctionReturnType(node: ts.Node, fallback: IrType): IrType;
556
+ /** True when `actual` is `declared` with some record fields (directly,
557
+ * in nested records, or in an array's element records) widened to runtime-optional unions:
558
+ * fields filled from unchecked indexed reads the checker calls present.
559
+ * Inferred bindings and destructured parameters keep that layout instead
560
+ * of narrowing it away. */
561
+ isRuntimeOptionalRecordVariant(actual: IrType, declared: IrType): boolean;
525
562
  /** Promote one field of a record storage shape to the value's runtime
526
563
  * type. Shapes are immutable by identity, so this interns a sibling shape
527
564
  * and records the field as runtime-optional for property-read narrowing. */
@@ -818,6 +855,9 @@ export declare class Lowerer {
818
855
  * and therefore becomes the cycle's evaluation root. Dynamic imports
819
856
  * wait on this shared verdict rather than a build-time-selected member. */
820
857
  readonly asyncCyclePromiseOf: Map<ts.SourceFile, string>;
858
+ /** Modules whose evaluation an import() can request again after it threw,
859
+ * computed on first use (lower-modules.ts importRetryModules). */
860
+ importRetryModules: ReadonlySet<ts.SourceFile> | null;
821
861
  /** Record-shape interner: canonical (name-sorted) field list → shapeId.
822
862
  * Threaded into every mapType call; its `shapes` array becomes
823
863
  * IrModule.records. */
@@ -901,6 +941,16 @@ export declare class Lowerer {
901
941
  * coverage remainder as alreadyFlushed). */
902
942
  readonly flushedSymbols: Set<ts.Symbol>;
903
943
  readonly alreadyFlushed: ReadonlySet<ts.Symbol>;
944
+ /** Deferred diagnostics a flush handed to a capture buffer (diagSink)
945
+ * instead of the build, keyed by the copy in that buffer. A buffer can
946
+ * be discarded (a declined probe, a collection that succeeded) or
947
+ * re-deferred under another declaration, so the declaration stays
948
+ * deferred until one of these copies reaches `diags` (pushDiag commits
949
+ * it); until then a later flush reports the diagnostics again. */
950
+ readonly pendingFlushes: Map<ScrDiagnostic, {
951
+ symbol: ts.Symbol;
952
+ source: ScrDiagnostic;
953
+ }>;
904
954
  /** The build's target platform ("win32" | "darwin" | "linux" | ...):
905
955
  * selects the platform-keyed builtin surfaces (builtinModuleFnsOf /
906
956
  * builtinModuleConstOf in surfaces.ts). */
@@ -957,6 +1007,10 @@ export declare class Lowerer {
957
1007
  registerBuiltinErrorClasses(): void;
958
1008
  private classProtocols;
959
1009
  classImplementedProtocol(type: ts.Type): boolean;
1010
+ /** Declared class fields may store a DYN value only when its static type
1011
+ * names checked protocol identity or an owned runtime handle (a Worker
1012
+ * or MessagePort); `unknown` and `any` fields stay refused. */
1013
+ classFieldStoresDyn(type: ts.Type): boolean;
960
1014
  /** The nominal identity of a checker module-namespace type. Program
961
1015
  * modules use their normalized absolute source name; supported builtins
962
1016
  * use the lowering tables' canonical bare name. */
@@ -1106,7 +1160,15 @@ export declare class Lowerer {
1106
1160
  * registered ClassInfo — the shape of a JS class whose collection fenced.
1107
1161
  * Used by run()'s global pruning; shapes/unions recurse with a seen-set
1108
1162
  * (interned ids can nest). */
1109
- typeNamesUnregisteredClass(t: IrType, seen?: Set<string>): boolean;
1163
+ typeNamesUnregisteredClass(t: IrType): boolean;
1164
+ /** The first class name typeNamesUnregisteredClass finds in `t`. */
1165
+ unregisteredClassOf(t: IrType, seen: Set<string>): string | null;
1166
+ /** A declaration whose signature blocked never lowers its body, so its
1167
+ * statements would otherwise vanish from the coverage totals and the
1168
+ * percentage would overstate how much of the program compiles. Count
1169
+ * every statement the body holds as attempted and failed, in addition to
1170
+ * the skipped-function tally. */
1171
+ private countSkippedBody;
1110
1172
  /** Whether run() counts a signature-blocked declaration in
1111
1173
  * stats.functionsSkipped: whole-program passes and the coverage
1112
1174
  * remainder do; an externally-gated emit pass leaves the counting to the
@@ -1388,6 +1450,7 @@ export declare class Lowerer {
1388
1450
  }, toId: string, loc: SrcLoc): string | null;
1389
1451
  unionRetagHelper(fromId: string, toId: string, loc: SrcLoc, trappable?: ReadonlySet<number>): string | null;
1390
1452
  narrowedArmHelper(fromId: string, target: IrType, loc: SrcLoc): string | null;
1453
+ checkedNarrowCall(helper: string, value: IrExpr, type: IrType, loc: SrcLoc): IrExpr;
1391
1454
  deferredReadHelper(fromId: string, target: IrType, loc: SrcLoc): string | null;
1392
1455
  jsvalLiftable(t: IrType, visiting?: Set<string>): boolean;
1393
1456
  jsvalLiftExpr(e: IrExpr, loc: SrcLoc): IrExpr;
@@ -1530,6 +1593,14 @@ export declare class Lowerer {
1530
1593
  * may follow) — reached-but-broken declarations report the same set of
1531
1594
  * diagnostics the eager collector historically produced. */
1532
1595
  flushDeferred(symbol: ts.Symbol): void;
1596
+ /** flushDeferred without the collection-pass guard: for declarations
1597
+ * whose diagnostics must report eagerly (class statements with
1598
+ * declaration-time code, extended bases — collectClassShapeDeferring). */
1599
+ reportDeferred(symbol: ts.Symbol): void;
1600
+ /** A flushed copy of a deferred diagnostic reached `diags`: that
1601
+ * diagnostic is reported, so it leaves the declaration's deferred list
1602
+ * (the declaration counts as flushed for the coverage remainder). */
1603
+ private commitFlush;
1533
1604
  flushDeferredClass(className: string): void;
1534
1605
  collectSignature(decl: ts.FunctionDeclaration): void;
1535
1606
  collectSignatureInner(decl: ts.FunctionDeclaration): void;
@@ -1857,6 +1928,11 @@ export declare class Lowerer {
1857
1928
  classIteratorDrainCall(src: IrExpr, loc: SrcLoc, elemT?: IrType): IrExpr | null;
1858
1929
  classIteratorRestDrainCall(cit: ClassIteratorInfo, itVal: IrExpr, loc: SrcLoc): IrExpr;
1859
1930
  fieldGetExpr(target: FieldTarget, loc: SrcLoc, blame: ts.Node): IrExpr;
1931
+ /** The undefined-armed slot read behind a checked deferred-init field
1932
+ * read, or null. Consumers that observe undefined itself (equality,
1933
+ * typeof, truthiness, nullish defaults) test the slot instead of the
1934
+ * checked extraction, which throws for an unassigned field. */
1935
+ deferredFieldSlot(value: IrExpr): IrExpr | null;
1860
1936
  fieldSetStmt(target: FieldTarget, value: IrExpr, loc: SrcLoc, blame: ts.Node): IrStmt;
1861
1937
  lowerFieldCompound(access: ts.PropertyAccessExpression | ts.ElementAccessExpression, op: CompoundOp, rhsNode: ts.Expression | null, loc: SrcLoc): IrStmt;
1862
1938
  errorConstructorArgs(args: readonly ts.Expression[], loc: SrcLoc, blame: ts.Node): IrExpr[];
@@ -2015,7 +2091,7 @@ export declare class Lowerer {
2015
2091
  lowerPromiseMethodCall(call: ts.CallExpression, access: ts.PropertyAccessExpression): IrExpr | null;
2016
2092
  lowerPromiseStaticCall(call: ts.CallExpression, access: ts.PropertyAccessExpression): IrExpr | null;
2017
2093
  lowerNumberStaticProperty(expr: ts.PropertyAccessExpression): IrExpr | null;
2018
- requireDynamicApi(feature: string, node: ts.Node): void;
2094
+ requireDynamicApi(feature: string, node: ts.Node, hint?: string): void;
2019
2095
  lowerMathProperty(expr: ts.PropertyAccessExpression): IrExpr | null;
2020
2096
  islandGlobalFnOf(ident: ts.Identifier): IslandFnEntry | null;
2021
2097
  lowerIslandMethodCall(call: ts.CallExpression, access: ts.PropertyAccessExpression): IrExpr | null;