@scriptc/compiler 0.4.6 → 0.4.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 (1082) hide show
  1. package/ambient/node-fallback/child_process.d.ts +71 -22
  2. package/ambient/node-fallback/crypto.d.ts +15 -7
  3. package/ambient/node-fallback/events.d.ts +29 -6
  4. package/ambient/node-fallback/fs-promises.d.ts +1 -1
  5. package/ambient/node-fallback/fs.d.ts +57 -12
  6. package/ambient/node-fallback/http.d.ts +26 -18
  7. package/ambient/node-fallback/https.d.ts +5 -2
  8. package/ambient/node-fallback/net.d.ts +25 -0
  9. package/ambient/node-fallback/os.d.ts +11 -1
  10. package/ambient/node-fallback/path-posix.d.ts +6 -0
  11. package/ambient/node-fallback/path-win32.d.ts +5 -0
  12. package/ambient/node-fallback/path.d.ts +2 -0
  13. package/ambient/node-fallback/querystring.d.ts +3 -3
  14. package/ambient/node-fallback/zlib.d.ts +31 -2
  15. package/ambient/scriptc-node-fallback.d.ts +95 -20
  16. package/ambient/scriptc.d.ts +7 -2
  17. package/dist/backend/executable-features.js +22 -1
  18. package/dist/backend/executable-features.js.map +1 -1
  19. package/dist/backend/immutability.d.ts +12 -1
  20. package/dist/backend/immutability.js +50 -4
  21. package/dist/backend/immutability.js.map +1 -1
  22. package/dist/backend/immutability.test.js +95 -1
  23. package/dist/backend/immutability.test.js.map +1 -1
  24. package/dist/backend/library-pack.d.ts +6 -0
  25. package/dist/backend/library-pack.js +18 -5
  26. package/dist/backend/library-pack.js.map +1 -1
  27. package/dist/backend/library-pack.test.d.ts +1 -0
  28. package/dist/backend/library-pack.test.js +28 -0
  29. package/dist/backend/library-pack.test.js.map +1 -0
  30. package/dist/backend/linker.d.ts +20 -2
  31. package/dist/backend/linker.js +221 -35
  32. package/dist/backend/linker.js.map +1 -1
  33. package/dist/backend/lld.d.ts +15 -6
  34. package/dist/backend/lld.js +24 -16
  35. package/dist/backend/lld.js.map +1 -1
  36. package/dist/backend/lld.test.js +13 -5
  37. package/dist/backend/lld.test.js.map +1 -1
  38. package/dist/backend/llvm/alloc.d.ts +15 -2
  39. package/dist/backend/llvm/alloc.js +172 -36
  40. package/dist/backend/llvm/alloc.js.map +1 -1
  41. package/dist/backend/llvm/alloc.test.js +69 -1
  42. package/dist/backend/llvm/alloc.test.js.map +1 -1
  43. package/dist/backend/llvm/arenas.d.ts +17 -4
  44. package/dist/backend/llvm/arenas.js +105 -10
  45. package/dist/backend/llvm/arenas.js.map +1 -1
  46. package/dist/backend/llvm/arenas.test.js +229 -0
  47. package/dist/backend/llvm/arenas.test.js.map +1 -1
  48. package/dist/backend/llvm/bytes-alias.js +10 -1
  49. package/dist/backend/llvm/bytes-alias.js.map +1 -1
  50. package/dist/backend/llvm/bytes-headers.js +6 -0
  51. package/dist/backend/llvm/bytes-headers.js.map +1 -1
  52. package/dist/backend/llvm/bytes-loop-versions.test.js +25 -0
  53. package/dist/backend/llvm/bytes-loop-versions.test.js.map +1 -1
  54. package/dist/backend/llvm/call-lifetimes.js +10 -0
  55. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  56. package/dist/backend/llvm/classes.d.ts +16 -9
  57. package/dist/backend/llvm/classes.js +142 -37
  58. package/dist/backend/llvm/classes.js.map +1 -1
  59. package/dist/backend/llvm/classes.test.js +42 -0
  60. package/dist/backend/llvm/classes.test.js.map +1 -1
  61. package/dist/backend/llvm/constant-callbacks.test.js +50 -1
  62. package/dist/backend/llvm/constant-callbacks.test.js.map +1 -1
  63. package/dist/backend/llvm/cpu-dispatch.d.ts +15 -5
  64. package/dist/backend/llvm/cpu-dispatch.js +34 -9
  65. package/dist/backend/llvm/cpu-dispatch.js.map +1 -1
  66. package/dist/backend/llvm/dyn.d.ts +64 -3
  67. package/dist/backend/llvm/dyn.js +251 -15
  68. package/dist/backend/llvm/dyn.js.map +1 -1
  69. package/dist/backend/llvm/emit-function.js +68 -5
  70. package/dist/backend/llvm/emit-function.js.map +1 -1
  71. package/dist/backend/llvm/emit-module.js +226 -77
  72. package/dist/backend/llvm/emit-module.js.map +1 -1
  73. package/dist/backend/llvm/emit-module.test.d.ts +1 -0
  74. package/dist/backend/llvm/emit-module.test.js +52 -0
  75. package/dist/backend/llvm/emit-module.test.js.map +1 -0
  76. package/dist/backend/llvm/emit-statements.js +138 -34
  77. package/dist/backend/llvm/emit-statements.js.map +1 -1
  78. package/dist/backend/llvm/emitter.d.ts +142 -10
  79. package/dist/backend/llvm/emitter.js +523 -73
  80. package/dist/backend/llvm/emitter.js.map +1 -1
  81. package/dist/backend/llvm/emitter.test.js +31 -3
  82. package/dist/backend/llvm/emitter.test.js.map +1 -1
  83. package/dist/backend/llvm/expr-async.js +19 -1
  84. package/dist/backend/llvm/expr-async.js.map +1 -1
  85. package/dist/backend/llvm/expr-bytes.js +16 -1
  86. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  87. package/dist/backend/llvm/expr-calls.d.ts +4 -1
  88. package/dist/backend/llvm/expr-calls.js +38 -6
  89. package/dist/backend/llvm/expr-calls.js.map +1 -1
  90. package/dist/backend/llvm/expr-dynamic.js +237 -23
  91. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  92. package/dist/backend/llvm/expr-primitives.js +123 -12
  93. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  94. package/dist/backend/llvm/expr-records.d.ts +1 -1
  95. package/dist/backend/llvm/expr-records.js +124 -56
  96. package/dist/backend/llvm/expr-records.js.map +1 -1
  97. package/dist/backend/llvm/expr-stream-bridges.d.ts +8 -0
  98. package/dist/backend/llvm/expr-stream-bridges.js +59 -2
  99. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  100. package/dist/backend/llvm/expr-stream-callbacks.d.ts +16 -0
  101. package/dist/backend/llvm/expr-stream-callbacks.js +206 -20
  102. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
  103. package/dist/backend/llvm/integer-values.d.ts +2 -0
  104. package/dist/backend/llvm/integer-values.js +6 -0
  105. package/dist/backend/llvm/integer-values.js.map +1 -1
  106. package/dist/backend/llvm/js-groups.d.ts +21 -0
  107. package/dist/backend/llvm/js-groups.js +277 -0
  108. package/dist/backend/llvm/js-groups.js.map +1 -0
  109. package/dist/backend/llvm/js-ic.d.ts +57 -1
  110. package/dist/backend/llvm/js-ic.js +389 -22
  111. package/dist/backend/llvm/js-ic.js.map +1 -1
  112. package/dist/backend/llvm/lib-dispatch.js +152 -1
  113. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  114. package/dist/backend/llvm/lib-filesystem.js +116 -11
  115. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  116. package/dist/backend/llvm/lib-network.js +33 -6
  117. package/dist/backend/llvm/lib-network.js.map +1 -1
  118. package/dist/backend/llvm/lib-process.js +180 -27
  119. package/dist/backend/llvm/lib-process.js.map +1 -1
  120. package/dist/backend/llvm/lib-shared.js +139 -2
  121. package/dist/backend/llvm/lib-shared.js.map +1 -1
  122. package/dist/backend/llvm/lib-stream.js +67 -0
  123. package/dist/backend/llvm/lib-stream.js.map +1 -1
  124. package/dist/backend/llvm/local-union-storage.test.js +32 -0
  125. package/dist/backend/llvm/local-union-storage.test.js.map +1 -1
  126. package/dist/backend/llvm/loop-entry-versions.d.ts +2 -2
  127. package/dist/backend/llvm/loop-entry-versions.js +43 -21
  128. package/dist/backend/llvm/loop-entry-versions.js.map +1 -1
  129. package/dist/backend/llvm/loop-state.d.ts +7 -1
  130. package/dist/backend/llvm/loop-state.js +26 -3
  131. package/dist/backend/llvm/loop-state.js.map +1 -1
  132. package/dist/backend/llvm/map-entry-fusion.d.ts +8 -0
  133. package/dist/backend/llvm/map-entry-fusion.js +3 -3
  134. package/dist/backend/llvm/map-entry-fusion.js.map +1 -1
  135. package/dist/backend/llvm/map-number-lookup.d.ts +3 -1
  136. package/dist/backend/llvm/map-number-lookup.js +7 -3
  137. package/dist/backend/llvm/map-number-lookup.js.map +1 -1
  138. package/dist/backend/llvm/map-number-lookup.test.js +58 -17
  139. package/dist/backend/llvm/map-number-lookup.test.js.map +1 -1
  140. package/dist/backend/llvm/nullable-unions.js +7 -6
  141. package/dist/backend/llvm/nullable-unions.js.map +1 -1
  142. package/dist/backend/llvm/nullable-unions.test.js +4 -1
  143. package/dist/backend/llvm/nullable-unions.test.js.map +1 -1
  144. package/dist/backend/llvm/receiver-brackets.test.d.ts +1 -0
  145. package/dist/backend/llvm/receiver-brackets.test.js +68 -0
  146. package/dist/backend/llvm/receiver-brackets.test.js.map +1 -0
  147. package/dist/backend/llvm/receivers.js +3 -0
  148. package/dist/backend/llvm/receivers.js.map +1 -1
  149. package/dist/backend/llvm/record-entry-fusion.d.ts +32 -0
  150. package/dist/backend/llvm/record-entry-fusion.js +217 -0
  151. package/dist/backend/llvm/record-entry-fusion.js.map +1 -0
  152. package/dist/backend/llvm/record-results.d.ts +5 -2
  153. package/dist/backend/llvm/record-results.js +13 -12
  154. package/dist/backend/llvm/record-results.js.map +1 -1
  155. package/dist/backend/llvm/record-views.d.ts +22 -2
  156. package/dist/backend/llvm/record-views.js +147 -12
  157. package/dist/backend/llvm/record-views.js.map +1 -1
  158. package/dist/backend/llvm/record-views.test.js +76 -0
  159. package/dist/backend/llvm/record-views.test.js.map +1 -1
  160. package/dist/backend/llvm/reference-effects.js +1 -0
  161. package/dist/backend/llvm/reference-effects.js.map +1 -1
  162. package/dist/backend/llvm/reference-writes.js +4 -0
  163. package/dist/backend/llvm/reference-writes.js.map +1 -1
  164. package/dist/backend/llvm/region-ir.js +1 -0
  165. package/dist/backend/llvm/region-ir.js.map +1 -1
  166. package/dist/backend/llvm/region-sites.d.ts +18 -0
  167. package/dist/backend/llvm/region-sites.js +79 -1
  168. package/dist/backend/llvm/region-sites.js.map +1 -1
  169. package/dist/backend/llvm/runtime-registries.test.js +53 -6
  170. package/dist/backend/llvm/runtime-registries.test.js.map +1 -1
  171. package/dist/backend/llvm/serialized-ir-emission.test.js +3 -1
  172. package/dist/backend/llvm/serialized-ir-emission.test.js.map +1 -1
  173. package/dist/backend/llvm/shapes.d.ts +36 -3
  174. package/dist/backend/llvm/shapes.js +201 -16
  175. package/dist/backend/llvm/shapes.js.map +1 -1
  176. package/dist/backend/llvm/shapes.test.js +4 -0
  177. package/dist/backend/llvm/shapes.test.js.map +1 -1
  178. package/dist/backend/llvm/speculative-integers.d.ts +10 -1
  179. package/dist/backend/llvm/speculative-integers.js +59 -8
  180. package/dist/backend/llvm/speculative-integers.js.map +1 -1
  181. package/dist/backend/llvm/stack-objects.d.ts +1 -2
  182. package/dist/backend/llvm/stack-objects.js +8 -5
  183. package/dist/backend/llvm/stack-objects.js.map +1 -1
  184. package/dist/backend/llvm/unwind-abi.d.ts +3 -3
  185. package/dist/backend/llvm/unwind-abi.js +8 -3
  186. package/dist/backend/llvm/unwind-abi.js.map +1 -1
  187. package/dist/backend/llvm/walkers.d.ts +12 -0
  188. package/dist/backend/llvm/walkers.js +47 -3
  189. package/dist/backend/llvm/walkers.js.map +1 -1
  190. package/dist/backend/may-throw.js +12 -2
  191. package/dist/backend/may-throw.js.map +1 -1
  192. package/dist/backend/may-throw.test.js +13 -0
  193. package/dist/backend/may-throw.test.js.map +1 -1
  194. package/dist/backend/native/contracts.d.ts +94 -0
  195. package/dist/backend/native/executable.js +134 -10
  196. package/dist/backend/native/executable.js.map +1 -1
  197. package/dist/backend/native/helper-identity-record.d.ts +11 -0
  198. package/dist/backend/native/helper-identity-record.js +76 -0
  199. package/dist/backend/native/helper-identity-record.js.map +1 -0
  200. package/dist/backend/native/helper-identity-record.test.d.ts +1 -0
  201. package/dist/backend/native/helper-identity-record.test.js +101 -0
  202. package/dist/backend/native/helper-identity-record.test.js.map +1 -0
  203. package/dist/backend/native/library.js +10 -2
  204. package/dist/backend/native/library.js.map +1 -1
  205. package/dist/backend/native/runtime-inputs.js +8 -1
  206. package/dist/backend/native/runtime-inputs.js.map +1 -1
  207. package/dist/backend/native/vendor.d.ts +1 -1
  208. package/dist/backend/native/vendor.js +1 -1
  209. package/dist/backend/native/vendor.js.map +1 -1
  210. package/dist/backend/native-codegen-core.d.ts +13 -10
  211. package/dist/backend/native-codegen-core.js +26 -13
  212. package/dist/backend/native-codegen-core.js.map +1 -1
  213. package/dist/backend/native-codegen.js +30 -8
  214. package/dist/backend/native-codegen.js.map +1 -1
  215. package/dist/backend/native-codegen.test.js +110 -14
  216. package/dist/backend/native-codegen.test.js.map +1 -1
  217. package/dist/backend/native-link-info-core.d.ts +72 -0
  218. package/dist/backend/native-link-info-core.js.map +1 -1
  219. package/dist/backend/native-link-info.js +1 -0
  220. package/dist/backend/native-link-info.js.map +1 -1
  221. package/dist/backend/native-profile.d.ts +4 -1
  222. package/dist/backend/native-profile.js +12 -1
  223. package/dist/backend/native-profile.js.map +1 -1
  224. package/dist/backend/native-profile.test.js +10 -0
  225. package/dist/backend/native-profile.test.js.map +1 -1
  226. package/dist/backend/publication.d.ts +4 -1
  227. package/dist/backend/publication.js +4 -2
  228. package/dist/backend/publication.js.map +1 -1
  229. package/dist/backend/runtime-abi.d.ts +2 -2
  230. package/dist/backend/runtime-abi.js +2 -2
  231. package/dist/backend/runtime-pack-core.d.ts +46 -7
  232. package/dist/backend/runtime-pack-core.js +37 -2
  233. package/dist/backend/runtime-pack-core.js.map +1 -1
  234. package/dist/backend/runtime-pack-native.d.ts +18 -1
  235. package/dist/backend/runtime-pack-native.js +138 -29
  236. package/dist/backend/runtime-pack-native.js.map +1 -1
  237. package/dist/backend/runtime-pack-native.test.js +166 -4
  238. package/dist/backend/runtime-pack-native.test.js.map +1 -1
  239. package/dist/backend/runtime-pack-targets.test.js +3 -1
  240. package/dist/backend/runtime-pack-targets.test.js.map +1 -1
  241. package/dist/backend/runtime-pack.d.ts +7 -0
  242. package/dist/backend/runtime-pack.js +25 -3
  243. package/dist/backend/runtime-pack.js.map +1 -1
  244. package/dist/backend/runtime-pack.test.js +213 -12
  245. package/dist/backend/runtime-pack.test.js.map +1 -1
  246. package/dist/backend/tree-classes.d.ts +42 -0
  247. package/dist/backend/tree-classes.js +723 -0
  248. package/dist/backend/tree-classes.js.map +1 -0
  249. package/dist/backend/tree-classes.test.d.ts +1 -0
  250. package/dist/backend/tree-classes.test.js +338 -0
  251. package/dist/backend/tree-classes.test.js.map +1 -0
  252. package/dist/backend/vendor-archives.d.ts +8 -1
  253. package/dist/backend/vendor-archives.js +313 -8
  254. package/dist/backend/vendor-archives.js.map +1 -1
  255. package/dist/backend/vendor-inputs.d.ts +60 -3
  256. package/dist/backend/vendor-inputs.js +109 -3
  257. package/dist/backend/vendor-inputs.js.map +1 -1
  258. package/dist/backend/vendor-inputs.test.js +62 -1
  259. package/dist/backend/vendor-inputs.test.js.map +1 -1
  260. package/dist/backend/warm-cache.js +2 -0
  261. package/dist/backend/warm-cache.js.map +1 -1
  262. package/dist/compat/fetch-profile.d.ts +7 -1
  263. package/dist/compat/fetch-profile.js +25 -12
  264. package/dist/compat/fetch-profile.js.map +1 -1
  265. package/dist/compile-types.d.ts +7 -0
  266. package/dist/contracts/check.d.ts +3 -0
  267. package/dist/contracts/check.js +18 -5
  268. package/dist/contracts/check.js.map +1 -1
  269. package/dist/coverage/report.js +47 -0
  270. package/dist/coverage/report.js.map +1 -1
  271. package/dist/coverage/surface-manifest.js +1 -1
  272. package/dist/coverage/surface-manifest.js.map +1 -1
  273. package/dist/diagnostics/codes.d.ts +14 -0
  274. package/dist/diagnostics/codes.js +14 -0
  275. package/dist/diagnostics/codes.js.map +1 -1
  276. package/dist/diagnostics/diagnostic.d.ts +68 -0
  277. package/dist/diagnostics/diagnostic.js +186 -6
  278. package/dist/diagnostics/diagnostic.js.map +1 -1
  279. package/dist/diagnostics/dynamic-tier.js +3 -1
  280. package/dist/diagnostics/dynamic-tier.js.map +1 -1
  281. package/dist/diagnostics/envelope.d.ts +18 -0
  282. package/dist/diagnostics/envelope.js.map +1 -1
  283. package/dist/executable/executable-cache.d.ts +48 -0
  284. package/dist/executable/executable-cache.js +38 -0
  285. package/dist/executable/executable-cache.js.map +1 -1
  286. package/dist/executable/executable-cache.test.js +127 -1
  287. package/dist/executable/executable-cache.test.js.map +1 -1
  288. package/dist/executable/prepare.d.ts +13 -3
  289. package/dist/executable/prepare.js +438 -234
  290. package/dist/executable/prepare.js.map +1 -1
  291. package/dist/frontend/analysis.js +200 -18
  292. package/dist/frontend/analysis.js.map +1 -1
  293. package/dist/frontend/builtin-modules.d.ts +4 -0
  294. package/dist/frontend/builtin-modules.js +10 -0
  295. package/dist/frontend/builtin-modules.js.map +1 -1
  296. package/dist/frontend/early-errors.d.ts +24 -0
  297. package/dist/frontend/early-errors.js +836 -0
  298. package/dist/frontend/early-errors.js.map +1 -0
  299. package/dist/frontend/early-errors.test.d.ts +1 -0
  300. package/dist/frontend/early-errors.test.js +207 -0
  301. package/dist/frontend/early-errors.test.js.map +1 -0
  302. package/dist/frontend/inferred-js-diagnostics.test.js +88 -0
  303. package/dist/frontend/inferred-js-diagnostics.test.js.map +1 -1
  304. package/dist/frontend/input-tracker.d.ts +47 -0
  305. package/dist/frontend/input-tracker.js +173 -36
  306. package/dist/frontend/input-tracker.js.map +1 -1
  307. package/dist/frontend/input-tracker.test.js +86 -2
  308. package/dist/frontend/input-tracker.test.js.map +1 -1
  309. package/dist/frontend/js-inference.d.ts +2 -0
  310. package/dist/frontend/js-inference.js +18 -0
  311. package/dist/frontend/js-inference.js.map +1 -0
  312. package/dist/frontend/jsx-opinion-sites.test.d.ts +1 -0
  313. package/dist/frontend/jsx-opinion-sites.test.js +86 -0
  314. package/dist/frontend/jsx-opinion-sites.test.js.map +1 -0
  315. package/dist/frontend/lib-exports.d.ts +23 -4
  316. package/dist/frontend/lib-exports.js +98 -26
  317. package/dist/frontend/lib-exports.js.map +1 -1
  318. package/dist/frontend/lowering/binding-analysis.d.ts +2 -1
  319. package/dist/frontend/lowering/binding-analysis.js +86 -4
  320. package/dist/frontend/lowering/binding-analysis.js.map +1 -1
  321. package/dist/frontend/lowering/buffers.d.ts +8 -0
  322. package/dist/frontend/lowering/buffers.js +43 -0
  323. package/dist/frontend/lowering/buffers.js.map +1 -0
  324. package/dist/frontend/lowering/builtin-calls.js +13 -0
  325. package/dist/frontend/lowering/builtin-calls.js.map +1 -1
  326. package/dist/frontend/lowering/builtin-namespaces.d.ts +3 -2
  327. package/dist/frontend/lowering/builtin-namespaces.js +41 -3
  328. package/dist/frontend/lowering/builtin-namespaces.js.map +1 -1
  329. package/dist/frontend/lowering/builtin-statics.d.ts +24 -0
  330. package/dist/frontend/lowering/builtin-statics.js +407 -0
  331. package/dist/frontend/lowering/builtin-statics.js.map +1 -0
  332. package/dist/frontend/lowering/builtins/arguments.d.ts +4 -0
  333. package/dist/frontend/lowering/builtins/arguments.js +12 -0
  334. package/dist/frontend/lowering/builtins/arguments.js.map +1 -1
  335. package/dist/frontend/lowering/builtins/atomics.d.ts +6 -1
  336. package/dist/frontend/lowering/builtins/atomics.js +87 -1
  337. package/dist/frontend/lowering/builtins/atomics.js.map +1 -1
  338. package/dist/frontend/lowering/builtins/child-process-methods.d.ts +7 -0
  339. package/dist/frontend/lowering/builtins/child-process-methods.js +52 -12
  340. package/dist/frontend/lowering/builtins/child-process-methods.js.map +1 -1
  341. package/dist/frontend/lowering/builtins/child-process-sync.d.ts +13 -0
  342. package/dist/frontend/lowering/builtins/child-process-sync.js +1 -13
  343. package/dist/frontend/lowering/builtins/child-process-sync.js.map +1 -1
  344. package/dist/frontend/lowering/builtins/child-process.d.ts +10 -4
  345. package/dist/frontend/lowering/builtins/child-process.js +565 -28
  346. package/dist/frontend/lowering/builtins/child-process.js.map +1 -1
  347. package/dist/frontend/lowering/builtins/compression.d.ts +2 -2
  348. package/dist/frontend/lowering/builtins/compression.js +41 -21
  349. package/dist/frontend/lowering/builtins/compression.js.map +1 -1
  350. package/dist/frontend/lowering/builtins/constants.js +7 -2
  351. package/dist/frontend/lowering/builtins/constants.js.map +1 -1
  352. package/dist/frontend/lowering/builtins/dates.d.ts +1 -1
  353. package/dist/frontend/lowering/builtins/dates.js +23 -1
  354. package/dist/frontend/lowering/builtins/dates.js.map +1 -1
  355. package/dist/frontend/lowering/builtins/environment.d.ts +55 -0
  356. package/dist/frontend/lowering/builtins/environment.js +213 -2
  357. package/dist/frontend/lowering/builtins/environment.js.map +1 -1
  358. package/dist/frontend/lowering/builtins/filesystem-calls.d.ts +1 -0
  359. package/dist/frontend/lowering/builtins/filesystem-calls.js +75 -18
  360. package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -1
  361. package/dist/frontend/lowering/builtins/filesystem.d.ts +25 -7
  362. package/dist/frontend/lowering/builtins/filesystem.js +185 -16
  363. package/dist/frontend/lowering/builtins/filesystem.js.map +1 -1
  364. package/dist/frontend/lowering/builtins/json.js +4 -0
  365. package/dist/frontend/lowering/builtins/json.js.map +1 -1
  366. package/dist/frontend/lowering/builtins/module-calls.js +42 -3
  367. package/dist/frontend/lowering/builtins/module-calls.js.map +1 -1
  368. package/dist/frontend/lowering/builtins/module-resolution.d.ts +8 -0
  369. package/dist/frontend/lowering/builtins/module-resolution.js +31 -5
  370. package/dist/frontend/lowering/builtins/module-resolution.js.map +1 -1
  371. package/dist/frontend/lowering/builtins/numbers.d.ts +4 -1
  372. package/dist/frontend/lowering/builtins/numbers.js +10 -2
  373. package/dist/frontend/lowering/builtins/numbers.js.map +1 -1
  374. package/dist/frontend/lowering/builtins/operating-system.d.ts +9 -5
  375. package/dist/frontend/lowering/builtins/operating-system.js +101 -20
  376. package/dist/frontend/lowering/builtins/operating-system.js.map +1 -1
  377. package/dist/frontend/lowering/builtins/process.d.ts +18 -2
  378. package/dist/frontend/lowering/builtins/process.js +386 -25
  379. package/dist/frontend/lowering/builtins/process.js.map +1 -1
  380. package/dist/frontend/lowering/builtins/promises.js +169 -8
  381. package/dist/frontend/lowering/builtins/promises.js.map +1 -1
  382. package/dist/frontend/lowering/builtins/properties.js +6 -2
  383. package/dist/frontend/lowering/builtins/properties.js.map +1 -1
  384. package/dist/frontend/lowering/builtins/querystring.d.ts +8 -0
  385. package/dist/frontend/lowering/builtins/querystring.js +202 -18
  386. package/dist/frontend/lowering/builtins/querystring.js.map +1 -1
  387. package/dist/frontend/lowering/builtins/readline.d.ts +6 -4
  388. package/dist/frontend/lowering/builtins/readline.js +200 -38
  389. package/dist/frontend/lowering/builtins/readline.js.map +1 -1
  390. package/dist/frontend/lowering/builtins/reflection.js +60 -1
  391. package/dist/frontend/lowering/builtins/reflection.js.map +1 -1
  392. package/dist/frontend/lowering/builtins/text-codecs.js +208 -59
  393. package/dist/frontend/lowering/builtins/text-codecs.js.map +1 -1
  394. package/dist/frontend/lowering/builtins/url.js +55 -13
  395. package/dist/frontend/lowering/builtins/url.js.map +1 -1
  396. package/dist/frontend/lowering/builtins/v8.d.ts +5 -5
  397. package/dist/frontend/lowering/builtins/v8.js +7 -5
  398. package/dist/frontend/lowering/builtins/v8.js.map +1 -1
  399. package/dist/frontend/lowering/builtins/web-streams-dyn.d.ts +17 -2
  400. package/dist/frontend/lowering/builtins/web-streams-dyn.js +97 -9
  401. package/dist/frontend/lowering/builtins/web-streams-dyn.js.map +1 -1
  402. package/dist/frontend/lowering/builtins/webassembly.js +2 -0
  403. package/dist/frontend/lowering/builtins/webassembly.js.map +1 -1
  404. package/dist/frontend/lowering/call-arguments.d.ts +10 -0
  405. package/dist/frontend/lowering/call-arguments.js +37 -2
  406. package/dist/frontend/lowering/call-arguments.js.map +1 -1
  407. package/dist/frontend/lowering/call-signatures.d.ts +10 -0
  408. package/dist/frontend/lowering/call-signatures.js +180 -0
  409. package/dist/frontend/lowering/call-signatures.js.map +1 -1
  410. package/dist/frontend/lowering/cjs-exports-object.d.ts +3 -0
  411. package/dist/frontend/lowering/cjs-exports-object.js +1 -1
  412. package/dist/frontend/lowering/cjs-exports-object.js.map +1 -1
  413. package/dist/frontend/lowering/cjs-inline-require.js +5 -0
  414. package/dist/frontend/lowering/cjs-inline-require.js.map +1 -1
  415. package/dist/frontend/lowering/class-construction.d.ts +14 -2
  416. package/dist/frontend/lowering/class-construction.js +99 -5
  417. package/dist/frontend/lowering/class-construction.js.map +1 -1
  418. package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +14 -0
  419. package/dist/frontend/lowering/class-dynamic-dispatch.js +1376 -1009
  420. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  421. package/dist/frontend/lowering/class-dynamic-dispatch.test.js +158 -0
  422. package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -1
  423. package/dist/frontend/lowering/class-protocols.js +59 -10
  424. package/dist/frontend/lowering/class-protocols.js.map +1 -1
  425. package/dist/frontend/lowering/class-prototypes.js +20 -15
  426. package/dist/frontend/lowering/class-prototypes.js.map +1 -1
  427. package/dist/frontend/lowering/class-runtime-statics.d.ts +8 -0
  428. package/dist/frontend/lowering/class-runtime-statics.js +35 -1
  429. package/dist/frontend/lowering/class-runtime-statics.js.map +1 -1
  430. package/dist/frontend/lowering/class-unions.js +21 -4
  431. package/dist/frontend/lowering/class-unions.js.map +1 -1
  432. package/dist/frontend/lowering/class-views.d.ts +13 -0
  433. package/dist/frontend/lowering/class-views.js +51 -0
  434. package/dist/frontend/lowering/class-views.js.map +1 -0
  435. package/dist/frontend/lowering/coercions/function-adapters.d.ts +15 -1
  436. package/dist/frontend/lowering/coercions/function-adapters.js +63 -10
  437. package/dist/frontend/lowering/coercions/function-adapters.js.map +1 -1
  438. package/dist/frontend/lowering/coercions/state.d.ts +15 -0
  439. package/dist/frontend/lowering/coercions/state.js +24 -0
  440. package/dist/frontend/lowering/coercions/state.js.map +1 -1
  441. package/dist/frontend/lowering/coercions/structural-plans.js +75 -3
  442. package/dist/frontend/lowering/coercions/structural-plans.js.map +1 -1
  443. package/dist/frontend/lowering/coercions/structural.js +39 -2
  444. package/dist/frontend/lowering/coercions/structural.js.map +1 -1
  445. package/dist/frontend/lowering/coercions/unions.d.ts +2 -1
  446. package/dist/frontend/lowering/coercions/unions.js +54 -10
  447. package/dist/frontend/lowering/coercions/unions.js.map +1 -1
  448. package/dist/frontend/lowering/constructor-returns.d.ts +23 -2
  449. package/dist/frontend/lowering/constructor-returns.js +284 -58
  450. package/dist/frontend/lowering/constructor-returns.js.map +1 -1
  451. package/dist/frontend/lowering/containers/array-callbacks.d.ts +8 -1
  452. package/dist/frontend/lowering/containers/array-callbacks.js +288 -90
  453. package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -1
  454. package/dist/frontend/lowering/containers/array-construction.js +37 -8
  455. package/dist/frontend/lowering/containers/array-construction.js.map +1 -1
  456. package/dist/frontend/lowering/containers/array-from-async.js +139 -3
  457. package/dist/frontend/lowering/containers/array-from-async.js.map +1 -1
  458. package/dist/frontend/lowering/containers/array-iteration.d.ts +14 -4
  459. package/dist/frontend/lowering/containers/array-iteration.js +24 -7
  460. package/dist/frontend/lowering/containers/array-iteration.js.map +1 -1
  461. package/dist/frontend/lowering/containers/array-methods.js +30 -11
  462. package/dist/frontend/lowering/containers/array-methods.js.map +1 -1
  463. package/dist/frontend/lowering/containers/bytes.d.ts +6 -0
  464. package/dist/frontend/lowering/containers/bytes.js +450 -86
  465. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  466. package/dist/frontend/lowering/containers/callback-arguments.d.ts +16 -0
  467. package/dist/frontend/lowering/containers/callback-arguments.js +74 -12
  468. package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -1
  469. package/dist/frontend/lowering/containers/collection-grouping.js +421 -2
  470. package/dist/frontend/lowering/containers/collection-grouping.js.map +1 -1
  471. package/dist/frontend/lowering/containers/collection-methods.js +52 -17
  472. package/dist/frontend/lowering/containers/collection-methods.js.map +1 -1
  473. package/dist/frontend/lowering/containers/filter-predicates.d.ts +10 -0
  474. package/dist/frontend/lowering/containers/filter-predicates.js +69 -3
  475. package/dist/frontend/lowering/containers/filter-predicates.js.map +1 -1
  476. package/dist/frontend/lowering/containers/indexed-objects.js +46 -2
  477. package/dist/frontend/lowering/containers/indexed-objects.js.map +1 -1
  478. package/dist/frontend/lowering/containers/iterator-helpers.d.ts +23 -0
  479. package/dist/frontend/lowering/containers/iterator-helpers.js +176 -10
  480. package/dist/frontend/lowering/containers/iterator-helpers.js.map +1 -1
  481. package/dist/frontend/lowering/containers/string-and-regexp.d.ts +5 -2
  482. package/dist/frontend/lowering/containers/string-and-regexp.js +45 -11
  483. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  484. package/dist/frontend/lowering/crypto-tables.d.ts +3 -3
  485. package/dist/frontend/lowering/crypto-tables.js +5 -5
  486. package/dist/frontend/lowering/dispatch-sites.js +3 -0
  487. package/dist/frontend/lowering/dispatch-sites.js.map +1 -1
  488. package/dist/frontend/lowering/divergences.d.ts +40 -0
  489. package/dist/frontend/lowering/divergences.js +239 -20
  490. package/dist/frontend/lowering/divergences.js.map +1 -1
  491. package/dist/frontend/lowering/effect-free.d.ts +12 -0
  492. package/dist/frontend/lowering/effect-free.js +44 -0
  493. package/dist/frontend/lowering/effect-free.js.map +1 -0
  494. package/dist/frontend/lowering/expressions/array-literals.d.ts +24 -0
  495. package/dist/frontend/lowering/expressions/array-literals.js +88 -10
  496. package/dist/frontend/lowering/expressions/array-literals.js.map +1 -1
  497. package/dist/frontend/lowering/expressions/binary.js +216 -14
  498. package/dist/frontend/lowering/expressions/binary.js.map +1 -1
  499. package/dist/frontend/lowering/expressions/element-access.js +272 -11
  500. package/dist/frontend/lowering/expressions/element-access.js.map +1 -1
  501. package/dist/frontend/lowering/expressions/hosted-narrowing.d.ts +15 -0
  502. package/dist/frontend/lowering/expressions/hosted-narrowing.js +54 -1
  503. package/dist/frontend/lowering/expressions/hosted-narrowing.js.map +1 -1
  504. package/dist/frontend/lowering/expressions/identifiers.js +173 -4
  505. package/dist/frontend/lowering/expressions/identifiers.js.map +1 -1
  506. package/dist/frontend/lowering/expressions/keyed-field-targets.d.ts +11 -1
  507. package/dist/frontend/lowering/expressions/keyed-field-targets.js +22 -1
  508. package/dist/frontend/lowering/expressions/keyed-field-targets.js.map +1 -1
  509. package/dist/frontend/lowering/expressions/narrowing.d.ts +3 -0
  510. package/dist/frontend/lowering/expressions/narrowing.js +195 -18
  511. package/dist/frontend/lowering/expressions/narrowing.js.map +1 -1
  512. package/dist/frontend/lowering/expressions/object-literals.d.ts +5 -1
  513. package/dist/frontend/lowering/expressions/object-literals.js +951 -240
  514. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  515. package/dist/frontend/lowering/expressions/optional-chains.js +71 -21
  516. package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
  517. package/dist/frontend/lowering/expressions/property-access.d.ts +39 -0
  518. package/dist/frontend/lowering/expressions/property-access.js +1141 -87
  519. package/dist/frontend/lowering/expressions/property-access.js.map +1 -1
  520. package/dist/frontend/lowering/expressions/relational.js +262 -4
  521. package/dist/frontend/lowering/expressions/relational.js.map +1 -1
  522. package/dist/frontend/lowering/expressions/typeof.js +25 -0
  523. package/dist/frontend/lowering/expressions/typeof.js.map +1 -1
  524. package/dist/frontend/lowering/expressions/union-fields.d.ts +20 -1
  525. package/dist/frontend/lowering/expressions/union-fields.js +103 -13
  526. package/dist/frontend/lowering/expressions/union-fields.js.map +1 -1
  527. package/dist/frontend/lowering/expressions/updates.js +156 -22
  528. package/dist/frontend/lowering/expressions/updates.js.map +1 -1
  529. package/dist/frontend/lowering/frozen-records.d.ts +6 -0
  530. package/dist/frontend/lowering/frozen-records.js +10 -4
  531. package/dist/frontend/lowering/frozen-records.js.map +1 -1
  532. package/dist/frontend/lowering/frozen-records.test.d.ts +1 -0
  533. package/dist/frontend/lowering/frozen-records.test.js +44 -0
  534. package/dist/frontend/lowering/frozen-records.test.js.map +1 -0
  535. package/dist/frontend/lowering/function-names.d.ts +9 -0
  536. package/dist/frontend/lowering/function-names.js +95 -0
  537. package/dist/frontend/lowering/function-names.js.map +1 -0
  538. package/dist/frontend/lowering/function-returns.js +42 -13
  539. package/dist/frontend/lowering/function-returns.js.map +1 -1
  540. package/dist/frontend/lowering/general-streams.js +5 -0
  541. package/dist/frontend/lowering/general-streams.js.map +1 -1
  542. package/dist/frontend/lowering/generator-delegation.d.ts +15 -7
  543. package/dist/frontend/lowering/generator-delegation.js +301 -118
  544. package/dist/frontend/lowering/generator-delegation.js.map +1 -1
  545. package/dist/frontend/lowering/generic-functions.d.ts +75 -0
  546. package/dist/frontend/lowering/generic-functions.js +790 -18
  547. package/dist/frontend/lowering/generic-functions.js.map +1 -1
  548. package/dist/frontend/lowering/global-function-values.d.ts +25 -0
  549. package/dist/frontend/lowering/global-function-values.js +193 -0
  550. package/dist/frontend/lowering/global-function-values.js.map +1 -0
  551. package/dist/frontend/lowering/global-values.d.ts +15 -4
  552. package/dist/frontend/lowering/global-values.js +67 -9
  553. package/dist/frontend/lowering/global-values.js.map +1 -1
  554. package/dist/frontend/lowering/handle-properties.js +34 -1
  555. package/dist/frontend/lowering/handle-properties.js.map +1 -1
  556. package/dist/frontend/lowering/host-global-values.d.ts +31 -0
  557. package/dist/frontend/lowering/host-global-values.js +121 -0
  558. package/dist/frontend/lowering/host-global-values.js.map +1 -0
  559. package/dist/frontend/lowering/host-globals.d.ts +74 -0
  560. package/dist/frontend/lowering/host-globals.js +344 -0
  561. package/dist/frontend/lowering/host-globals.js.map +1 -0
  562. package/dist/frontend/lowering/http2-constants.js +1 -1
  563. package/dist/frontend/lowering/iterator-adapters.js +46 -17
  564. package/dist/frontend/lowering/iterator-adapters.js.map +1 -1
  565. package/dist/frontend/lowering/iterator-prototype.d.ts +30 -0
  566. package/dist/frontend/lowering/iterator-prototype.js +160 -0
  567. package/dist/frontend/lowering/iterator-prototype.js.map +1 -0
  568. package/dist/frontend/lowering/key-order-witness.d.ts +54 -0
  569. package/dist/frontend/lowering/key-order-witness.js +571 -9
  570. package/dist/frontend/lowering/key-order-witness.js.map +1 -1
  571. package/dist/frontend/lowering/key-order-witness.test.js +1 -0
  572. package/dist/frontend/lowering/key-order-witness.test.js.map +1 -1
  573. package/dist/frontend/lowering/lib-boundary.js +25 -3
  574. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  575. package/dist/frontend/lowering/lower-assert.js +140 -16
  576. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  577. package/dist/frontend/lowering/lower-async-iteration.d.ts +11 -0
  578. package/dist/frontend/lowering/lower-async-iteration.js +15 -0
  579. package/dist/frontend/lowering/lower-async-iteration.js.map +1 -1
  580. package/dist/frontend/lowering/lower-builtin-values.d.ts +36 -6
  581. package/dist/frontend/lowering/lower-builtin-values.js +342 -58
  582. package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
  583. package/dist/frontend/lowering/lower-calls.d.ts +47 -1
  584. package/dist/frontend/lowering/lower-calls.js +1354 -273
  585. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  586. package/dist/frontend/lowering/lower-calls.test.d.ts +1 -0
  587. package/dist/frontend/lowering/lower-calls.test.js +121 -0
  588. package/dist/frontend/lowering/lower-calls.test.js.map +1 -0
  589. package/dist/frontend/lowering/lower-classes.d.ts +36 -5
  590. package/dist/frontend/lowering/lower-classes.js +630 -89
  591. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  592. package/dist/frontend/lowering/lower-event-emitter.d.ts +15 -2
  593. package/dist/frontend/lowering/lower-event-emitter.js +610 -98
  594. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
  595. package/dist/frontend/lowering/lower-exprs.d.ts +15 -1
  596. package/dist/frontend/lowering/lower-exprs.js +96 -20
  597. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  598. package/dist/frontend/lowering/lower-functions.js +27 -6
  599. package/dist/frontend/lowering/lower-functions.js.map +1 -1
  600. package/dist/frontend/lowering/lower-generators.js +57 -10
  601. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  602. package/dist/frontend/lowering/lower-global-value.d.ts +6 -0
  603. package/dist/frontend/lowering/lower-global-value.js +14 -5
  604. package/dist/frontend/lowering/lower-global-value.js.map +1 -1
  605. package/dist/frontend/lowering/lower-inspect.d.ts +4 -0
  606. package/dist/frontend/lowering/lower-inspect.js +713 -92
  607. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  608. package/dist/frontend/lowering/lower-modules.js +135 -27
  609. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  610. package/dist/frontend/lowering/lower-namespaces.js +18 -0
  611. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  612. package/dist/frontend/lowering/lower-node-island.d.ts +35 -4
  613. package/dist/frontend/lowering/lower-node-island.js +472 -67
  614. package/dist/frontend/lowering/lower-node-island.js.map +1 -1
  615. package/dist/frontend/lowering/lower-server.js +463 -96
  616. package/dist/frontend/lowering/lower-server.js.map +1 -1
  617. package/dist/frontend/lowering/lower-shared-modules.js +13 -1
  618. package/dist/frontend/lowering/lower-shared-modules.js.map +1 -1
  619. package/dist/frontend/lowering/lower-stdlib.d.ts +3 -2
  620. package/dist/frontend/lowering/lower-stdlib.js +77 -18
  621. package/dist/frontend/lowering/lower-stdlib.js.map +1 -1
  622. package/dist/frontend/lowering/lower-stmts.d.ts +24 -4
  623. package/dist/frontend/lowering/lower-stmts.js +831 -136
  624. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  625. package/dist/frontend/lowering/lower-stream.js +126 -8
  626. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  627. package/dist/frontend/lowering/lower-timers.js +243 -48
  628. package/dist/frontend/lowering/lower-timers.js.map +1 -1
  629. package/dist/frontend/lowering/lower-url.js +6 -3
  630. package/dist/frontend/lowering/lower-url.js.map +1 -1
  631. package/dist/frontend/lowering/lowerer.d.ts +363 -21
  632. package/dist/frontend/lowering/lowerer.js +1224 -129
  633. package/dist/frontend/lowering/lowerer.js.map +1 -1
  634. package/dist/frontend/lowering/lowerer.test.js +19 -1
  635. package/dist/frontend/lowering/lowerer.test.js.map +1 -1
  636. package/dist/frontend/lowering/lowering-facts.d.ts +110 -0
  637. package/dist/frontend/lowering/lowering-facts.js +323 -0
  638. package/dist/frontend/lowering/lowering-facts.js.map +1 -0
  639. package/dist/frontend/lowering/lowering-facts.test.d.ts +1 -0
  640. package/dist/frontend/lowering/lowering-facts.test.js +100 -0
  641. package/dist/frontend/lowering/lowering-facts.test.js.map +1 -0
  642. package/dist/frontend/lowering/module-namespace-elements.js +15 -0
  643. package/dist/frontend/lowering/module-namespace-elements.js.map +1 -1
  644. package/dist/frontend/lowering/nan-coded-reads.d.ts +27 -4
  645. package/dist/frontend/lowering/nan-coded-reads.js +112 -9
  646. package/dist/frontend/lowering/nan-coded-reads.js.map +1 -1
  647. package/dist/frontend/lowering/new-target.js +2 -2
  648. package/dist/frontend/lowering/nullish-empty-pattern.d.ts +17 -0
  649. package/dist/frontend/lowering/nullish-empty-pattern.js +118 -0
  650. package/dist/frontend/lowering/nullish-empty-pattern.js.map +1 -0
  651. package/dist/frontend/lowering/optional-arguments.d.ts +4 -0
  652. package/dist/frontend/lowering/optional-arguments.js +26 -2
  653. package/dist/frontend/lowering/optional-arguments.js.map +1 -1
  654. package/dist/frontend/lowering/partial-assertions.d.ts +36 -0
  655. package/dist/frontend/lowering/partial-assertions.js +189 -0
  656. package/dist/frontend/lowering/partial-assertions.js.map +1 -0
  657. package/dist/frontend/lowering/primitive-throws.d.ts +100 -0
  658. package/dist/frontend/lowering/primitive-throws.js +241 -0
  659. package/dist/frontend/lowering/primitive-throws.js.map +1 -0
  660. package/dist/frontend/lowering/primitive-wrappers.d.ts +34 -0
  661. package/dist/frontend/lowering/primitive-wrappers.js +221 -0
  662. package/dist/frontend/lowering/primitive-wrappers.js.map +1 -0
  663. package/dist/frontend/lowering/private-statics.d.ts +46 -0
  664. package/dist/frontend/lowering/private-statics.js +322 -0
  665. package/dist/frontend/lowering/private-statics.js.map +1 -0
  666. package/dist/frontend/lowering/record-inherited.d.ts +17 -1
  667. package/dist/frontend/lowering/record-inherited.js +16 -2
  668. package/dist/frontend/lowering/record-inherited.js.map +1 -1
  669. package/dist/frontend/lowering/record-links.d.ts +73 -0
  670. package/dist/frontend/lowering/record-links.js +797 -0
  671. package/dist/frontend/lowering/record-links.js.map +1 -0
  672. package/dist/frontend/lowering/record-sources.d.ts +12 -1
  673. package/dist/frontend/lowering/record-sources.js +60 -0
  674. package/dist/frontend/lowering/record-sources.js.map +1 -1
  675. package/dist/frontend/lowering/runtime-optional-provenance.d.ts +27 -7
  676. package/dist/frontend/lowering/runtime-optional-provenance.js +25 -11
  677. package/dist/frontend/lowering/runtime-optional-provenance.js.map +1 -1
  678. package/dist/frontend/lowering/runtime-optional-report.d.ts +40 -0
  679. package/dist/frontend/lowering/runtime-optional-report.js +300 -0
  680. package/dist/frontend/lowering/runtime-optional-report.js.map +1 -0
  681. package/dist/frontend/lowering/scoped-type-memo.test.d.ts +1 -0
  682. package/dist/frontend/lowering/scoped-type-memo.test.js +86 -0
  683. package/dist/frontend/lowering/scoped-type-memo.test.js.map +1 -0
  684. package/dist/frontend/lowering/static-typeof.d.ts +3 -1
  685. package/dist/frontend/lowering/static-typeof.js +6 -1
  686. package/dist/frontend/lowering/static-typeof.js.map +1 -1
  687. package/dist/frontend/lowering/strict-equality.d.ts +4 -0
  688. package/dist/frontend/lowering/strict-equality.js +14 -0
  689. package/dist/frontend/lowering/strict-equality.js.map +1 -1
  690. package/dist/frontend/lowering/strict-mode.d.ts +1 -5
  691. package/dist/frontend/lowering/strict-mode.js +4 -30
  692. package/dist/frontend/lowering/strict-mode.js.map +1 -1
  693. package/dist/frontend/lowering/structural-instances.d.ts +7 -0
  694. package/dist/frontend/lowering/structural-instances.js +23 -0
  695. package/dist/frontend/lowering/structural-instances.js.map +1 -1
  696. package/dist/frontend/lowering/surfaces.d.ts +42 -1
  697. package/dist/frontend/lowering/surfaces.js +212 -71
  698. package/dist/frontend/lowering/surfaces.js.map +1 -1
  699. package/dist/frontend/lowering/union-retag.d.ts +13 -1
  700. package/dist/frontend/lowering/union-retag.js +55 -1
  701. package/dist/frontend/lowering/union-retag.js.map +1 -1
  702. package/dist/frontend/lowering/union-retag.test.js +51 -0
  703. package/dist/frontend/lowering/union-retag.test.js.map +1 -1
  704. package/dist/frontend/lowering/unit-journal.d.ts +136 -17
  705. package/dist/frontend/lowering/unit-journal.js +324 -53
  706. package/dist/frontend/lowering/unit-journal.js.map +1 -1
  707. package/dist/frontend/lowering/unit-journal.test.js +126 -3
  708. package/dist/frontend/lowering/unit-journal.test.js.map +1 -1
  709. package/dist/frontend/lowering/unit-reuse.d.ts +92 -0
  710. package/dist/frontend/lowering/unit-reuse.js +1008 -0
  711. package/dist/frontend/lowering/unit-reuse.js.map +1 -0
  712. package/dist/frontend/lowering/width-lift.d.ts +12 -0
  713. package/dist/frontend/lowering/zlib-constants.js +3 -2
  714. package/dist/frontend/lowering/zlib-constants.js.map +1 -1
  715. package/dist/frontend/npm-file-import.test.d.ts +1 -0
  716. package/dist/frontend/npm-file-import.test.js +76 -0
  717. package/dist/frontend/npm-file-import.test.js.map +1 -0
  718. package/dist/frontend/npm-static.js +95 -11
  719. package/dist/frontend/npm-static.js.map +1 -1
  720. package/dist/frontend/npm-static.test.js +95 -2
  721. package/dist/frontend/npm-static.test.js.map +1 -1
  722. package/dist/frontend/npm.d.ts +9 -0
  723. package/dist/frontend/npm.js +82 -0
  724. package/dist/frontend/npm.js.map +1 -1
  725. package/dist/frontend/pipeline-native.js +2 -1
  726. package/dist/frontend/pipeline-native.js.map +1 -1
  727. package/dist/frontend/pipeline.d.ts +9 -4
  728. package/dist/frontend/pipeline.js +162 -38
  729. package/dist/frontend/pipeline.js.map +1 -1
  730. package/dist/frontend/pipeline.test.js +68 -11
  731. package/dist/frontend/pipeline.test.js.map +1 -1
  732. package/dist/frontend/program-node.d.ts +3 -0
  733. package/dist/frontend/program-node.js +13 -6
  734. package/dist/frontend/program-node.js.map +1 -1
  735. package/dist/frontend/program.d.ts +71 -2
  736. package/dist/frontend/program.js +836 -411
  737. package/dist/frontend/program.js.map +1 -1
  738. package/dist/frontend/program.test.js +37 -1
  739. package/dist/frontend/program.test.js.map +1 -1
  740. package/dist/frontend/provenance-core.js +4 -0
  741. package/dist/frontend/provenance-core.js.map +1 -1
  742. package/dist/frontend/services-node.d.ts +7 -0
  743. package/dist/frontend/services-node.js +32 -1
  744. package/dist/frontend/services-node.js.map +1 -1
  745. package/dist/frontend/services-node.test.js +51 -0
  746. package/dist/frontend/services-node.test.js.map +1 -1
  747. package/dist/frontend/services.d.ts +14 -0
  748. package/dist/frontend/services.js +52 -2
  749. package/dist/frontend/services.js.map +1 -1
  750. package/dist/frontend/services.test.js +61 -1
  751. package/dist/frontend/services.test.js.map +1 -1
  752. package/dist/frontend/shape-inference/analyze.d.ts +5 -0
  753. package/dist/frontend/shape-inference/analyze.js +104 -4
  754. package/dist/frontend/shape-inference/analyze.js.map +1 -1
  755. package/dist/frontend/shape-inference/domain.js +0 -1
  756. package/dist/frontend/shape-inference/domain.js.map +1 -1
  757. package/dist/frontend/shape-inference/index.js +5 -1
  758. package/dist/frontend/shape-inference/index.js.map +1 -1
  759. package/dist/frontend/shape-inference/memo.d.ts +2 -1
  760. package/dist/frontend/shape-inference/memo.js +6 -2
  761. package/dist/frontend/shape-inference/memo.js.map +1 -1
  762. package/dist/frontend/shape-inference/overlay.d.ts +1 -1
  763. package/dist/frontend/shape-inference/overlay.js +184 -4
  764. package/dist/frontend/shape-inference/overlay.js.map +1 -1
  765. package/dist/frontend/shape-inference/static-objects.js +11 -6
  766. package/dist/frontend/shape-inference/static-objects.js.map +1 -1
  767. package/dist/frontend/source-phase-imports.test.d.ts +1 -0
  768. package/dist/frontend/source-phase-imports.test.js +37 -0
  769. package/dist/frontend/source-phase-imports.test.js.map +1 -0
  770. package/dist/frontend/tier-analysis.d.ts +9 -0
  771. package/dist/frontend/tier-analysis.js +1 -0
  772. package/dist/frontend/tier-analysis.js.map +1 -1
  773. package/dist/frontend/ts7/ast-node.d.ts +6 -1
  774. package/dist/frontend/ts7/ast-node.js +12 -0
  775. package/dist/frontend/ts7/ast-node.js.map +1 -1
  776. package/dist/frontend/ts7/ast-wire-protocols.test.js +11 -3
  777. package/dist/frontend/ts7/ast-wire-protocols.test.js.map +1 -1
  778. package/dist/frontend/ts7/ast-wire.js +3 -5
  779. package/dist/frontend/ts7/ast-wire.js.map +1 -1
  780. package/dist/frontend/ts7/checker-backend.d.ts +13 -0
  781. package/dist/frontend/ts7/checker-backend.js +84 -2
  782. package/dist/frontend/ts7/checker-backend.js.map +1 -1
  783. package/dist/frontend/ts7/checker-backend.test.js +126 -2
  784. package/dist/frontend/ts7/checker-backend.test.js.map +1 -1
  785. package/dist/frontend/ts7/program-host.d.ts +22 -1
  786. package/dist/frontend/ts7/program-host.js +49 -4
  787. package/dist/frontend/ts7/program-host.js.map +1 -1
  788. package/dist/frontend/ts7/program-host.test.js +83 -0
  789. package/dist/frontend/ts7/program-host.test.js.map +1 -1
  790. package/dist/frontend/ts7/rpc-process.d.ts +16 -1
  791. package/dist/frontend/ts7/rpc-process.js +170 -92
  792. package/dist/frontend/ts7/rpc-process.js.map +1 -1
  793. package/dist/frontend/ts7/rpc-process.test.js +49 -21
  794. package/dist/frontend/ts7/rpc-process.test.js.map +1 -1
  795. package/dist/frontend/tsc-codes.d.ts +57 -3
  796. package/dist/frontend/tsc-codes.js +956 -101
  797. package/dist/frontend/tsc-codes.js.map +1 -1
  798. package/dist/frontend/tsc-codes.test.js +221 -12
  799. package/dist/frontend/tsc-codes.test.js.map +1 -1
  800. package/dist/frontend/type-mapper.d.ts +98 -11
  801. package/dist/frontend/type-mapper.js +770 -182
  802. package/dist/frontend/type-mapper.js.map +1 -1
  803. package/dist/index.d.ts +1 -1
  804. package/dist/index.js +224 -15
  805. package/dist/index.js.map +1 -1
  806. package/dist/index.test.d.ts +1 -0
  807. package/dist/index.test.js +60 -0
  808. package/dist/index.test.js.map +1 -0
  809. package/dist/ir/api.d.ts +1 -1
  810. package/dist/ir/api.js +1 -1
  811. package/dist/ir/api.js.map +1 -1
  812. package/dist/ir/build.d.ts +3 -2
  813. package/dist/ir/build.js +4 -2
  814. package/dist/ir/build.js.map +1 -1
  815. package/dist/ir/builtin-effects.js +96 -0
  816. package/dist/ir/builtin-effects.js.map +1 -1
  817. package/dist/ir/builtin-signatures.d.ts +1 -1
  818. package/dist/ir/builtin-signatures.js +453 -26
  819. package/dist/ir/builtin-signatures.js.map +1 -1
  820. package/dist/ir/callback-specialization.d.ts +3 -2
  821. package/dist/ir/callback-specialization.js +35 -25
  822. package/dist/ir/callback-specialization.js.map +1 -1
  823. package/dist/ir/capture-values.d.ts +8 -4
  824. package/dist/ir/capture-values.js +9 -6
  825. package/dist/ir/capture-values.js.map +1 -1
  826. package/dist/ir/char-unit-locals.d.ts +6 -2
  827. package/dist/ir/char-unit-locals.js +11 -2
  828. package/dist/ir/char-unit-locals.js.map +1 -1
  829. package/dist/ir/class-key-index.d.ts +18 -0
  830. package/dist/ir/class-key-index.js +29 -0
  831. package/dist/ir/class-key-index.js.map +1 -0
  832. package/dist/ir/class-key-index.test.d.ts +1 -0
  833. package/dist/ir/class-key-index.test.js +25 -0
  834. package/dist/ir/class-key-index.test.js.map +1 -0
  835. package/dist/ir/codec.d.ts +82 -0
  836. package/dist/ir/codec.generated.d.ts +13 -0
  837. package/dist/ir/codec.generated.js +5350 -0
  838. package/dist/ir/codec.generated.js.map +1 -0
  839. package/dist/ir/codec.js +325 -0
  840. package/dist/ir/codec.js.map +1 -0
  841. package/dist/ir/codec.test.d.ts +1 -0
  842. package/dist/ir/codec.test.js +225 -0
  843. package/dist/ir/codec.test.js.map +1 -0
  844. package/dist/ir/constant-globals.d.ts +5 -2
  845. package/dist/ir/constant-globals.js +25 -27
  846. package/dist/ir/constant-globals.js.map +1 -1
  847. package/dist/ir/expression-inlining.d.ts +4 -2
  848. package/dist/ir/expression-inlining.js +8 -2
  849. package/dist/ir/expression-inlining.js.map +1 -1
  850. package/dist/ir/field-values.d.ts +5 -2
  851. package/dist/ir/field-values.js +32 -21
  852. package/dist/ir/field-values.js.map +1 -1
  853. package/dist/ir/fields.generated.d.ts +29 -10
  854. package/dist/ir/fields.generated.js +1039 -11
  855. package/dist/ir/fields.generated.js.map +1 -1
  856. package/dist/ir/fields.test.js +46 -2
  857. package/dist/ir/fields.test.js.map +1 -1
  858. package/dist/ir/final-fields.js +1 -1
  859. package/dist/ir/final-fields.js.map +1 -1
  860. package/dist/ir/function-references.d.ts +6 -4
  861. package/dist/ir/function-references.js +11 -4
  862. package/dist/ir/function-references.js.map +1 -1
  863. package/dist/ir/function-references.test.js +14 -0
  864. package/dist/ir/function-references.test.js.map +1 -1
  865. package/dist/ir/init-only-globals.d.ts +4 -2
  866. package/dist/ir/init-only-globals.js +17 -18
  867. package/dist/ir/init-only-globals.js.map +1 -1
  868. package/dist/ir/inline-array-sources.js +4 -1
  869. package/dist/ir/inline-array-sources.js.map +1 -1
  870. package/dist/ir/inline-array-views.d.ts +13 -0
  871. package/dist/ir/inline-array-views.js +945 -0
  872. package/dist/ir/inline-array-views.js.map +1 -0
  873. package/dist/ir/inline-arrays.d.ts +7 -0
  874. package/dist/ir/inline-arrays.js +190 -55
  875. package/dist/ir/inline-arrays.js.map +1 -1
  876. package/dist/ir/inline-arrays.test.js +140 -2
  877. package/dist/ir/inline-arrays.test.js.map +1 -1
  878. package/dist/ir/int32-slots.js +7 -0
  879. package/dist/ir/int32-slots.js.map +1 -1
  880. package/dist/ir/integer-ranges.js +16 -6
  881. package/dist/ir/integer-ranges.js.map +1 -1
  882. package/dist/ir/ir.d.ts +130 -44
  883. package/dist/ir/ir.js +7 -0
  884. package/dist/ir/ir.js.map +1 -1
  885. package/dist/ir/js-groups.d.ts +51 -0
  886. package/dist/ir/js-groups.js +394 -0
  887. package/dist/ir/js-groups.js.map +1 -0
  888. package/dist/ir/js-groups.test.d.ts +1 -0
  889. package/dist/ir/js-groups.test.js +555 -0
  890. package/dist/ir/js-groups.test.js.map +1 -0
  891. package/dist/ir/js-ic.d.ts +10 -9
  892. package/dist/ir/js-ic.js +58 -25
  893. package/dist/ir/js-ic.js.map +1 -1
  894. package/dist/ir/js-ic.test.js +37 -3
  895. package/dist/ir/js-ic.test.js.map +1 -1
  896. package/dist/ir/jsval.js +374 -63
  897. package/dist/ir/jsval.js.map +1 -1
  898. package/dist/ir/jsval.test.js +96 -2
  899. package/dist/ir/jsval.test.js.map +1 -1
  900. package/dist/ir/loop-entry-ranges.js +112 -9
  901. package/dist/ir/loop-entry-ranges.js.map +1 -1
  902. package/dist/ir/loop-entry-ranges.test.js +40 -0
  903. package/dist/ir/loop-entry-ranges.test.js.map +1 -1
  904. package/dist/ir/node-index.d.ts +23 -6
  905. package/dist/ir/node-index.js +126 -49
  906. package/dist/ir/node-index.js.map +1 -1
  907. package/dist/ir/numeric-call-specialization.d.ts +4 -2
  908. package/dist/ir/numeric-call-specialization.js +40 -26
  909. package/dist/ir/numeric-call-specialization.js.map +1 -1
  910. package/dist/ir/paired-while-loops.d.ts +4 -2
  911. package/dist/ir/paired-while-loops.js +8 -2
  912. package/dist/ir/paired-while-loops.js.map +1 -1
  913. package/dist/ir/parameter-versions.d.ts +13 -3
  914. package/dist/ir/parameter-versions.js +63 -40
  915. package/dist/ir/parameter-versions.js.map +1 -1
  916. package/dist/ir/property-bags.d.ts +4 -2
  917. package/dist/ir/property-bags.js +22 -17
  918. package/dist/ir/property-bags.js.map +1 -1
  919. package/dist/ir/receiver-readers.js +58 -2
  920. package/dist/ir/receiver-readers.js.map +1 -1
  921. package/dist/ir/row-pairs.d.ts +4 -2
  922. package/dist/ir/row-pairs.js +12 -11
  923. package/dist/ir/row-pairs.js.map +1 -1
  924. package/dist/ir/runtime-features.d.ts +139 -5
  925. package/dist/ir/runtime-features.js +397 -19
  926. package/dist/ir/runtime-features.js.map +1 -1
  927. package/dist/ir/runtime-features.test.js +135 -1
  928. package/dist/ir/runtime-features.test.js.map +1 -1
  929. package/dist/ir/runtime-jam-loops.d.ts +35 -0
  930. package/dist/ir/runtime-jam-loops.js +604 -0
  931. package/dist/ir/runtime-jam-loops.js.map +1 -0
  932. package/dist/ir/runtime-jam-loops.test.d.ts +1 -0
  933. package/dist/ir/runtime-jam-loops.test.js +565 -0
  934. package/dist/ir/runtime-jam-loops.test.js.map +1 -0
  935. package/dist/ir/saturating-loop-jams.d.ts +11 -2
  936. package/dist/ir/saturating-loop-jams.js +56 -16
  937. package/dist/ir/saturating-loop-jams.js.map +1 -1
  938. package/dist/ir/saturating-loop-jams.test.js +39 -1
  939. package/dist/ir/saturating-loop-jams.test.js.map +1 -1
  940. package/dist/ir/scalar-records.d.ts +5 -2
  941. package/dist/ir/scalar-records.js +12 -2
  942. package/dist/ir/scalar-records.js.map +1 -1
  943. package/dist/ir/self-captures.d.ts +4 -2
  944. package/dist/ir/self-captures.js +40 -28
  945. package/dist/ir/self-captures.js.map +1 -1
  946. package/dist/ir/self-captures.test.js +15 -0
  947. package/dist/ir/self-captures.test.js.map +1 -1
  948. package/dist/ir/serialize.d.ts +8 -2
  949. package/dist/ir/serialize.js +92 -24
  950. package/dist/ir/serialize.js.map +1 -1
  951. package/dist/ir/serialize.test.js +26 -0
  952. package/dist/ir/serialize.test.js.map +1 -1
  953. package/dist/ir/tiers.js +1 -0
  954. package/dist/ir/tiers.js.map +1 -1
  955. package/dist/ir/traverse.js +4 -0
  956. package/dist/ir/traverse.js.map +1 -1
  957. package/dist/ir/typed-argument-clones.d.ts +30 -0
  958. package/dist/ir/typed-argument-clones.js +789 -0
  959. package/dist/ir/typed-argument-clones.js.map +1 -0
  960. package/dist/ir/union-arm-loops.d.ts +3 -0
  961. package/dist/ir/union-arm-loops.js +373 -0
  962. package/dist/ir/union-arm-loops.js.map +1 -0
  963. package/dist/ir/union-arm-loops.test.d.ts +1 -0
  964. package/dist/ir/union-arm-loops.test.js +230 -0
  965. package/dist/ir/union-arm-loops.test.js.map +1 -0
  966. package/dist/ir/validate.js +170 -22
  967. package/dist/ir/validate.js.map +1 -1
  968. package/dist/ir/validate.test.js +46 -0
  969. package/dist/ir/validate.test.js.map +1 -1
  970. package/dist/library/compiler-self-identity.d.ts +8 -2
  971. package/dist/library/compiler-self-identity.js +92 -18
  972. package/dist/library/compiler-self-identity.js.map +1 -1
  973. package/dist/library/compiler-self-identity.test.js +150 -3
  974. package/dist/library/compiler-self-identity.test.js.map +1 -1
  975. package/dist/library/int-infer.d.ts +5 -0
  976. package/dist/library/int-infer.js +15 -3
  977. package/dist/library/int-infer.js.map +1 -1
  978. package/dist/library/ir-policy.js +4 -0
  979. package/dist/library/ir-policy.js.map +1 -1
  980. package/dist/library/library-cache.d.ts +4 -0
  981. package/dist/library/library-cache.js +2 -0
  982. package/dist/library/library-cache.js.map +1 -1
  983. package/dist/library/library-cache.test.js +26 -0
  984. package/dist/library/library-cache.test.js.map +1 -1
  985. package/dist/library/prepare.js +99 -31
  986. package/dist/library/prepare.js.map +1 -1
  987. package/dist/native/cache.d.ts +7 -0
  988. package/dist/native/cache.js +49 -0
  989. package/dist/native/cache.js.map +1 -1
  990. package/dist/native/cache.test.js +13 -1
  991. package/dist/native/cache.test.js.map +1 -1
  992. package/dist/native/cli.js +2 -0
  993. package/dist/native/cli.js.map +1 -1
  994. package/dist/native/compiler.js +26 -5
  995. package/dist/native/compiler.js.map +1 -1
  996. package/dist/native/executable-cache-open.test.js +31 -5
  997. package/dist/native/executable-cache-open.test.js.map +1 -1
  998. package/dist/native/executable-cache.d.ts +6 -1
  999. package/dist/native/executable-cache.js +7 -1
  1000. package/dist/native/executable-cache.js.map +1 -1
  1001. package/dist/native/prepare.d.ts +3 -0
  1002. package/dist/native/prepare.js +74 -28
  1003. package/dist/native/prepare.js.map +1 -1
  1004. package/dist/native/prepare.test.js +25 -3
  1005. package/dist/native/prepare.test.js.map +1 -1
  1006. package/dist/native/sanitizer.js +63 -4
  1007. package/dist/native/sanitizer.js.map +1 -1
  1008. package/dist/native/sanitizer.test.js +93 -2
  1009. package/dist/native/sanitizer.test.js.map +1 -1
  1010. package/dist/native/toolchain.js +9 -2
  1011. package/dist/native/toolchain.js.map +1 -1
  1012. package/dist/node-islands/boundary.d.ts +37 -1
  1013. package/dist/node-islands/boundary.js +65 -7
  1014. package/dist/node-islands/boundary.js.map +1 -1
  1015. package/dist/node-islands/boundary.test.d.ts +1 -0
  1016. package/dist/node-islands/boundary.test.js +76 -0
  1017. package/dist/node-islands/boundary.test.js.map +1 -0
  1018. package/dist/node-islands/detect.d.ts +27 -1
  1019. package/dist/node-islands/detect.js +475 -40
  1020. package/dist/node-islands/detect.js.map +1 -1
  1021. package/dist/node-islands/detect.test.js +175 -4
  1022. package/dist/node-islands/detect.test.js.map +1 -1
  1023. package/dist/node-islands/effect-gate.js +30 -20
  1024. package/dist/node-islands/effect-gate.js.map +1 -1
  1025. package/dist/node-islands/effect-gate.test.js +4 -1
  1026. package/dist/node-islands/effect-gate.test.js.map +1 -1
  1027. package/dist/node-islands/graph-islands.d.ts +40 -0
  1028. package/dist/node-islands/graph-islands.js +128 -0
  1029. package/dist/node-islands/graph-islands.js.map +1 -0
  1030. package/dist/node-islands/growth.d.ts +57 -0
  1031. package/dist/node-islands/growth.js +205 -0
  1032. package/dist/node-islands/growth.js.map +1 -0
  1033. package/dist/node-islands/libnode.d.ts +1 -1
  1034. package/dist/node-islands/libnode.js +1 -1
  1035. package/dist/node-islands/libnode.js.map +1 -1
  1036. package/dist/node-islands/modules.d.ts +28 -0
  1037. package/dist/node-islands/modules.js +156 -0
  1038. package/dist/node-islands/modules.js.map +1 -1
  1039. package/dist/node-islands/modules.test.js +105 -1
  1040. package/dist/node-islands/modules.test.js.map +1 -1
  1041. package/dist/node-islands/policy.js +2 -3
  1042. package/dist/node-islands/policy.js.map +1 -1
  1043. package/dist/node-islands/probe-recorder.d.ts +1 -0
  1044. package/dist/node-islands/probe-recorder.js +596 -0
  1045. package/dist/node-islands/probe-recorder.js.map +1 -0
  1046. package/dist/node-islands/probe-recorder.test.d.ts +1 -0
  1047. package/dist/node-islands/probe-recorder.test.js +80 -0
  1048. package/dist/node-islands/probe-recorder.test.js.map +1 -0
  1049. package/dist/node-islands/report.d.ts +12 -0
  1050. package/dist/node-islands/report.js +28 -0
  1051. package/dist/node-islands/report.js.map +1 -1
  1052. package/dist/node-islands/report.test.js +4 -0
  1053. package/dist/node-islands/report.test.js.map +1 -1
  1054. package/dist/node-islands/rules.js +9 -0
  1055. package/dist/node-islands/rules.js.map +1 -1
  1056. package/dist/node-islands/scan.d.ts +16 -1
  1057. package/dist/node-islands/scan.js +110 -9
  1058. package/dist/node-islands/scan.js.map +1 -1
  1059. package/dist/node-islands/snapshot.d.ts +38 -1
  1060. package/dist/node-islands/snapshot.js +165 -161
  1061. package/dist/node-islands/snapshot.js.map +1 -1
  1062. package/dist/node-islands/snapshot.test.js +63 -2
  1063. package/dist/node-islands/snapshot.test.js.map +1 -1
  1064. package/dist/node-islands/summary.js +8 -0
  1065. package/dist/node-islands/summary.js.map +1 -1
  1066. package/dist/node-islands/type-strip.d.ts +11 -0
  1067. package/dist/node-islands/type-strip.js +157 -0
  1068. package/dist/node-islands/type-strip.js.map +1 -0
  1069. package/dist/node-islands/type-strip.test.d.ts +1 -0
  1070. package/dist/node-islands/type-strip.test.js +31 -0
  1071. package/dist/node-islands/type-strip.test.js.map +1 -0
  1072. package/dist/project-config.d.ts +4 -0
  1073. package/dist/project-config.js +19 -0
  1074. package/dist/project-config.js.map +1 -1
  1075. package/dist/project-config.test.js +10 -0
  1076. package/dist/project-config.test.js.map +1 -1
  1077. package/dist/wasm/translate.js +11 -5
  1078. package/dist/wasm/translate.js.map +1 -1
  1079. package/dist/wasm/translate.test.js +35 -0
  1080. package/dist/wasm/translate.test.js.map +1 -1
  1081. package/package.json +20 -20
  1082. package/surface-manifest.json +221 -122
@@ -1,3 +1,4 @@
1
+ import * as ts from "./ts7/adapter.js";
1
2
  /** Compiler options adopted from the project during preflight. */
2
3
  export const ADOPTED_OPTIONS = [
3
4
  "strict",
@@ -35,127 +36,981 @@ export const ADOPTED_OPTIONS = [
35
36
  "jsxImportSource",
36
37
  "reactNamespace",
37
38
  ];
38
- export const JS_RELAXED_TSC_CODES = new Set([
39
+ const CHECKER = (why, corpus) => ({
40
+ view: "checker",
41
+ why,
42
+ corpus: corpus ?? [],
43
+ });
44
+ /** `widen`: the diagnostic names a binding or member whose storage and reads
45
+ * become checked-dynamic (jsWidenedBindings / runtimeOptionalBindingTypes). */
46
+ const WIDEN = (why, corpus) => ({
47
+ view: "widen",
48
+ why,
49
+ corpus: corpus ?? [],
50
+ });
51
+ /** `throw`: the site lowers to Node's exception. */
52
+ const THROW = (why, corpus) => ({
53
+ view: "throw",
54
+ why,
55
+ corpus: corpus ?? [],
56
+ });
57
+ /** The row applies only where its guard holds; the code's TRIAGE_ROWS row
58
+ * stays for every other site. */
59
+ const at = (site, row) => ({ ...row, site });
60
+ /** A checked JavaScript file keeps this diagnostic. */
61
+ const inCheckedJs = (row) => ({ ...row, checkedJs: "enforce" });
62
+ /* ---- the site guards ---- */
63
+ /** TS7032 on a PRIVATE setter stays reported: the private-element lowering
64
+ * does not implement the shadowing and brand-check rules those programs
65
+ * exercise, so the program keeps refusing until that lowering exists. */
66
+ const notPrivateName = (node, d) => !ts.isPrivateIdentifier(node) && !ts.getSourceFileOfNode(node).text.startsWith("#", d.pos ?? -1);
67
+ /** TS2362/2363/2365 fire on an operator whose other operand is bigint-ish;
68
+ * plain JavaScript admits the `any` operand, and a primitive wrapper operand
69
+ * (`new Number(1) * 2`) converts with ToPrimitive like any object. */
70
+ const anyOrWrapperOperand = (_node, d) => {
71
+ const text = ts.flattenDiagnosticMessageText(d, "\n");
72
+ return text.includes("'any'") || /'(Number|String|Boolean)'/.test(text);
73
+ };
74
+ /** An index write on a String wrapper (`new String("ab")[5] = "q"`): Node
75
+ * adds the property past the end and ignores writes to the read-only index
76
+ * properties (sloppy) or throws (strict), as the object does. A write
77
+ * through any other readonly index signature keeps tsc's refusal. */
78
+ const stringWrapperReceiver = (_node, d) => ts.flattenDiagnosticMessageText(d, "\n").includes("type 'String'");
79
+ /** The deprecated `Buffer(...)` call without `new`, which Node's Buffer
80
+ * function accepts (containers/bytes.ts lowers it), `fs.ReadStream(...)` /
81
+ * `fs.WriteStream(...)`, which construct their stream
82
+ * (builtins/fs-streams.ts), and `Iterator()` (2348), which throws Node's
83
+ * TypeError at the call (iterator-prototype.ts). Every other class called
84
+ * without `new` keeps the triage's SC1090. */
85
+ const deprecatedBufferCall = (_node, d) => {
86
+ const text = ts.flattenDiagnosticMessageText(d, "\n");
87
+ return (text.includes("'BufferConstructor'") ||
88
+ text.includes("'typeof ReadStream'") ||
89
+ text.includes("'typeof WriteStream'") ||
90
+ text.includes("'IteratorConstructor'"));
91
+ };
92
+ /* ---- family reasons ---- */
93
+ const IMPLICIT_ANY = "a JavaScript value with no annotation is whatever the caller passes: Node has no types to check, and the lowering maps the value dynamically";
94
+ const NULLISH_DEMAND = "strict-null's demand is an inference, not a rule: Node reads whatever the value is, and the use site re-checks or throws as Node does";
95
+ const DYNAMIC_SHAPE = "assignability, arity and callability of an inferred shape are checker opinions: Node calls the value, and the lowering re-checks every lowered form per site";
96
+ const JSDOC_CLAIM = "a JSDoc type-space claim is documentation Node never reads: the values keep their runtime behavior and every use meets the per-site fences";
97
+ const OPINION_ROWS = [
39
98
  // implicit any (params, variables, elements, this, returns, rest,
40
- // construct signatures, index reads over shapes with no index
41
- // signature — typeof globalThis)
42
- 2683,
43
- 7005,
44
- 7006,
45
- 7008,
46
- 7009,
47
- 7010,
48
- 7015,
49
- 7017,
50
- 7019,
51
- 7022,
52
- 7023,
53
- 7024,
54
- 7031,
55
- 7034,
56
- 7053,
57
- // strict-null narrowing demands (possibly null/undefined receivers)
58
- 2531,
59
- 2532,
60
- 2533,
61
- 18047,
62
- 18048,
63
- 18049,
99
+ // construct signatures, index reads over shapes with no index signature —
100
+ // typeof globalThis)
101
+ [
102
+ 2683,
103
+ CHECKER(IMPLICIT_ANY, [
104
+ "tests/corpus/emitter-listener-this.cjs",
105
+ "tests/corpus/timers-callback-this.cjs",
106
+ ]),
107
+ ],
108
+ [
109
+ 7005,
110
+ CHECKER(IMPLICIT_ANY, [
111
+ "tests/corpus/8799-js-promise-statics-foreign-this.js",
112
+ "tests/corpus/7058-pipeline-function-stages.mjs",
113
+ ]),
114
+ ],
115
+ [
116
+ 7006,
117
+ CHECKER(IMPLICIT_ANY, [
118
+ "tests/corpus/7752-typed-array-dynamic-methods.js",
119
+ "tests/corpus/5548-fs-callback-arguments.cjs",
120
+ ]),
121
+ ],
122
+ [
123
+ 7008,
124
+ CHECKER(IMPLICIT_ANY, [
125
+ "tests/corpus/js-declared-fields.cjs",
126
+ "tests/corpus/js-inherited-field-storage.js",
127
+ ]),
128
+ ],
129
+ [
130
+ 7009,
131
+ CHECKER(IMPLICIT_ANY, [
132
+ "tests/corpus/6562-constructor-function-transform.cjs",
133
+ "tests/corpus/es5-constructor-inspect-names.cjs",
134
+ ]),
135
+ ],
136
+ [7010, CHECKER(IMPLICIT_ANY)],
137
+ [
138
+ 7015,
139
+ CHECKER(IMPLICIT_ANY, [
140
+ "tests/corpus/buffer-computed-members.js",
141
+ "tests/corpus/buffer-fs-member-reads.js",
142
+ ]),
143
+ ],
144
+ [
145
+ 7017,
146
+ CHECKER(IMPLICIT_ANY, [
147
+ "tests/corpus/7485-global-object-own-properties.js",
148
+ "tests/corpus/global-stored-probes.js",
149
+ ]),
150
+ ],
151
+ [
152
+ 7019,
153
+ CHECKER(IMPLICIT_ANY, [
154
+ "tests/corpus/2567-rest-spread-forward.js",
155
+ "tests/corpus/2568-rest-spread-forward-dynamic.js",
156
+ ]),
157
+ ],
158
+ [
159
+ 7022,
160
+ CHECKER(IMPLICIT_ANY, [
161
+ "tests/corpus/5114-var-hoisting-js.js",
162
+ "tests/corpus/1760-surplus-args-drop.cjs",
163
+ ]),
164
+ ],
165
+ [
166
+ 7023,
167
+ CHECKER(IMPLICIT_ANY, [
168
+ "tests/corpus/error-prototype-tostring.js",
169
+ "tests/corpus/function-custom-prototype.js",
170
+ ]),
171
+ ],
172
+ [
173
+ 7024,
174
+ CHECKER(IMPLICIT_ANY, [
175
+ "tests/corpus/7450-crypto-x25519.mjs",
176
+ "tests/corpus/7449-crypto-raw-keys.mjs",
177
+ ]),
178
+ ],
179
+ [
180
+ 7031,
181
+ CHECKER(IMPLICIT_ANY, [
182
+ "tests/corpus/inferred-partial-destructuring.mjs",
183
+ "tests/corpus/7437-duplex-from-signal.mjs",
184
+ ]),
185
+ ],
186
+ [
187
+ 7034,
188
+ CHECKER(IMPLICIT_ANY, [
189
+ "tests/corpus/8799-js-promise-statics-foreign-this.js",
190
+ "tests/corpus/5547-fs-write-stream.cjs",
191
+ ]),
192
+ ],
193
+ [
194
+ 7053,
195
+ CHECKER(IMPLICIT_ANY, [
196
+ "tests/corpus/1731-symbol-field-shapes.cjs",
197
+ "tests/corpus/global-symbol-cache/main.js",
198
+ ]),
199
+ ],
200
+ // strict-null narrowing demands (possibly null/undefined receivers) and
201
+ // the possibly-undefined values iterated or invoked
202
+ [
203
+ 2531,
204
+ CHECKER(NULLISH_DEMAND, [
205
+ "tests/corpus/8702-js-primitive-object-coercion.js",
206
+ "tests/corpus/js-module-function-values.js",
207
+ ]),
208
+ ],
209
+ [
210
+ 2532,
211
+ CHECKER(NULLISH_DEMAND, [
212
+ "tests/corpus/8905-groupby-dynamic-sources.js",
213
+ "tests/corpus/5923-matchall-groups-js.js",
214
+ ]),
215
+ ],
216
+ [2533, CHECKER(NULLISH_DEMAND)],
217
+ [
218
+ 18047,
219
+ CHECKER(NULLISH_DEMAND, [
220
+ "tests/corpus/fetch-body-web-stream-linked.mjs",
221
+ "tests/corpus/8799-js-promise-statics-foreign-this.js",
222
+ ]),
223
+ ],
224
+ [
225
+ 18048,
226
+ CHECKER(NULLISH_DEMAND, [
227
+ "tests/corpus/5923-matchall-groups-js.js",
228
+ "tests/corpus/8079-descriptor-object-shapes.cjs",
229
+ ]),
230
+ ],
231
+ [18049, CHECKER(NULLISH_DEMAND, ["tests/corpus/5303-stream-finished-callback-opts.cjs"])],
232
+ [
233
+ 2488,
234
+ CHECKER(NULLISH_DEMAND, [
235
+ "tests/corpus/2602-dyn-array-destructure.js",
236
+ "tests/corpus/8603-destructuring-catch-bindings.cjs",
237
+ ]),
238
+ ],
239
+ [2721, CHECKER(NULLISH_DEMAND, ["tests/corpus/8702-js-primitive-object-coercion.js"])],
240
+ [
241
+ 2722,
242
+ CHECKER(NULLISH_DEMAND, [
243
+ "tests/corpus/5909-iterator-helper-objects-js.js",
244
+ "tests/corpus/6072-iterator-sources-js.js",
245
+ ]),
246
+ ],
64
247
  // assignability/arity/callability of dynamic call shapes (valid JS,
65
248
  // checked at runtime by Node; the lowerer re-checks every lowered form
66
249
  // per site) and member/existence probes over dynamic shapes (expando
67
- // properties, capability probes — the lowerer fences unknown members
68
- // per site with the SC2020 family)
69
- 2322,
70
- 2339,
71
- 2345,
72
- 2349,
73
- 2351,
74
- 2367,
75
- 2554,
76
- 2555,
77
- 2556,
78
- 2769,
79
- 2740, // 2322's elaborated "missing the following properties" form
80
- 2559, // a value with no properties in common with an all-optional options type
81
- 2305,
82
- 2551,
83
- 2724,
84
- 2731,
250
+ // properties, capability probes — the lowerer fences unknown members per
251
+ // site with the SC2020 family). 2322/2345/2554/2555/2556/2559/2740/2741/
252
+ // 2769 are CODE-checked JavaScript's: a checked file keeps them.
253
+ [
254
+ 2322,
255
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
256
+ "tests/corpus/webassembly-jsapi.mjs",
257
+ "tests/corpus/webassembly-wpt-jsapi.mjs",
258
+ ])),
259
+ ],
260
+ [
261
+ 2339,
262
+ CHECKER(DYNAMIC_SHAPE, [
263
+ "tests/corpus/5548-fs-callback-arguments.cjs",
264
+ "tests/corpus/5549-fs-callback-option-checks.cjs",
265
+ ]),
266
+ ],
267
+ [
268
+ 2345,
269
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
270
+ "tests/corpus/webassembly-wpt-jsapi.mjs",
271
+ "tests/corpus/3035-string-positioned-search-value.js",
272
+ ])),
273
+ ],
274
+ [
275
+ 2349,
276
+ CHECKER(DYNAMIC_SHAPE, [
277
+ "tests/corpus/webassembly-api.mjs",
278
+ "tests/corpus/webassembly-jsapi.mjs",
279
+ ]),
280
+ ],
281
+ [
282
+ 2351,
283
+ CHECKER(DYNAMIC_SHAPE, [
284
+ "tests/corpus/6915-dynamic-builtin-construct.mjs",
285
+ "tests/corpus/typed-array-constructor-values.mjs",
286
+ ]),
287
+ ],
288
+ [
289
+ 2367,
290
+ CHECKER(DYNAMIC_SHAPE, [
291
+ "tests/corpus/stdio-values.mjs",
292
+ "tests/corpus/js-array-default-buffer.js",
293
+ ]),
294
+ ],
295
+ [
296
+ 2554,
297
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
298
+ "tests/corpus/2571-searchparams-arg-validation.cjs",
299
+ "tests/corpus/2597-dgram-send-ladders.cjs",
300
+ ])),
301
+ ],
302
+ [
303
+ 2555,
304
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
305
+ "tests/corpus/js-array-proto-array-likes.js",
306
+ "tests/corpus/3044-array-slice-splice-positions.js",
307
+ ])),
308
+ ],
309
+ [
310
+ 2556,
311
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
312
+ "tests/corpus/5216-perf-spread-arguments.js",
313
+ "tests/corpus/class-super-surplus-spread.mjs",
314
+ ])),
315
+ ],
316
+ [
317
+ 2769,
318
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
319
+ "tests/corpus/7445-crypto-key-pair-options.mjs",
320
+ "tests/corpus/5254-cipher-errors.js",
321
+ ])),
322
+ ],
323
+ [
324
+ 2740,
325
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
326
+ "tests/corpus/6295-jose-hs256/main.mjs",
327
+ "tests/corpus/js-array-default-buffer.js",
328
+ ])),
329
+ ], // 2322's elaborated form
330
+ [
331
+ 2741,
332
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
333
+ "tests/corpus/webassembly-jsapi.mjs",
334
+ "tests/corpus/5446-crypto-secret-key-errors.js",
335
+ ])),
336
+ ], // 2740's sibling elaboration
337
+ [
338
+ 2559,
339
+ inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
340
+ "tests/corpus/7154-crypto-cipher-info.cjs",
341
+ "tests/corpus/5338-stream-operators-checks.cjs",
342
+ ])),
343
+ ],
344
+ [
345
+ 2305,
346
+ CHECKER(DYNAMIC_SHAPE, [
347
+ "tests/corpus/6431-cjs-exports-rebinding/main.cjs",
348
+ "tests/corpus/buffer-slowbuffer.cjs",
349
+ ]),
350
+ ],
351
+ [
352
+ 2551,
353
+ CHECKER(DYNAMIC_SHAPE, [
354
+ "tests/corpus/2595-fs-arg-ladders.cjs",
355
+ "tests/corpus/6704-ecdh-set-public-key.cjs",
356
+ ]),
357
+ ],
358
+ [2724, CHECKER(DYNAMIC_SHAPE)],
359
+ [2731, CHECKER(DYNAMIC_SHAPE, ["tests/corpus/native-proxy-env.js"])],
85
360
  // excess object-literal properties against a JSDoc-inferred contextual
86
361
  // type (and the did-you-mean variant): ordinary, working JS — the extra
87
- // key rides the object at runtime exactly as written (the formatter idiom's
88
- // expand-patterns passes an ignoreUnknown member its own JSDoc type
89
- // never declared)
90
- 2353,
91
- 2561,
362
+ // key rides the object at runtime exactly as written (the formatter
363
+ // idiom's expand-patterns passes an ignoreUnknown member its own JSDoc
364
+ // type never declared)
365
+ [
366
+ 2353,
367
+ CHECKER(JSDOC_CLAIM, [
368
+ "tests/corpus/5440-crypto-hash-encodings.js",
369
+ "tests/corpus/5939-js-let-object-reassigned-wider.js",
370
+ ]),
371
+ ],
372
+ [2561, CHECKER(JSDOC_CLAIM)],
92
373
  // JSDoc TYPE-SPACE claims that fail to check: a value name in a type
93
374
  // position (2749/2702), generic constraints and index types spelled in
94
375
  // typedefs (2344/2536/2538), an async @returns that is not Promise
95
376
  // (1064), and 2366's no-ending-return against a JSDoc-declared return
96
- // type. The claims are documentation — Node never reads them; the
97
- // values keep their runtime behavior and every use meets the per-site
98
- // fences (the pattern's source carries dozens of each).
99
- 2749,
100
- 2702,
101
- 2344,
102
- 2536,
103
- 2538,
104
- 1064,
105
- 2366,
106
- // strict-null demands on dynamic shapes, continued: iterating/invoking
107
- // possibly-undefined values (runtime re-checks at the site)
108
- 2488,
109
- 2721,
110
- 2722,
111
- // an UNUSED @ts-expect-error: the directive annotated an error visible
377
+ // type.
378
+ [2749, CHECKER(JSDOC_CLAIM)],
379
+ [2702, CHECKER(JSDOC_CLAIM)],
380
+ [2344, CHECKER(JSDOC_CLAIM)],
381
+ [2536, CHECKER(JSDOC_CLAIM)],
382
+ [
383
+ 2538,
384
+ CHECKER(JSDOC_CLAIM, [
385
+ "tests/corpus/8986-js-dynamic-key-element-read.js",
386
+ "tests/corpus/process-env-computed-keys.js",
387
+ ]),
388
+ ],
389
+ [1064, CHECKER(JSDOC_CLAIM)],
390
+ [2366, CHECKER(JSDOC_CLAIM, ["tests/corpus/js-object-receiver-storage.js"])],
391
+ // The async-iterator protocol demand (2504). Whether a value is
392
+ // async-iterable is a runtime fact of untyped JS, exactly like the sync
393
+ // demand: `for await` over a non-iterable value and `yield*` in an async
394
+ // generator both lower through the runtime protocol openers, which read
395
+ // the method, call it, and throw TypeError at the site when it is missing,
396
+ // uncallable, or returns a non-object — the same protocol failure Node
397
+ // reports. 2505 is the sync sibling on the typed lowering lanes and stays
398
+ // enforced.
399
+ [
400
+ 2504,
401
+ CHECKER("iteration membership is a runtime fact of untyped JS; the protocol openers read the method and throw Node's TypeError at the site"),
402
+ ],
403
+ // An UNUSED @ts-expect-error: the directive annotated an error visible
112
404
  // under the project's OWN tsconfig world — scriptc's world deliberately
113
405
  // differs (adopted options, hidden declaration twins), and an unused
114
- // suppression changes nothing at runtime
115
- 2578,
116
- // a lib-floor demand (es2024+ members under the es2023 lib): the member
406
+ // suppression changes nothing at runtime.
407
+ [
408
+ 2578,
409
+ CHECKER("an unused @ts-expect-error annotated an error only the project's own world has; nothing changes at runtime"),
410
+ ],
411
+ // A primitive on the left of instanceof (`"x" instanceof String`): Node
412
+ // answers false, which the lowering folds.
413
+ [
414
+ 2358,
415
+ CHECKER("a primitive operand's instanceof answers false, which the lowering folds", [
416
+ "tests/corpus/8868-class-static-has-instance-hook.js",
417
+ "tests/corpus/js-primitive-wrappers.js",
418
+ ]),
419
+ ],
420
+ // A lib-floor demand (es2024+ members under the es2023 lib): the member
117
421
  // types as the error-any and its use fences per site with the honest
118
- // no-lowering story instead of gating the whole program
119
- 2550,
422
+ // no-lowering story instead of gating the whole program.
423
+ [
424
+ 2550,
425
+ CHECKER("a lib-floor demand over a member the runtime may have: the member types as the error-any and its use fences per site"),
426
+ ],
120
427
  // `export *` ambiguity (2308): Node DEFINES this case — ambiguous names
121
428
  // are excluded from the star surface — where tsc asks for an explicit
122
- // re-export; and 2305's did-you-mean sibling 2614 joins 2305
123
- 2308,
124
- 2614,
125
- // 2740's sibling elaboration ("Property X is missing in type Y")
126
- 2741,
127
- // JavaScript subclasses may widen fields or add method parameters.
128
- // Class lowering checks native storage and override ABIs at each use.
129
- 2415,
130
- // a private or protected constructor (`new readline.Interface(...)`,
131
- // whose declaration is protected): JavaScript has no constructor
132
- // accessibility, and Node constructs the class. Each `new` meets the
133
- // lowerer's per-site constructor fences.
134
- 2673,
135
- 2674,
136
- // unresolvable modules: Node throws WHEN the require executes — the
137
- // binding types as any and reached uses fence instead of passing unchecked
138
- 2307,
139
- 2792,
429
+ // re-export; and 2305's did-you-mean sibling 2614 joins 2305.
430
+ [
431
+ 2308,
432
+ CHECKER("Node defines an ambiguous `export *`: the ambiguous names are excluded from the star surface"),
433
+ ],
434
+ [
435
+ 2614,
436
+ CHECKER("the did-you-mean spelling of a member the lowering resolves or fences at the site"),
437
+ ],
438
+ // JavaScript subclasses may widen fields or add method parameters. Class
439
+ // lowering checks native storage and override ABIs at each use.
440
+ [
441
+ 2415,
442
+ inCheckedJs(CHECKER("a JavaScript subclass may widen a field or add parameters; class lowering checks storage and override ABIs at each use", [
443
+ "tests/corpus/cjs-symbol-key-table/main.js",
444
+ "tests/corpus/js-nullish-inherited-fields.mjs",
445
+ ])),
446
+ ],
447
+ // A private or protected constructor (`new readline.Interface(...)`, whose
448
+ // declaration is protected): JavaScript has no constructor accessibility,
449
+ // and Node constructs the class. Each `new` meets the lowerer's per-site
450
+ // constructor fences.
451
+ [
452
+ 2673,
453
+ CHECKER("JavaScript has no constructor accessibility: Node constructs the class, and each `new` meets the per-site constructor fences"),
454
+ ],
455
+ [
456
+ 2674,
457
+ CHECKER("JavaScript has no constructor accessibility: Node constructs the class, and each `new` meets the per-site constructor fences", ["tests/corpus/8230-readline-interface-constructor.cjs"]),
458
+ ],
459
+ // Unresolvable modules: Node throws WHEN the require executes — the
460
+ // binding types as any and reached uses fence instead of passing
461
+ // unchecked.
462
+ [
463
+ 2307,
464
+ CHECKER("an unresolvable module fails when Node loads it: the binding types as any and reached uses fence", [
465
+ "tests/corpus/dynamic-import-not-found.mjs",
466
+ "tests/corpus/2195-require-missing-package/main.mjs",
467
+ ]),
468
+ ],
469
+ [
470
+ 2792,
471
+ CHECKER("an unresolvable module fails when Node loads it: the binding types as any and reached uses fence"),
472
+ ],
473
+ // A write to a property declarations mark readonly (2540): `readonly` is a
474
+ // type annotation that Node never sees (Next.js's types mark
475
+ // process.env.NODE_ENV readonly; its server.js assigns it); the write
476
+ // lowers like any other and keeps its runtime behavior.
477
+ [
478
+ 2540,
479
+ CHECKER("`readonly` is an annotation Node never sees: the write lowers like any other and keeps its runtime behavior"),
480
+ ],
481
+ // A resolved JavaScript module without declarations (7016): Node loads it
482
+ // like any other module; deployment trees such as Next.js standalone
483
+ // output ship runtime files only, so the binding types as any and its uses
484
+ // take the dynamic paths, as for 2307.
485
+ [
486
+ 7016,
487
+ CHECKER("a resolved JavaScript module without declarations loads like any other: the binding types as any and its uses take the dynamic paths", [
488
+ "tests/corpus/6882-node-island-nested-require/main.js",
489
+ "tests/corpus/6880-node-island-cjs-entry/main.js",
490
+ ]),
491
+ ],
140
492
  // `delete` of a property the inference typed required (2790): JS deletes
141
493
  // any configurable property, and the lowering checks each delete's
142
- // receiver itself
143
- 2790,
494
+ // receiver itself.
495
+ [
496
+ 2790,
497
+ CHECKER("JS deletes any configurable property; the lowering checks each delete's receiver itself", ["tests/corpus/8066-object-hasown-delete.cjs", "tests/corpus/object-literal-members.mjs"]),
498
+ ],
144
499
  // useUnknownInCatchVariables' annotation demand ("'e' is of type
145
- // 'unknown'", "Object is of type 'unknown'"): a JS catch clause CANNOT
146
- // annotate its variable, so the demand is unsatisfiable in source —
147
- // exactly the implicit-any story above. The values stay 'unknown' and
148
- // every use meets the lowerer's per-site unknown fences (member reads
149
- // ride the checked-dynamic tree; unsupported operations report a compile-time diagnostic).
150
- 18046,
151
- 2571,
152
- ]);
153
- /* Arithmetic on an `any` operand (TS2362/2363/2365 fire when the other
154
- * side is bigint-ish): plain JS — relaxed only when 'any' participates. */
155
- export const JS_ANY_OPERATOR_CODES = new Set([2362, 2363, 2365]);
500
+ // 'unknown'"): a JS catch clause CANNOT annotate its variable, so the
501
+ // demand is unsatisfiable in source — exactly the implicit-any story. The
502
+ // values stay 'unknown' and every use meets the lowerer's per-site unknown
503
+ // fences.
504
+ [
505
+ 18046,
506
+ CHECKER("a JS catch clause cannot annotate its variable: the demand is unsatisfiable in source, and every use meets the per-site unknown fences", [
507
+ "tests/corpus/process-builtin-values.js",
508
+ "tests/corpus/7545-string-regex-checked-arguments.js",
509
+ ]),
510
+ ],
511
+ [
512
+ 2571,
513
+ CHECKER("a JS catch clause cannot annotate its variable: the demand is unsatisfiable in source, and every use meets the per-site unknown fences", ["tests/corpus/3100-json-callback-holder.js", "tests/corpus/logical-assignment-dynamic.js"]),
514
+ ],
515
+ // UNDECLARED NAMES in a JavaScript source: Node resolves them at run time,
516
+ // never at compile time — a READ throws the catchable
517
+ // `ReferenceError: <name> is not defined` at the access (`typeof` of one
518
+ // answers "undefined"), and a sloppy-mode WRITE creates a global. The
519
+ // lowerer turns the read into `scr_undef_global_read` (exact Node text and
520
+ // behavior) and refuses the write with SC1091, which names the Node-island
521
+ // route the sloppy semantics need. TypeScript input keeps the compile
522
+ // error: an undeclared name there is a bug, not a runtime path. 2552 is
523
+ // 2304's did-you-mean spelling, and 18004 is the same unresolved name in
524
+ // SHORTHAND position (`{ x }`), which the checker reports against the
525
+ // property instead of the reference.
526
+ [
527
+ 2304,
528
+ THROW("a read of an undeclared name throws Node's ReferenceError at the access (typeof answers 'undefined'); a sloppy write is SC1091", ["tests/corpus/8427-sloppy-with-island/main.js", "tests/corpus/8515-js-undeclared-read.js"]),
529
+ ],
530
+ [
531
+ 2552,
532
+ THROW("a read of an undeclared name throws Node's ReferenceError at the access (typeof answers 'undefined'); a sloppy write is SC1091"),
533
+ ],
534
+ [
535
+ 18004,
536
+ THROW("a read of an undeclared name throws Node's ReferenceError at the access (typeof answers 'undefined'); a sloppy write is SC1091", ["tests/corpus/8515-js-undeclared-read.js"]),
537
+ ],
538
+ // ---- The checker's OPINIONS about legal JavaScript ----
539
+ // Each diagnostic below reports that a construct is unusual for TypeScript,
540
+ // never that it is illegal JavaScript: Node gives it a defined runtime
541
+ // meaning and the lowerer already builds it. TypeScript input keeps every
542
+ // one of them.
543
+ //
544
+ // 2695, an unused comma-operand left side (`(0, fn)`, `(0, [[x]] = [])`):
545
+ // the operator evaluates the left operand for its effects and yields the
546
+ // right one; the lowerer emits a sequence expression for it.
547
+ [
548
+ 2695,
549
+ CHECKER("the comma operator evaluates its left operand for effects and yields the right one, which the lowerer emits as a sequence", ["tests/corpus/8700-js-comma-operands.js"]),
550
+ ],
551
+ // 18050, `null`/`undefined` in an arithmetic or bitwise position
552
+ // (`null + undefined`, `null * 3`): ToNumber gives them 0 and NaN, which
553
+ // the numeric coercion implements for a unit literal; the demand comes
554
+ // from strictNullChecks, not from JavaScript.
555
+ [
556
+ 18050,
557
+ CHECKER("ToNumber gives null 0 and undefined NaN; the demand comes from strictNullChecks, not from JavaScript", ["tests/corpus/8702-js-nullish-arithmetic.js"]),
558
+ ],
559
+ // 7057, a `yield` in a generator with no return-type annotation: the
560
+ // generator protocol is untyped in JavaScript and the sent value is
561
+ // whatever the caller passes. The generator lowering owns the channels.
562
+ [
563
+ 7057,
564
+ CHECKER("an untyped generator's sent value is whatever the caller passes; the generator lowering owns the channels", ["tests/corpus/8703-js-untyped-generators.js"]),
565
+ ],
566
+ // 7032, a set accessor whose parameter has no type annotation: a
567
+ // JavaScript setter's parameter is whatever the caller passes. The
568
+ // lowering gives the parameter checked-dynamic storage (`paramShape`), and
569
+ // a read of it stays dynamic rather than checking the caller's value back
570
+ // into the type the checker inferred from a twin getter
571
+ // (jsWidenedBindings), so the stored value keeps its runtime identity. A
572
+ // JSDoc `@param` type is an annotation like any other and keeps its
573
+ // declared storage.
574
+ [
575
+ 7032,
576
+ at(notPrivateName, WIDEN("a JavaScript setter's parameter is whatever the caller passes; its storage is checked-dynamic and a read keeps the stored value", ["tests/corpus/8701-js-setter-implicit-any.js"])),
577
+ ],
578
+ // tsgo's strict CommonJS modeling fires these on JS shapes 5.9.3 accepted,
579
+ // and the real hazards those shapes carry are fenced by scriptc's OWN
580
+ // analysis, never by these codes — so for JS FILES ONLY they join the
581
+ // opinions (TS sources keep the full gate; the order-parity harness holds
582
+ // both lanes to identical verdicts, so a case where 5.9.3 itself raises one
583
+ // of these on a JS file would fail there, not slip by):
584
+ // - TS2309 ("export assignment with other exported elements") on the
585
+ // table-then-member pattern — cjsExportDiscardReason names every export
586
+ // Node actually discards.
587
+ // - TS2323 ("cannot redeclare exported variable") on symbol-keyed expando
588
+ // assignments in CJS classes (`this[kSym] = v` under `module.exports =
589
+ // Class`) — 5.9.3 synthesized expando symbols, tsgo trips its
590
+ // redeclaration check instead (the corpus's countdown fixture).
591
+ // Ordinary JavaScript functions are constructable even when the checker
592
+ // retains only their call signature after a factory return. Heritage
593
+ // lowering separately verifies the actual constructor implementation
594
+ // (2507).
595
+ [
596
+ 2309,
597
+ CHECKER("Node discards the export assignment's siblings by its own rules, which cjsExportDiscardReason names", [
598
+ "tests/corpus/6151-cjs-export-chains/main.js",
599
+ "tests/corpus/6431-cjs-exports-rebinding/main.cjs",
600
+ ]),
601
+ ],
602
+ [
603
+ 2323,
604
+ CHECKER("a symbol-keyed expando assignment under module.exports redeclares nothing at runtime", [
605
+ "tests/corpus/cjs-symbol-key-table/main.js",
606
+ "tests/corpus/cjs-symbol-key-collisions/main.js",
607
+ ]),
608
+ ],
609
+ [
610
+ 2507,
611
+ CHECKER("an ordinary JavaScript function is constructable; heritage lowering verifies the constructor implementation", [
612
+ "tests/corpus/class-factory-inherited-statics.mjs",
613
+ "tests/corpus/6020-class-extends-function-constructor.js",
614
+ ]),
615
+ ],
616
+ // The SC0001 triage's `relax` rows: legal JavaScript whose construct the
617
+ // lowering already builds Node-exactly. One corpus program pins them all.
618
+ [
619
+ 1313,
620
+ CHECKER("an empty statement as an 'if' body is legal JavaScript, and the lowering emits nothing for it", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
621
+ ],
622
+ [
623
+ 2378,
624
+ CHECKER("a 'get' accessor with no return path is legal JavaScript and answers undefined", [
625
+ "tests/corpus/8732-jsts-triage-relax/main.mjs",
626
+ ]),
627
+ ],
628
+ [
629
+ 2447,
630
+ CHECKER("'&' on booleans is legal JavaScript: the operator converts both operands with ToInt32", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
631
+ ],
632
+ [
633
+ 2678,
634
+ CHECKER("comparing two literal values of different types is legal JavaScript", [
635
+ "tests/corpus/8732-jsts-triage-relax/main.mjs",
636
+ ]),
637
+ ],
638
+ [
639
+ 2698,
640
+ CHECKER("object spread of null or undefined is legal JavaScript: the spread contributes no properties", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
641
+ ],
642
+ [
643
+ 2774,
644
+ CHECKER("a function reference in a condition is legal JavaScript and truthy; the condition evaluates as written", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
645
+ ],
646
+ [
647
+ 2783,
648
+ CHECKER("a later property or spread overwriting an earlier property is legal JavaScript, and the last write wins", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
649
+ ],
650
+ [
651
+ 2872,
652
+ CHECKER("an always-truthy expression is legal JavaScript; the condition evaluates as written", [
653
+ "tests/corpus/8732-jsts-triage-relax/main.mjs",
654
+ ]),
655
+ ],
656
+ [
657
+ 2873,
658
+ CHECKER("an always-falsy expression is legal JavaScript; the condition evaluates as written", [
659
+ "tests/corpus/8732-jsts-triage-relax/main.mjs",
660
+ ]),
661
+ ],
662
+ // Arithmetic whose other operand is bigint-ish: admitted only for an `any`
663
+ // or a primitive wrapper operand (TS2362/2363/2365; the code's TRIAGE row,
664
+ // where one exists, keeps the typed operand).
665
+ [
666
+ 2362,
667
+ at(anyOrWrapperOperand, CHECKER("arithmetic on an 'any' or wrapper operand is plain JavaScript: the operator converts it with ToPrimitive", ["tests/corpus/js-primitive-wrappers.js", "tests/corpus/js-primitive-wrappers-zero-arg.js"])),
668
+ ],
669
+ [
670
+ 2363,
671
+ at(anyOrWrapperOperand, CHECKER("arithmetic on an 'any' or wrapper operand is plain JavaScript: the operator converts it with ToPrimitive")),
672
+ ],
673
+ [
674
+ 2365,
675
+ at(anyOrWrapperOperand, CHECKER("arithmetic on an 'any' or wrapper operand is plain JavaScript: the operator converts it with ToPrimitive", ["tests/corpus/js-primitive-wrappers.js", "tests/corpus/1614-js-fence-dodges.cjs"])),
676
+ ],
677
+ // `new Iterator()` (TS2511): Iterator is the one abstract class the lib
678
+ // exposes, and Node throws its TypeError at the construction, which the
679
+ // lowering reproduces (iterator-prototype.ts).
680
+ [
681
+ 2511,
682
+ THROW("Node throws its TypeError when the abstract Iterator class is constructed, and the lowering reproduces it at the site", ["tests/corpus/js-iterator-prototype.js"]),
683
+ ],
684
+ // A base constructor's type-argument count (TS2508): JavaScript writes no
685
+ // type arguments, and `class X extends Iterator` names the lib's generic
686
+ // abstract class. The heritage lowering checks the actual base.
687
+ [
688
+ 2508,
689
+ CHECKER("JavaScript writes no type arguments, and the heritage lowering checks the actual base class", ["tests/corpus/js-iterator-subclass.js"]),
690
+ ],
691
+ // A write through a String wrapper's index (TS2542; every other readonly
692
+ // index signature keeps the triage's refusal).
693
+ [
694
+ 2542,
695
+ at(stringWrapperReceiver, CHECKER("Node adds the property past the end and ignores the read-only index writes (sloppy) or throws (strict), as the object does", ["tests/corpus/js-primitive-wrappers.js", "tests/corpus/js-primitive-wrappers-zero-arg.js"])),
696
+ ],
697
+ // The deprecated Buffer(...) call and fs.ReadStream/WriteStream (TS2348;
698
+ // every other class called without `new` keeps the triage's SC1090).
699
+ [
700
+ 2348,
701
+ at(deprecatedBufferCall, CHECKER("Node's Buffer function and the fs stream constructors accept the call without 'new', and the lowering builds them", [
702
+ "tests/corpus/7529-buffer-constructor.cjs",
703
+ "tests/corpus/8272-fs-stream-call-without-new.cjs",
704
+ ])),
705
+ ],
706
+ ];
707
+ /** Every JavaScript checker opinion, by TypeScript code. */
708
+ export const JS_OPINIONS = new Map(OPINION_ROWS);
709
+ /** The opinion admitting `code` in a JavaScript source, or null for a code
710
+ * with none (the triage table's not-yet-admitted states, and codes no
711
+ * journal has observed). */
712
+ export function jsOpinion(code) {
713
+ return JS_OPINIONS.get(code) ?? null;
714
+ }
715
+ const KEEP_GRAMMAR = "a JavaScript grammar or early error: Node rejects this source with a SyntaxError, and tsc's text describes that rule";
716
+ const KEEP_EARLY_ERROR = "an early error whose runtime failure Node raises too (a ReferenceError or TypeError at the site); tsc's text names the rule";
717
+ const KEEP = (why) => ({ action: "keep", why });
718
+ const REFUSE = (feature, hint) => ({
719
+ action: "refuse",
720
+ feature,
721
+ hint,
722
+ });
723
+ const REWRITE = (feature, hint) => ({
724
+ action: "rewrite",
725
+ feature,
726
+ hint,
727
+ });
728
+ const TRIAGE_ROWS = [
729
+ [1005, KEEP(KEEP_GRAMMAR)],
730
+ [1010, KEEP(KEEP_GRAMMAR)],
731
+ [1014, KEEP(KEEP_GRAMMAR)],
732
+ [1042, KEEP(KEEP_GRAMMAR)],
733
+ [1052, KEEP(KEEP_GRAMMAR)],
734
+ [1054, KEEP(KEEP_GRAMMAR)],
735
+ [1089, KEEP(KEEP_GRAMMAR)],
736
+ [1101, KEEP(KEEP_GRAMMAR)],
737
+ [1102, KEEP(KEEP_GRAMMAR)],
738
+ [1104, KEEP(KEEP_GRAMMAR)],
739
+ [1105, KEEP(KEEP_GRAMMAR)],
740
+ [1106, KEEP(KEEP_GRAMMAR)],
741
+ [1109, KEEP(KEEP_GRAMMAR)],
742
+ [1113, KEEP(KEEP_GRAMMAR)],
743
+ [1114, KEEP(KEEP_GRAMMAR)],
744
+ [1117, KEEP(KEEP_GRAMMAR)],
745
+ [1119, KEEP(KEEP_GRAMMAR)],
746
+ [1121, KEEP(KEEP_GRAMMAR)],
747
+ [1123, KEEP(KEEP_GRAMMAR)],
748
+ [1125, KEEP(KEEP_GRAMMAR)],
749
+ [1127, KEEP(KEEP_GRAMMAR)],
750
+ [1134, KEEP(KEEP_GRAMMAR)],
751
+ [1142, KEEP(KEEP_GRAMMAR)],
752
+ [1156, KEEP(KEEP_GRAMMAR)],
753
+ [1163, KEEP(KEEP_GRAMMAR)],
754
+ [
755
+ 1166,
756
+ REWRITE("a computed class field name whose type is not a string, number, or symbol literal", "the class-field lowering needs the key computed at class-definition time, which is the value Node uses"),
757
+ ],
758
+ [1189, KEEP(KEEP_GRAMMAR)],
759
+ [1198, KEEP(KEEP_GRAMMAR)],
760
+ [1200, KEEP(KEEP_GRAMMAR)],
761
+ [1210, KEEP(KEEP_GRAMMAR)],
762
+ [1214, KEEP(KEEP_GRAMMAR)],
763
+ [1215, KEEP(KEEP_GRAMMAR)],
764
+ [1260, KEEP(KEEP_GRAMMAR)],
765
+ [1262, KEEP(KEEP_GRAMMAR)],
766
+ [1312, KEEP(KEEP_GRAMMAR)],
767
+ [
768
+ 1320,
769
+ REWRITE("an 'await' operand the checker cannot prove is a promise", "Node awaits any value and ignores a non-callable 'then'; the await lowering needs the hostile-'then' path"),
770
+ ],
771
+ [1329, KEEP(KEEP_GRAMMAR)],
772
+ [1341, KEEP(KEEP_GRAMMAR)],
773
+ [1359, KEEP(KEEP_GRAMMAR)],
774
+ [1368, KEEP(KEEP_GRAMMAR)],
775
+ [1451, KEEP(KEEP_GRAMMAR)],
776
+ [1487, KEEP(KEEP_GRAMMAR)],
777
+ [1488, KEEP(KEEP_GRAMMAR)],
778
+ [1489, KEEP(KEEP_GRAMMAR)],
779
+ [1492, KEEP(KEEP_GRAMMAR)],
780
+ [1493, KEEP(KEEP_GRAMMAR)],
781
+ [1494, KEEP(KEEP_GRAMMAR)],
782
+ [1514, KEEP(KEEP_GRAMMAR)],
783
+ [1532, KEEP(KEEP_GRAMMAR)],
784
+ [1533, KEEP(KEEP_GRAMMAR)],
785
+ [1534, KEEP(KEEP_GRAMMAR)],
786
+ [1536, KEEP(KEEP_GRAMMAR)],
787
+ [1539, KEEP(KEEP_GRAMMAR)],
788
+ [2300, KEEP(KEEP_EARLY_ERROR)],
789
+ [2335, KEEP(KEEP_GRAMMAR)],
790
+ [2337, KEEP(KEEP_GRAMMAR)],
791
+ [
792
+ 2348,
793
+ REWRITE("calling a class constructor without 'new'", "Node throws the 'Class constructor ... cannot be invoked without new' TypeError at the call"),
794
+ ],
795
+ [
796
+ 2356,
797
+ REFUSE("arithmetic on an operand the checker types as non-numeric", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
798
+ ],
799
+ [2357, KEEP(KEEP_GRAMMAR)],
800
+ [
801
+ 2359,
802
+ REWRITE("an 'instanceof' right operand that is not callable", "Node throws the 'Right-hand side of instanceof is not callable' TypeError at the expression"),
803
+ ],
804
+ [2364, KEEP(KEEP_EARLY_ERROR)],
805
+ [
806
+ 2372,
807
+ REWRITE("a parameter default that references its own parameter", "Node throws a ReferenceError when the parameter is initialized (the parameter environment's temporal dead zone)"),
808
+ ],
809
+ [
810
+ 2373,
811
+ REWRITE("a parameter default that references a later parameter", "Node throws a ReferenceError when the parameter is initialized (the parameter environment's temporal dead zone)"),
812
+ ],
813
+ [
814
+ 2377,
815
+ REWRITE("a derived constructor that never calls 'super'", "Node throws a ReferenceError when the constructor returns; the lowering needs the uninitialized-this path"),
816
+ ],
817
+ [2392, KEEP(KEEP_GRAMMAR)],
818
+ [2393, KEEP(KEEP_GRAMMAR)],
819
+ [
820
+ 2403,
821
+ REWRITE("a 'var' redeclared with a value of a different type", "the lowering pins the first declaration's storage type; a redeclaration must widen it (sloppy Annex B semantics)"),
822
+ ],
823
+ [2405, KEEP(KEEP_GRAMMAR)],
824
+ [2406, KEEP(KEEP_GRAMMAR)],
825
+ [
826
+ 2407,
827
+ REFUSE("'for...in' over a value the checker types 'never'", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
828
+ ],
829
+ [2408, KEEP(KEEP_GRAMMAR)],
830
+ [
831
+ 2409,
832
+ REWRITE("a constructor signature whose return type is not the instance type", "a JSDoc @constructor signature has to describe the instance it builds"),
833
+ ],
834
+ [
835
+ 2416,
836
+ REFUSE("a subclass member whose type differs from its base's", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
837
+ ],
838
+ [
839
+ 2417,
840
+ REFUSE("a subclass static side whose type differs from its base's", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
841
+ ],
842
+ [
843
+ 2418,
844
+ REFUSE("a computed class member whose value type differs from the checker's expectation", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
845
+ ],
846
+ [
847
+ 2448,
848
+ REWRITE("a block-scoped variable read above its declaration", "Node throws a ReferenceError (the temporal dead zone); the lowering needs a TDZ-carrying binding"),
849
+ ],
850
+ [2451, KEEP(KEEP_GRAMMAR)],
851
+ [
852
+ 2454,
853
+ REFUSE("a 'var' read before its assignment", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
854
+ ],
855
+ [
856
+ 2469,
857
+ REWRITE("the '+' operator on a symbol operand", "Node throws a TypeError ('Cannot convert a Symbol value to a string') at the operator"),
858
+ ],
859
+ [2481, KEEP(KEEP_GRAMMAR)],
860
+ [2487, KEEP(KEEP_GRAMMAR)],
861
+ [
862
+ 2490,
863
+ REWRITE("an iterator whose 'next()' result the checker cannot prove carries a 'value' property", "the iteration protocols throw a TypeError when 'next()' returns a non-object"),
864
+ ],
865
+ [2491, KEEP(KEEP_GRAMMAR)],
866
+ [2492, KEEP(KEEP_EARLY_ERROR)],
867
+ [
868
+ 2493,
869
+ REWRITE("reading an element of an empty tuple-typed array", "the read answers undefined in JavaScript; the tuple lowering must not assume the element exists"),
870
+ ],
871
+ [
872
+ 2506,
873
+ REWRITE("a class whose 'extends' expression references the class itself", "Node throws a ReferenceError when the class is defined"),
874
+ ],
875
+ // TS2511 (instantiating an abstract class) has LEFT this table: `new
876
+ // Iterator()` is a JS_OPINIONS `throw` row above, so no JavaScript site
877
+ // reaches this decision any more.
878
+ [2524, KEEP(KEEP_GRAMMAR)],
879
+ [
880
+ 2537,
881
+ REFUSE("an index read over a type with no matching index signature", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
882
+ ],
883
+ [
884
+ 2539,
885
+ REWRITE("assigning to 'undefined'", "sloppy mode ignores the write and strict mode throws a TypeError; the lowering needs the mode-dependent path"),
886
+ ],
887
+ [
888
+ 2542,
889
+ REFUSE("a write through a readonly index signature", "readonly is an annotation: whether the write succeeds or throws depends on the object's frozen state at run time, which the lowering does not model"),
890
+ ],
891
+ [
892
+ 2547,
893
+ REWRITE("an async iterator whose 'next()' result the checker cannot prove is a promise for a 'value' object", "the async iteration protocol throws a TypeError when the promise resolves to a non-object"),
894
+ ],
895
+ [
896
+ 2565,
897
+ REFUSE("reading 'prototype' before its assignment", "the declaration's definite-assignment rule; assign 'prototype' before the read"),
898
+ ],
899
+ [
900
+ 2576,
901
+ REFUSE("an instance read of a member the checker knows only as static", "the instance read answers undefined in JavaScript; declare the member on the instance to read it, or reach the class object"),
902
+ ],
903
+ [
904
+ 2588,
905
+ REWRITE("assigning to a 'const' binding", "Node throws a TypeError at the assignment (strict mode, and always in modules)"),
906
+ ],
907
+ [
908
+ 2629,
909
+ REWRITE("assigning to a class name binding", "Node throws a TypeError at the assignment; the class binding is read-only"),
910
+ ],
911
+ [
912
+ 2630,
913
+ REWRITE("assigning to a function declaration name", "Node throws a TypeError at the assignment in strict mode and modules"),
914
+ ],
915
+ [2660, KEEP(KEEP_GRAMMAR)],
916
+ [2662, KEEP(KEEP_GRAMMAR)],
917
+ [
918
+ 2684,
919
+ REWRITE("a call whose 'this' type the checker rejects", "JavaScript passes whatever receiver the expression produces; the this-context lowering is the remaining gap (W6)"),
920
+ ],
921
+ [
922
+ 2699,
923
+ REFUSE("a static class member named 'prototype'", "Node throws a TypeError when the class is defined; rename the member"),
924
+ ],
925
+ [
926
+ 2700,
927
+ REWRITE("a rest element over a null or undefined value", "Node throws a TypeError when the pattern is assigned"),
928
+ ],
929
+ [
930
+ 2703,
931
+ REWRITE("the operand of 'delete' is not a property reference", "sloppy mode answers true and strict mode is a SyntaxError; the lowering needs the mode-dependent path"),
932
+ ],
933
+ [
934
+ 2723,
935
+ REFUSE("a call to a value the checker types as possibly null or undefined", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
936
+ ],
937
+ [
938
+ 2729,
939
+ REWRITE("a private field read before its initialization", "Node throws a TypeError at the read"),
940
+ ],
941
+ [2736, REWRITE("unary '+' on a bigint", "Node throws a TypeError at the operator")],
942
+ [
943
+ 2739,
944
+ REFUSE("a set-like argument the checker cannot prove implements 'has' and 'size'", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
945
+ ],
946
+ [
947
+ 2767,
948
+ REWRITE("an iterator whose 'throw' property is not a method", "the iteration protocol throws a TypeError at the call"),
949
+ ],
950
+ [
951
+ 2768,
952
+ REWRITE("an async iterator whose 'return' property is not a method", "the async iteration protocol throws a TypeError at the call"),
953
+ ],
954
+ [2777, KEEP(KEEP_GRAMMAR)],
955
+ [
956
+ 2803,
957
+ REWRITE("assigning to a private method", "Node throws a TypeError at the assignment; private methods are not writable"),
958
+ ],
959
+ [2815, KEEP(KEEP_GRAMMAR)],
960
+ [
961
+ 2839,
962
+ REFUSE("a comparison the checker proves constant (two object references)", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
963
+ ],
964
+ [
965
+ 2845,
966
+ REFUSE("a comparison the checker proves constant (a bigint against a non-finite number)", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
967
+ ],
968
+ [
969
+ 2850,
970
+ REWRITE("a 'using' initializer that is not disposable", "Node throws a TypeError when the declaration is initialized"),
971
+ ],
972
+ [2855, KEEP(KEEP_GRAMMAR)],
973
+ [
974
+ 2869,
975
+ REFUSE("the right operand of '??' the checker proves unreachable", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
976
+ ],
977
+ [
978
+ 2871,
979
+ REFUSE("an expression the checker proves always nullish", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
980
+ ],
981
+ [
982
+ 4104,
983
+ REFUSE("assigning to a readonly array type", "readonly is an annotation: whether the write succeeds or throws depends on the array's frozen state at run time, which the lowering does not model"),
984
+ ],
985
+ [5076, KEEP(KEEP_GRAMMAR)],
986
+ [
987
+ 7036,
988
+ REWRITE("a dynamic import specifier that is not statically a string", "Node converts the specifier with ToString at run time, and the import lowering must follow"),
989
+ ],
990
+ [17005, KEEP(KEEP_EARLY_ERROR)],
991
+ [17009, KEEP(KEEP_EARLY_ERROR)],
992
+ [17011, KEEP(KEEP_EARLY_ERROR)],
993
+ [17013, KEEP(KEEP_EARLY_ERROR)],
994
+ [18013, KEEP(KEEP_EARLY_ERROR)],
995
+ [18014, KEEP(KEEP_EARLY_ERROR)],
996
+ [18016, KEEP(KEEP_GRAMMAR)],
997
+ [18030, KEEP(KEEP_EARLY_ERROR)],
998
+ [18037, KEEP(KEEP_EARLY_ERROR)],
999
+ [18041, KEEP(KEEP_EARLY_ERROR)],
1000
+ [18058, KEEP(KEEP_EARLY_ERROR)],
1001
+ [18059, KEEP(KEEP_EARLY_ERROR)],
1002
+ [18061, KEEP(KEEP_GRAMMAR)],
1003
+ ];
1004
+ /** The triage of one TypeScript code that reaches SC0001 in a JavaScript
1005
+ * source, or null for a code this table does not cover (a code JS_OPINIONS
1006
+ * admits everywhere, and a code no journal has observed). */
1007
+ export const JS_TSC_CODE_TRIAGE = new Map(TRIAGE_ROWS);
1008
+ export function jsTscCodeTriage(code) {
1009
+ return JS_TSC_CODE_TRIAGE.get(code) ?? null;
1010
+ }
156
1011
  /** True for JavaScript source file NAMES (.js/.mjs/.cjs/.jsx) — the files
157
1012
  * whose types come entirely from inference (checkJs + JSDoc) and whose JS
158
- * relaxation stance applies. */
1013
+ * opinion stance (JS_OPINIONS) applies. */
159
1014
  export function isJsSourceFileName(fileName) {
160
1015
  // The same classification as /\.(js|mjs|cjs|jsx)$/, without a regular
161
1016
  // expression: this runs for most type queries.