@scriptc/compiler 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (775) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +198 -44
  2. package/ambient/scriptc-overrides.d.ts +21 -0
  3. package/dist/backend/executable-features.js +3 -0
  4. package/dist/backend/executable-features.js.map +1 -1
  5. package/dist/backend/library-pack.js +2 -1
  6. package/dist/backend/library-pack.js.map +1 -1
  7. package/dist/backend/linker.js +11 -1
  8. package/dist/backend/linker.js.map +1 -1
  9. package/dist/backend/lld.d.ts +9 -0
  10. package/dist/backend/lld.js +48 -0
  11. package/dist/backend/lld.js.map +1 -0
  12. package/dist/backend/lld.test.d.ts +1 -0
  13. package/dist/backend/lld.test.js +53 -0
  14. package/dist/backend/lld.test.js.map +1 -0
  15. package/dist/backend/llvm/appended-array-literals.d.ts +11 -1
  16. package/dist/backend/llvm/appended-array-literals.js +29 -0
  17. package/dist/backend/llvm/appended-array-literals.js.map +1 -1
  18. package/dist/backend/llvm/blocks.js +10 -1
  19. package/dist/backend/llvm/blocks.js.map +1 -1
  20. package/dist/backend/llvm/bytes-alias.d.ts +13 -4
  21. package/dist/backend/llvm/bytes-alias.js +16 -5
  22. package/dist/backend/llvm/bytes-alias.js.map +1 -1
  23. package/dist/backend/llvm/bytes-bounds.d.ts +5 -1
  24. package/dist/backend/llvm/bytes-bounds.js +199 -2
  25. package/dist/backend/llvm/bytes-bounds.js.map +1 -1
  26. package/dist/backend/llvm/bytes-loop-versions.d.ts +45 -3
  27. package/dist/backend/llvm/bytes-loop-versions.js +238 -20
  28. package/dist/backend/llvm/bytes-loop-versions.js.map +1 -1
  29. package/dist/backend/llvm/bytes-loop-versions.test.js +11 -4
  30. package/dist/backend/llvm/bytes-loop-versions.test.js.map +1 -1
  31. package/dist/backend/llvm/call-lifetimes.d.ts +8 -2
  32. package/dist/backend/llvm/call-lifetimes.js +87 -18
  33. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  34. package/dist/backend/llvm/call-lifetimes.test.js +132 -0
  35. package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
  36. package/dist/backend/llvm/classes.d.ts +3 -2
  37. package/dist/backend/llvm/classes.js +4 -4
  38. package/dist/backend/llvm/classes.js.map +1 -1
  39. package/dist/backend/llvm/counted-loops.d.ts +14 -2
  40. package/dist/backend/llvm/counted-loops.js +54 -5
  41. package/dist/backend/llvm/counted-loops.js.map +1 -1
  42. package/dist/backend/llvm/debug-info.d.ts +42 -1
  43. package/dist/backend/llvm/debug-info.js +70 -1
  44. package/dist/backend/llvm/debug-info.js.map +1 -1
  45. package/dist/backend/llvm/dense-array-loops.js +2 -2
  46. package/dist/backend/llvm/dense-array-loops.js.map +1 -1
  47. package/dist/backend/llvm/dense-array-loops.test.js +1 -0
  48. package/dist/backend/llvm/dense-array-loops.test.js.map +1 -1
  49. package/dist/backend/llvm/dyn.d.ts +65 -8
  50. package/dist/backend/llvm/dyn.js +375 -40
  51. package/dist/backend/llvm/dyn.js.map +1 -1
  52. package/dist/backend/llvm/emit-function.js +28 -8
  53. package/dist/backend/llvm/emit-function.js.map +1 -1
  54. package/dist/backend/llvm/emit-journal.d.ts +8 -4
  55. package/dist/backend/llvm/emit-journal.js +75 -5
  56. package/dist/backend/llvm/emit-journal.js.map +1 -1
  57. package/dist/backend/llvm/emit-module.d.ts +4 -0
  58. package/dist/backend/llvm/emit-module.js +58 -23
  59. package/dist/backend/llvm/emit-module.js.map +1 -1
  60. package/dist/backend/llvm/emit-statements.js +297 -28
  61. package/dist/backend/llvm/emit-statements.js.map +1 -1
  62. package/dist/backend/llvm/emitter.d.ts +134 -13
  63. package/dist/backend/llvm/emitter.js +514 -87
  64. package/dist/backend/llvm/emitter.js.map +1 -1
  65. package/dist/backend/llvm/expr-bytes.d.ts +6 -4
  66. package/dist/backend/llvm/expr-bytes.js +31 -8
  67. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  68. package/dist/backend/llvm/expr-calls.js +13 -11
  69. package/dist/backend/llvm/expr-calls.js.map +1 -1
  70. package/dist/backend/llvm/expr-containers.d.ts +11 -0
  71. package/dist/backend/llvm/expr-containers.js +87 -9
  72. package/dist/backend/llvm/expr-containers.js.map +1 -1
  73. package/dist/backend/llvm/expr-context.d.ts +3 -0
  74. package/dist/backend/llvm/expr-control.js +83 -0
  75. package/dist/backend/llvm/expr-control.js.map +1 -1
  76. package/dist/backend/llvm/expr-dynamic.d.ts +1 -1
  77. package/dist/backend/llvm/expr-dynamic.js +22 -4
  78. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  79. package/dist/backend/llvm/expr-primitives.js +107 -9
  80. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  81. package/dist/backend/llvm/expr-stream-bridges.js +95 -22
  82. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  83. package/dist/backend/llvm/forked-analysis.d.ts +8 -0
  84. package/dist/backend/llvm/forked-analysis.js +43 -0
  85. package/dist/backend/llvm/forked-analysis.js.map +1 -0
  86. package/dist/backend/llvm/integer-values.d.ts +7 -0
  87. package/dist/backend/llvm/integer-values.js +42 -2
  88. package/dist/backend/llvm/integer-values.js.map +1 -1
  89. package/dist/backend/llvm/integer-views.d.ts +2 -1
  90. package/dist/backend/llvm/integer-views.js +12 -1
  91. package/dist/backend/llvm/integer-views.js.map +1 -1
  92. package/dist/backend/llvm/js-ic.d.ts +4 -0
  93. package/dist/backend/llvm/js-ic.js +133 -15
  94. package/dist/backend/llvm/js-ic.js.map +1 -1
  95. package/dist/backend/llvm/layouts.d.ts +1 -0
  96. package/dist/backend/llvm/layouts.js.map +1 -1
  97. package/dist/backend/llvm/lazy-captures.d.ts +6 -1
  98. package/dist/backend/llvm/lazy-captures.js +10 -5
  99. package/dist/backend/llvm/lazy-captures.js.map +1 -1
  100. package/dist/backend/llvm/lib-abi.d.ts +5 -0
  101. package/dist/backend/llvm/lib-abi.js +19 -0
  102. package/dist/backend/llvm/lib-abi.js.map +1 -1
  103. package/dist/backend/llvm/lib-dispatch.js +128 -42
  104. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  105. package/dist/backend/llvm/lib-filesystem.d.ts +10 -0
  106. package/dist/backend/llvm/lib-filesystem.js +32 -0
  107. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  108. package/dist/backend/llvm/lib-http2.js +2 -2
  109. package/dist/backend/llvm/lib-http2.js.map +1 -1
  110. package/dist/backend/llvm/lib-network.js +2 -0
  111. package/dist/backend/llvm/lib-network.js.map +1 -1
  112. package/dist/backend/llvm/lib-process.js +11 -0
  113. package/dist/backend/llvm/lib-process.js.map +1 -1
  114. package/dist/backend/llvm/lib-shared.js +43 -0
  115. package/dist/backend/llvm/lib-shared.js.map +1 -1
  116. package/dist/backend/llvm/lib-tls.js +28 -3
  117. package/dist/backend/llvm/lib-tls.js.map +1 -1
  118. package/dist/backend/llvm/local-union-storage.test.js +2 -1
  119. package/dist/backend/llvm/local-union-storage.test.js.map +1 -1
  120. package/dist/backend/llvm/loop-array-borrows.d.ts +4 -1
  121. package/dist/backend/llvm/loop-array-borrows.js +11 -5
  122. package/dist/backend/llvm/loop-array-borrows.js.map +1 -1
  123. package/dist/backend/llvm/map-entry-fusion.d.ts +5 -3
  124. package/dist/backend/llvm/map-entry-fusion.js +20 -11
  125. package/dist/backend/llvm/map-entry-fusion.js.map +1 -1
  126. package/dist/backend/llvm/map-entry-fusion.test.js +14 -6
  127. package/dist/backend/llvm/map-entry-fusion.test.js.map +1 -1
  128. package/dist/backend/llvm/map-number-lookup.d.ts +16 -6
  129. package/dist/backend/llvm/map-number-lookup.js +41 -9
  130. package/dist/backend/llvm/map-number-lookup.js.map +1 -1
  131. package/dist/backend/llvm/map-number-lookup.test.js +70 -2
  132. package/dist/backend/llvm/map-number-lookup.test.js.map +1 -1
  133. package/dist/backend/llvm/map-read-lifetimes.d.ts +25 -2
  134. package/dist/backend/llvm/map-read-lifetimes.js +136 -6
  135. package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
  136. package/dist/backend/llvm/map-read-lifetimes.test.js +8 -3
  137. package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
  138. package/dist/backend/llvm/nullable-unions.d.ts +5 -0
  139. package/dist/backend/llvm/nullable-unions.js +29 -2
  140. package/dist/backend/llvm/nullable-unions.js.map +1 -1
  141. package/dist/backend/llvm/nullable-unions.test.js +25 -1
  142. package/dist/backend/llvm/nullable-unions.test.js.map +1 -1
  143. package/dist/backend/llvm/record-union-keys.test.d.ts +1 -0
  144. package/dist/backend/llvm/record-union-keys.test.js +161 -0
  145. package/dist/backend/llvm/record-union-keys.test.js.map +1 -0
  146. package/dist/backend/llvm/serialized-ir-emission.test.js +2 -0
  147. package/dist/backend/llvm/serialized-ir-emission.test.js.map +1 -1
  148. package/dist/backend/llvm/shapes.d.ts +4 -5
  149. package/dist/backend/llvm/shapes.js +104 -51
  150. package/dist/backend/llvm/shapes.js.map +1 -1
  151. package/dist/backend/llvm/shapes.test.js +14 -2
  152. package/dist/backend/llvm/shapes.test.js.map +1 -1
  153. package/dist/backend/llvm/speculative-integers.d.ts +50 -3
  154. package/dist/backend/llvm/speculative-integers.js +411 -24
  155. package/dist/backend/llvm/speculative-integers.js.map +1 -1
  156. package/dist/backend/llvm/speculative-integers.test.js +103 -1
  157. package/dist/backend/llvm/speculative-integers.test.js.map +1 -1
  158. package/dist/backend/llvm/split.d.ts +10 -1
  159. package/dist/backend/llvm/split.js +243 -59
  160. package/dist/backend/llvm/split.js.map +1 -1
  161. package/dist/backend/llvm/split.test.js +92 -13
  162. package/dist/backend/llvm/split.test.js.map +1 -1
  163. package/dist/backend/llvm/stack-objects.test.js +3 -2
  164. package/dist/backend/llvm/stack-objects.test.js.map +1 -1
  165. package/dist/backend/llvm/string-lifetimes.test.js +1 -1
  166. package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
  167. package/dist/backend/llvm/string-reads.d.ts +13 -0
  168. package/dist/backend/llvm/string-reads.js +22 -0
  169. package/dist/backend/llvm/string-reads.js.map +1 -1
  170. package/dist/backend/llvm/string-slices.d.ts +36 -2
  171. package/dist/backend/llvm/string-slices.js +308 -12
  172. package/dist/backend/llvm/string-slices.js.map +1 -1
  173. package/dist/backend/llvm/string-slices.test.js +182 -3
  174. package/dist/backend/llvm/string-slices.test.js.map +1 -1
  175. package/dist/backend/llvm/string-unit-versions.d.ts +11 -0
  176. package/dist/backend/llvm/string-unit-versions.js +191 -0
  177. package/dist/backend/llvm/string-unit-versions.js.map +1 -0
  178. package/dist/backend/llvm/string-unit-versions.test.d.ts +1 -0
  179. package/dist/backend/llvm/string-unit-versions.test.js +117 -0
  180. package/dist/backend/llvm/string-unit-versions.test.js.map +1 -0
  181. package/dist/backend/llvm/test-boxed-unions.d.ts +5 -2
  182. package/dist/backend/llvm/test-boxed-unions.js +24 -8
  183. package/dist/backend/llvm/test-boxed-unions.js.map +1 -1
  184. package/dist/backend/llvm/unwind-abi.d.ts +52 -0
  185. package/dist/backend/llvm/unwind-abi.js +498 -0
  186. package/dist/backend/llvm/unwind-abi.js.map +1 -0
  187. package/dist/backend/llvm/unwind-abi.test.d.ts +1 -0
  188. package/dist/backend/llvm/unwind-abi.test.js +255 -0
  189. package/dist/backend/llvm/unwind-abi.test.js.map +1 -0
  190. package/dist/backend/llvm/wrapping-sums.d.ts +14 -10
  191. package/dist/backend/llvm/wrapping-sums.js +31 -14
  192. package/dist/backend/llvm/wrapping-sums.js.map +1 -1
  193. package/dist/backend/loop-polls.d.ts +6 -0
  194. package/dist/backend/loop-polls.js +24 -0
  195. package/dist/backend/loop-polls.js.map +1 -1
  196. package/dist/backend/may-throw.js +8 -8
  197. package/dist/backend/may-throw.js.map +1 -1
  198. package/dist/backend/native/contracts.d.ts +12 -2
  199. package/dist/backend/native/executable.js +48 -6
  200. package/dist/backend/native/executable.js.map +1 -1
  201. package/dist/backend/native/library.js +4 -3
  202. package/dist/backend/native/library.js.map +1 -1
  203. package/dist/backend/native/program-shards.d.ts +2 -2
  204. package/dist/backend/native/program-shards.js +2 -2
  205. package/dist/backend/native/program-shards.js.map +1 -1
  206. package/dist/backend/native/runtime-inputs.d.ts +1 -1
  207. package/dist/backend/native/runtime-inputs.js +4 -1
  208. package/dist/backend/native/runtime-inputs.js.map +1 -1
  209. package/dist/backend/native/vendor.d.ts +1 -1
  210. package/dist/backend/native/vendor.js +1 -1
  211. package/dist/backend/native/vendor.js.map +1 -1
  212. package/dist/backend/native-codegen.d.ts +3 -1
  213. package/dist/backend/native-codegen.js +4 -3
  214. package/dist/backend/native-codegen.js.map +1 -1
  215. package/dist/backend/native-link-info-core.d.ts +8 -0
  216. package/dist/backend/native-link-info-core.js.map +1 -1
  217. package/dist/backend/native-profile.d.ts +14 -0
  218. package/dist/backend/native-profile.js +28 -0
  219. package/dist/backend/native-profile.js.map +1 -1
  220. package/dist/backend/native-profile.test.js +8 -1
  221. package/dist/backend/native-profile.test.js.map +1 -1
  222. package/dist/backend/native-toolchain.test.js +11 -11
  223. package/dist/backend/native-toolchain.test.js.map +1 -1
  224. package/dist/backend/runtime-abi.d.ts +2 -2
  225. package/dist/backend/runtime-abi.js +2 -2
  226. package/dist/backend/runtime-pack-core.d.ts +3 -1
  227. package/dist/backend/runtime-pack-core.js +2 -0
  228. package/dist/backend/runtime-pack-core.js.map +1 -1
  229. package/dist/backend/runtime-pack-native.d.ts +17 -5
  230. package/dist/backend/runtime-pack-native.js +186 -14
  231. package/dist/backend/runtime-pack-native.js.map +1 -1
  232. package/dist/backend/runtime-pack-native.test.js +160 -3
  233. package/dist/backend/runtime-pack-native.test.js.map +1 -1
  234. package/dist/backend/runtime-pack-targets.test.js +2 -1
  235. package/dist/backend/runtime-pack-targets.test.js.map +1 -1
  236. package/dist/backend/runtime-pack.test.js +2 -1
  237. package/dist/backend/runtime-pack.test.js.map +1 -1
  238. package/dist/backend/vendor-archives.d.ts +4 -1
  239. package/dist/backend/vendor-archives.js +78 -4
  240. package/dist/backend/vendor-archives.js.map +1 -1
  241. package/dist/backend/vendor-inputs.d.ts +3 -1
  242. package/dist/backend/vendor-inputs.js +3 -1
  243. package/dist/backend/vendor-inputs.js.map +1 -1
  244. package/dist/backend/warm-cache.js +1 -0
  245. package/dist/backend/warm-cache.js.map +1 -1
  246. package/dist/cli/command.js +78 -11
  247. package/dist/cli/command.js.map +1 -1
  248. package/dist/cli/usage.d.ts +22 -1
  249. package/dist/cli/usage.js +33 -3
  250. package/dist/cli/usage.js.map +1 -1
  251. package/dist/compat/fetch-profile.d.ts +15 -6
  252. package/dist/compat/fetch-profile.js +519 -498
  253. package/dist/compat/fetch-profile.js.map +1 -1
  254. package/dist/compile-types.d.ts +7 -0
  255. package/dist/contracts/int32-elements.js +2 -1
  256. package/dist/contracts/int32-elements.js.map +1 -1
  257. package/dist/coverage/report.d.ts +14 -3
  258. package/dist/coverage/report.js +216 -0
  259. package/dist/coverage/report.js.map +1 -1
  260. package/dist/coverage/surface-manifest.js +25 -25
  261. package/dist/coverage/surface-manifest.js.map +1 -1
  262. package/dist/coverage/verdict-cache.d.ts +2 -0
  263. package/dist/coverage/verdict-cache.js +10 -1
  264. package/dist/coverage/verdict-cache.js.map +1 -1
  265. package/dist/diagnostics/diagnostic.d.ts +19 -0
  266. package/dist/diagnostics/diagnostic.js +52 -1
  267. package/dist/diagnostics/diagnostic.js.map +1 -1
  268. package/dist/diagnostics/envelope.d.ts +54 -0
  269. package/dist/diagnostics/envelope.js +7 -1
  270. package/dist/diagnostics/envelope.js.map +1 -1
  271. package/dist/diagnostics/render.d.ts +7 -0
  272. package/dist/diagnostics/render.js +15 -4
  273. package/dist/diagnostics/render.js.map +1 -1
  274. package/dist/executable/executable-cache.d.ts +3 -0
  275. package/dist/executable/executable-cache.js +1 -0
  276. package/dist/executable/executable-cache.js.map +1 -1
  277. package/dist/executable/executable-cache.test.js +1 -0
  278. package/dist/executable/executable-cache.test.js.map +1 -1
  279. package/dist/executable/prepare.js +5 -1
  280. package/dist/executable/prepare.js.map +1 -1
  281. package/dist/frontend/analysis.js +26 -2
  282. package/dist/frontend/analysis.js.map +1 -1
  283. package/dist/frontend/fork-target.js +67 -1
  284. package/dist/frontend/fork-target.js.map +1 -1
  285. package/dist/frontend/fork-target.test.js +43 -0
  286. package/dist/frontend/fork-target.test.js.map +1 -1
  287. package/dist/frontend/input-tracker.d.ts +4 -1
  288. package/dist/frontend/input-tracker.js +42 -4
  289. package/dist/frontend/input-tracker.js.map +1 -1
  290. package/dist/frontend/input-tracker.test.js +45 -0
  291. package/dist/frontend/input-tracker.test.js.map +1 -1
  292. package/dist/frontend/lowering/abstract-equality.js +38 -1
  293. package/dist/frontend/lowering/abstract-equality.js.map +1 -1
  294. package/dist/frontend/lowering/argument-counts.d.ts +36 -0
  295. package/dist/frontend/lowering/argument-counts.js +201 -0
  296. package/dist/frontend/lowering/argument-counts.js.map +1 -0
  297. package/dist/frontend/lowering/array-values.d.ts +27 -0
  298. package/dist/frontend/lowering/array-values.js +112 -0
  299. package/dist/frontend/lowering/array-values.js.map +1 -1
  300. package/dist/frontend/lowering/binding-analysis.d.ts +3 -0
  301. package/dist/frontend/lowering/binding-analysis.js +9 -3
  302. package/dist/frontend/lowering/binding-analysis.js.map +1 -1
  303. package/dist/frontend/lowering/builtin-namespaces.d.ts +13 -0
  304. package/dist/frontend/lowering/builtin-namespaces.js +238 -0
  305. package/dist/frontend/lowering/builtin-namespaces.js.map +1 -0
  306. package/dist/frontend/lowering/builtins/compression.d.ts +4 -3
  307. package/dist/frontend/lowering/builtins/compression.js +86 -5
  308. package/dist/frontend/lowering/builtins/compression.js.map +1 -1
  309. package/dist/frontend/lowering/builtins/date-classes.js +17 -1
  310. package/dist/frontend/lowering/builtins/date-classes.js.map +1 -1
  311. package/dist/frontend/lowering/builtins/dates.d.ts +19 -5
  312. package/dist/frontend/lowering/builtins/dates.js +159 -8
  313. package/dist/frontend/lowering/builtins/dates.js.map +1 -1
  314. package/dist/frontend/lowering/builtins/filesystem-calls.js +26 -1
  315. package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -1
  316. package/dist/frontend/lowering/builtins/fs-streams.d.ts +4 -0
  317. package/dist/frontend/lowering/builtins/fs-streams.js +24 -1
  318. package/dist/frontend/lowering/builtins/fs-streams.js.map +1 -1
  319. package/dist/frontend/lowering/builtins/json.d.ts +4 -1
  320. package/dist/frontend/lowering/builtins/json.js +9 -3
  321. package/dist/frontend/lowering/builtins/json.js.map +1 -1
  322. package/dist/frontend/lowering/builtins/module-bindings.d.ts +6 -0
  323. package/dist/frontend/lowering/builtins/module-bindings.js +23 -1
  324. package/dist/frontend/lowering/builtins/module-bindings.js.map +1 -1
  325. package/dist/frontend/lowering/builtins/module-resolution.d.ts +5 -0
  326. package/dist/frontend/lowering/builtins/module-resolution.js +95 -4
  327. package/dist/frontend/lowering/builtins/module-resolution.js.map +1 -1
  328. package/dist/frontend/lowering/builtins/promises.js +144 -1
  329. package/dist/frontend/lowering/builtins/promises.js.map +1 -1
  330. package/dist/frontend/lowering/builtins/readline.d.ts +5 -1
  331. package/dist/frontend/lowering/builtins/readline.js +22 -11
  332. package/dist/frontend/lowering/builtins/readline.js.map +1 -1
  333. package/dist/frontend/lowering/builtins/reflection.d.ts +4 -1
  334. package/dist/frontend/lowering/builtins/reflection.js +41 -1
  335. package/dist/frontend/lowering/builtins/reflection.js.map +1 -1
  336. package/dist/frontend/lowering/builtins/text-codecs.js +31 -2
  337. package/dist/frontend/lowering/builtins/text-codecs.js.map +1 -1
  338. package/dist/frontend/lowering/builtins/webassembly.js +4 -1
  339. package/dist/frontend/lowering/builtins/webassembly.js.map +1 -1
  340. package/dist/frontend/lowering/builtins/x509.d.ts +33 -0
  341. package/dist/frontend/lowering/builtins/x509.js +431 -0
  342. package/dist/frontend/lowering/builtins/x509.js.map +1 -0
  343. package/dist/frontend/lowering/call-arguments.js +44 -0
  344. package/dist/frontend/lowering/call-arguments.js.map +1 -1
  345. package/dist/frontend/lowering/call-signatures.js +1 -1
  346. package/dist/frontend/lowering/call-signatures.js.map +1 -1
  347. package/dist/frontend/lowering/cjs-inline-require.js +1 -1
  348. package/dist/frontend/lowering/cjs-inline-require.js.map +1 -1
  349. package/dist/frontend/lowering/class-attributes.d.ts +7 -0
  350. package/dist/frontend/lowering/class-attributes.js +52 -10
  351. package/dist/frontend/lowering/class-attributes.js.map +1 -1
  352. package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +13 -0
  353. package/dist/frontend/lowering/class-dynamic-dispatch.js +174 -9
  354. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  355. package/dist/frontend/lowering/class-method-mutations.js +43 -8
  356. package/dist/frontend/lowering/class-method-mutations.js.map +1 -1
  357. package/dist/frontend/lowering/class-method-values.js +71 -1
  358. package/dist/frontend/lowering/class-method-values.js.map +1 -1
  359. package/dist/frontend/lowering/class-prototypes.d.ts +8 -0
  360. package/dist/frontend/lowering/class-prototypes.js +83 -2
  361. package/dist/frontend/lowering/class-prototypes.js.map +1 -1
  362. package/dist/frontend/lowering/class-to-primitive.d.ts +5 -0
  363. package/dist/frontend/lowering/class-to-primitive.js +79 -7
  364. package/dist/frontend/lowering/class-to-primitive.js.map +1 -1
  365. package/dist/frontend/lowering/coercions/state.d.ts +1 -0
  366. package/dist/frontend/lowering/coercions/state.js.map +1 -1
  367. package/dist/frontend/lowering/coercions/structural.js +89 -10
  368. package/dist/frontend/lowering/coercions/structural.js.map +1 -1
  369. package/dist/frontend/lowering/coercions/unions.d.ts +4 -2
  370. package/dist/frontend/lowering/coercions/unions.js +13 -6
  371. package/dist/frontend/lowering/coercions/unions.js.map +1 -1
  372. package/dist/frontend/lowering/containers/array-callbacks.js +51 -15
  373. package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -1
  374. package/dist/frontend/lowering/containers/array-construction.d.ts +4 -1
  375. package/dist/frontend/lowering/containers/array-construction.js +102 -9
  376. package/dist/frontend/lowering/containers/array-construction.js.map +1 -1
  377. package/dist/frontend/lowering/containers/array-methods.js +85 -5
  378. package/dist/frontend/lowering/containers/array-methods.js.map +1 -1
  379. package/dist/frontend/lowering/containers/array-pipelines.js +346 -77
  380. package/dist/frontend/lowering/containers/array-pipelines.js.map +1 -1
  381. package/dist/frontend/lowering/containers/callback-arguments.js +11 -1
  382. package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -1
  383. package/dist/frontend/lowering/containers/collection-methods.js +12 -0
  384. package/dist/frontend/lowering/containers/collection-methods.js.map +1 -1
  385. package/dist/frontend/lowering/containers/indexed-objects.js +73 -25
  386. package/dist/frontend/lowering/containers/indexed-objects.js.map +1 -1
  387. package/dist/frontend/lowering/containers/iterator-helpers.d.ts +4 -4
  388. package/dist/frontend/lowering/containers/iterator-helpers.js +8 -2
  389. package/dist/frontend/lowering/containers/iterator-helpers.js.map +1 -1
  390. package/dist/frontend/lowering/containers/replacer-params.d.ts +37 -0
  391. package/dist/frontend/lowering/containers/replacer-params.js +294 -0
  392. package/dist/frontend/lowering/containers/replacer-params.js.map +1 -0
  393. package/dist/frontend/lowering/containers/replacer-params.test.d.ts +1 -0
  394. package/dist/frontend/lowering/containers/replacer-params.test.js +61 -0
  395. package/dist/frontend/lowering/containers/replacer-params.test.js.map +1 -0
  396. package/dist/frontend/lowering/containers/string-and-regexp.js +2 -1
  397. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  398. package/dist/frontend/lowering/containers/string-replacement.js +7 -3
  399. package/dist/frontend/lowering/containers/string-replacement.js.map +1 -1
  400. package/dist/frontend/lowering/cycle-initialization.d.ts +4 -2
  401. package/dist/frontend/lowering/cycle-initialization.js +4 -1
  402. package/dist/frontend/lowering/cycle-initialization.js.map +1 -1
  403. package/dist/frontend/lowering/date-values.d.ts +9 -6
  404. package/dist/frontend/lowering/date-values.js +63 -16
  405. package/dist/frontend/lowering/date-values.js.map +1 -1
  406. package/dist/frontend/lowering/deferred-module-initializers.js +16 -8
  407. package/dist/frontend/lowering/deferred-module-initializers.js.map +1 -1
  408. package/dist/frontend/lowering/deferred-module-initializers.test.js +22 -6
  409. package/dist/frontend/lowering/deferred-module-initializers.test.js.map +1 -1
  410. package/dist/frontend/lowering/dispatch-sites.js +1 -0
  411. package/dist/frontend/lowering/dispatch-sites.js.map +1 -1
  412. package/dist/frontend/lowering/expressions/array-literals.d.ts +0 -8
  413. package/dist/frontend/lowering/expressions/array-literals.js +119 -26
  414. package/dist/frontend/lowering/expressions/array-literals.js.map +1 -1
  415. package/dist/frontend/lowering/expressions/binary.js +38 -0
  416. package/dist/frontend/lowering/expressions/binary.js.map +1 -1
  417. package/dist/frontend/lowering/expressions/element-access.js +50 -6
  418. package/dist/frontend/lowering/expressions/element-access.js.map +1 -1
  419. package/dist/frontend/lowering/expressions/identifiers.js +35 -3
  420. package/dist/frontend/lowering/expressions/identifiers.js.map +1 -1
  421. package/dist/frontend/lowering/expressions/narrowing.d.ts +2 -1
  422. package/dist/frontend/lowering/expressions/narrowing.js +8 -1
  423. package/dist/frontend/lowering/expressions/narrowing.js.map +1 -1
  424. package/dist/frontend/lowering/expressions/object-literals.js +8 -2
  425. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  426. package/dist/frontend/lowering/expressions/property-access.js +65 -34
  427. package/dist/frontend/lowering/expressions/property-access.js.map +1 -1
  428. package/dist/frontend/lowering/expressions/relational.js +76 -11
  429. package/dist/frontend/lowering/expressions/relational.js.map +1 -1
  430. package/dist/frontend/lowering/expressions/typeof.js +6 -1
  431. package/dist/frontend/lowering/expressions/typeof.js.map +1 -1
  432. package/dist/frontend/lowering/expressions/updates.js +20 -11
  433. package/dist/frontend/lowering/expressions/updates.js.map +1 -1
  434. package/dist/frontend/lowering/f64-handles.d.ts +8 -0
  435. package/dist/frontend/lowering/f64-handles.js +16 -0
  436. package/dist/frontend/lowering/f64-handles.js.map +1 -0
  437. package/dist/frontend/lowering/frozen-records.d.ts +5 -0
  438. package/dist/frontend/lowering/frozen-records.js +12 -4
  439. package/dist/frontend/lowering/frozen-records.js.map +1 -1
  440. package/dist/frontend/lowering/function-context.d.ts +3 -0
  441. package/dist/frontend/lowering/function-context.js.map +1 -1
  442. package/dist/frontend/lowering/function-returns.js +15 -0
  443. package/dist/frontend/lowering/function-returns.js.map +1 -1
  444. package/dist/frontend/lowering/generic-functions.js +17 -6
  445. package/dist/frontend/lowering/generic-functions.js.map +1 -1
  446. package/dist/frontend/lowering/instantiation-path.d.ts +3 -2
  447. package/dist/frontend/lowering/instantiation-path.js.map +1 -1
  448. package/dist/frontend/lowering/instantiation-path.test.js +6 -4
  449. package/dist/frontend/lowering/instantiation-path.test.js.map +1 -1
  450. package/dist/frontend/lowering/iterator-adapters.d.ts +4 -2
  451. package/dist/frontend/lowering/iterator-adapters.js +26 -33
  452. package/dist/frontend/lowering/iterator-adapters.js.map +1 -1
  453. package/dist/frontend/lowering/js-collection-types.d.ts +11 -0
  454. package/dist/frontend/lowering/js-collection-types.js +490 -0
  455. package/dist/frontend/lowering/js-collection-types.js.map +1 -0
  456. package/dist/frontend/lowering/lib-boundary.js +2 -2
  457. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  458. package/dist/frontend/lowering/lower-assert.d.ts +14 -0
  459. package/dist/frontend/lowering/lower-assert.js +283 -26
  460. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  461. package/dist/frontend/lowering/lower-builtin-values.js +3 -3
  462. package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
  463. package/dist/frontend/lowering/lower-calls.js +97 -7
  464. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  465. package/dist/frontend/lowering/lower-classes.d.ts +59 -7
  466. package/dist/frontend/lowering/lower-classes.js +647 -176
  467. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  468. package/dist/frontend/lowering/lower-console.js +2 -1
  469. package/dist/frontend/lowering/lower-console.js.map +1 -1
  470. package/dist/frontend/lowering/lower-exprs.d.ts +5 -0
  471. package/dist/frontend/lowering/lower-exprs.js +52 -5
  472. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  473. package/dist/frontend/lowering/lower-functions.js +7 -0
  474. package/dist/frontend/lowering/lower-functions.js.map +1 -1
  475. package/dist/frontend/lowering/lower-generators.js +4 -3
  476. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  477. package/dist/frontend/lowering/lower-inspect.js +264 -46
  478. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  479. package/dist/frontend/lowering/lower-modules.js +28 -17
  480. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  481. package/dist/frontend/lowering/lower-namespaces.d.ts +3 -0
  482. package/dist/frontend/lowering/lower-namespaces.js +44 -1
  483. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  484. package/dist/frontend/lowering/lower-node-module.js +1 -1
  485. package/dist/frontend/lowering/lower-node-module.js.map +1 -1
  486. package/dist/frontend/lowering/lower-server.js +126 -32
  487. package/dist/frontend/lowering/lower-server.js.map +1 -1
  488. package/dist/frontend/lowering/lower-stdlib.d.ts +4 -1
  489. package/dist/frontend/lowering/lower-stdlib.js +51 -37
  490. package/dist/frontend/lowering/lower-stdlib.js.map +1 -1
  491. package/dist/frontend/lowering/lower-stmts.js +294 -46
  492. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  493. package/dist/frontend/lowering/lower-stream.js +515 -121
  494. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  495. package/dist/frontend/lowering/lowerer.d.ts +52 -10
  496. package/dist/frontend/lowering/lowerer.js +249 -37
  497. package/dist/frontend/lowering/lowerer.js.map +1 -1
  498. package/dist/frontend/lowering/lowerer.test.js +1 -1
  499. package/dist/frontend/lowering/lowerer.test.js.map +1 -1
  500. package/dist/frontend/lowering/module-namespace-elements.d.ts +13 -0
  501. package/dist/frontend/lowering/module-namespace-elements.js +118 -1
  502. package/dist/frontend/lowering/module-namespace-elements.js.map +1 -1
  503. package/dist/frontend/lowering/private-brands.d.ts +5 -0
  504. package/dist/frontend/lowering/private-brands.js +39 -0
  505. package/dist/frontend/lowering/private-brands.js.map +1 -1
  506. package/dist/frontend/lowering/runtime-optional-elements.d.ts +6 -0
  507. package/dist/frontend/lowering/runtime-optional-elements.js +14 -3
  508. package/dist/frontend/lowering/runtime-optional-elements.js.map +1 -1
  509. package/dist/frontend/lowering/sanitize-class-types.js +2 -0
  510. package/dist/frontend/lowering/sanitize-class-types.js.map +1 -1
  511. package/dist/frontend/lowering/site-dependencies.d.ts +7 -2
  512. package/dist/frontend/lowering/site-dependencies.js +0 -15
  513. package/dist/frontend/lowering/site-dependencies.js.map +1 -1
  514. package/dist/frontend/lowering/site-dependencies.test.js +7 -5
  515. package/dist/frontend/lowering/site-dependencies.test.js.map +1 -1
  516. package/dist/frontend/lowering/string-index-bounds.d.ts +7 -4
  517. package/dist/frontend/lowering/string-index-bounds.js +21 -7
  518. package/dist/frontend/lowering/string-index-bounds.js.map +1 -1
  519. package/dist/frontend/lowering/surfaces.d.ts +12 -3
  520. package/dist/frontend/lowering/surfaces.js +1576 -1539
  521. package/dist/frontend/lowering/surfaces.js.map +1 -1
  522. package/dist/frontend/lowering/symbol-fields.d.ts +7 -0
  523. package/dist/frontend/lowering/symbol-fields.js +45 -2
  524. package/dist/frontend/lowering/symbol-fields.js.map +1 -1
  525. package/dist/frontend/lowering/union-narrow.d.ts +5 -2
  526. package/dist/frontend/lowering/union-narrow.js +6 -3
  527. package/dist/frontend/lowering/union-narrow.js.map +1 -1
  528. package/dist/frontend/lowering/union-narrow.test.js +10 -0
  529. package/dist/frontend/lowering/union-narrow.test.js.map +1 -1
  530. package/dist/frontend/npm-static-namespace-defaults.d.ts +6 -0
  531. package/dist/frontend/npm-static-namespace-defaults.js +163 -0
  532. package/dist/frontend/npm-static-namespace-defaults.js.map +1 -0
  533. package/dist/frontend/npm-static-namespace-defaults.test.d.ts +1 -0
  534. package/dist/frontend/npm-static-namespace-defaults.test.js +72 -0
  535. package/dist/frontend/npm-static-namespace-defaults.test.js.map +1 -0
  536. package/dist/frontend/npm-static-prune.js +152 -111
  537. package/dist/frontend/npm-static-prune.js.map +1 -1
  538. package/dist/frontend/npm-static.js +35 -32
  539. package/dist/frontend/npm-static.js.map +1 -1
  540. package/dist/frontend/package-shims.d.ts +7 -4
  541. package/dist/frontend/package-shims.js +39 -40
  542. package/dist/frontend/package-shims.js.map +1 -1
  543. package/dist/frontend/pipeline-native.d.ts +2 -2
  544. package/dist/frontend/pipeline-native.js +2 -2
  545. package/dist/frontend/pipeline-native.js.map +1 -1
  546. package/dist/frontend/pipeline.d.ts +19 -2
  547. package/dist/frontend/pipeline.js +102 -11
  548. package/dist/frontend/pipeline.js.map +1 -1
  549. package/dist/frontend/program-analysis.d.ts +2 -0
  550. package/dist/frontend/program-analysis.js +3 -0
  551. package/dist/frontend/program-analysis.js.map +1 -1
  552. package/dist/frontend/program.d.ts +15 -0
  553. package/dist/frontend/program.js +227 -64
  554. package/dist/frontend/program.js.map +1 -1
  555. package/dist/frontend/resolve.d.ts +2 -0
  556. package/dist/frontend/resolve.js +5 -0
  557. package/dist/frontend/resolve.js.map +1 -1
  558. package/dist/frontend/services.d.ts +3 -0
  559. package/dist/frontend/services.js +31 -4
  560. package/dist/frontend/services.js.map +1 -1
  561. package/dist/frontend/shape-inference/analyze.d.ts +93 -0
  562. package/dist/frontend/shape-inference/analyze.js +3138 -0
  563. package/dist/frontend/shape-inference/analyze.js.map +1 -0
  564. package/dist/frontend/shape-inference/constant-graphs.d.ts +54 -0
  565. package/dist/frontend/shape-inference/constant-graphs.js +357 -0
  566. package/dist/frontend/shape-inference/constant-graphs.js.map +1 -0
  567. package/dist/frontend/shape-inference/domain.d.ts +32 -0
  568. package/dist/frontend/shape-inference/domain.js +104 -0
  569. package/dist/frontend/shape-inference/domain.js.map +1 -0
  570. package/dist/frontend/shape-inference/index.d.ts +7 -0
  571. package/dist/frontend/shape-inference/index.js +19 -0
  572. package/dist/frontend/shape-inference/index.js.map +1 -0
  573. package/dist/frontend/shape-inference/report.d.ts +21 -0
  574. package/dist/frontend/shape-inference/report.js +348 -0
  575. package/dist/frontend/shape-inference/report.js.map +1 -0
  576. package/dist/frontend/token-equivalence.d.ts +6 -0
  577. package/dist/frontend/token-equivalence.js +66 -9
  578. package/dist/frontend/token-equivalence.js.map +1 -1
  579. package/dist/frontend/token-equivalence.test.js +33 -1
  580. package/dist/frontend/token-equivalence.test.js.map +1 -1
  581. package/dist/frontend/ts7/checker-features.d.ts +15 -0
  582. package/dist/frontend/ts7/checker-features.js +45 -0
  583. package/dist/frontend/ts7/checker-features.js.map +1 -0
  584. package/dist/frontend/ts7/checker-features.test.d.ts +1 -0
  585. package/dist/frontend/ts7/checker-features.test.js +40 -0
  586. package/dist/frontend/ts7/checker-features.test.js.map +1 -0
  587. package/dist/frontend/ts7/checker-server.d.ts +19 -0
  588. package/dist/frontend/ts7/checker-server.js +46 -0
  589. package/dist/frontend/ts7/checker-server.js.map +1 -0
  590. package/dist/frontend/ts7/checker-server.test.d.ts +1 -0
  591. package/dist/frontend/ts7/checker-server.test.js +38 -0
  592. package/dist/frontend/ts7/checker-server.test.js.map +1 -0
  593. package/dist/frontend/ts7/lib-diagnostics.js +39 -13
  594. package/dist/frontend/ts7/lib-diagnostics.js.map +1 -1
  595. package/dist/frontend/ts7/lib-diagnostics.test.js +40 -0
  596. package/dist/frontend/ts7/lib-diagnostics.test.js.map +1 -1
  597. package/dist/frontend/ts7/native-api.d.ts +1 -0
  598. package/dist/frontend/ts7/native-api.js +25 -2
  599. package/dist/frontend/ts7/native-api.js.map +1 -1
  600. package/dist/frontend/ts7/native-process.d.ts +9 -2
  601. package/dist/frontend/ts7/native-process.js +22 -4
  602. package/dist/frontend/ts7/native-process.js.map +1 -1
  603. package/dist/frontend/ts7/program-host.d.ts +11 -0
  604. package/dist/frontend/ts7/program-host.js +36 -22
  605. package/dist/frontend/ts7/program-host.js.map +1 -1
  606. package/dist/frontend/ts7/semantic-json.d.ts +9 -0
  607. package/dist/frontend/ts7/semantic-json.js +25 -5
  608. package/dist/frontend/ts7/semantic-json.js.map +1 -1
  609. package/dist/frontend/ts7/semantic-model.js +3 -1
  610. package/dist/frontend/ts7/semantic-model.js.map +1 -1
  611. package/dist/frontend/ts7/source-parser.js +3 -1
  612. package/dist/frontend/ts7/source-parser.js.map +1 -1
  613. package/dist/frontend/tsc-codes.js +10 -0
  614. package/dist/frontend/tsc-codes.js.map +1 -1
  615. package/dist/frontend/type-mapper.d.ts +18 -6
  616. package/dist/frontend/type-mapper.js +160 -28
  617. package/dist/frontend/type-mapper.js.map +1 -1
  618. package/dist/index.d.ts +44 -3
  619. package/dist/index.js +27 -8
  620. package/dist/index.js.map +1 -1
  621. package/dist/ir/builtin-effects.js +29 -0
  622. package/dist/ir/builtin-effects.js.map +1 -1
  623. package/dist/ir/builtin-signatures.d.ts +7 -2
  624. package/dist/ir/builtin-signatures.js +5104 -4950
  625. package/dist/ir/builtin-signatures.js.map +1 -1
  626. package/dist/ir/callback-specialization.d.ts +4 -2
  627. package/dist/ir/callback-specialization.js +24 -9
  628. package/dist/ir/callback-specialization.js.map +1 -1
  629. package/dist/ir/capture-values.js +4 -2
  630. package/dist/ir/capture-values.js.map +1 -1
  631. package/dist/ir/char-unit-locals.d.ts +12 -2
  632. package/dist/ir/char-unit-locals.js +400 -58
  633. package/dist/ir/char-unit-locals.js.map +1 -1
  634. package/dist/ir/char-unit-locals.test.js +111 -0
  635. package/dist/ir/char-unit-locals.test.js.map +1 -1
  636. package/dist/ir/constant-globals.js +18 -4
  637. package/dist/ir/constant-globals.js.map +1 -1
  638. package/dist/ir/expression-inlining.d.ts +15 -0
  639. package/dist/ir/expression-inlining.js +166 -0
  640. package/dist/ir/expression-inlining.js.map +1 -0
  641. package/dist/ir/expression-inlining.test.d.ts +1 -0
  642. package/dist/ir/expression-inlining.test.js +123 -0
  643. package/dist/ir/expression-inlining.test.js.map +1 -0
  644. package/dist/ir/function-references.js +2 -0
  645. package/dist/ir/function-references.js.map +1 -1
  646. package/dist/ir/function-references.test.js +6 -0
  647. package/dist/ir/function-references.test.js.map +1 -1
  648. package/dist/ir/int32-arrays.d.ts +27 -6
  649. package/dist/ir/int32-arrays.js +106 -18
  650. package/dist/ir/int32-arrays.js.map +1 -1
  651. package/dist/ir/int32-slots.d.ts +26 -1
  652. package/dist/ir/int32-slots.js +284 -5
  653. package/dist/ir/int32-slots.js.map +1 -1
  654. package/dist/ir/int32-slots.test.js +5 -0
  655. package/dist/ir/int32-slots.test.js.map +1 -1
  656. package/dist/ir/integer-loop-facts.d.ts +5 -0
  657. package/dist/ir/integer-loop-facts.js +90 -1
  658. package/dist/ir/integer-loop-facts.js.map +1 -1
  659. package/dist/ir/integer-loops.d.ts +14 -1
  660. package/dist/ir/integer-loops.js +93 -7
  661. package/dist/ir/integer-loops.js.map +1 -1
  662. package/dist/ir/integer-loops.test.js +70 -0
  663. package/dist/ir/integer-loops.test.js.map +1 -1
  664. package/dist/ir/integer-ranges.js +18 -2
  665. package/dist/ir/integer-ranges.js.map +1 -1
  666. package/dist/ir/integer-ranges.test.js +64 -4
  667. package/dist/ir/integer-ranges.test.js.map +1 -1
  668. package/dist/ir/ir.d.ts +50 -8
  669. package/dist/ir/ir.js +38 -12
  670. package/dist/ir/ir.js.map +1 -1
  671. package/dist/ir/js-ic.d.ts +25 -5
  672. package/dist/ir/js-ic.js +93 -13
  673. package/dist/ir/js-ic.js.map +1 -1
  674. package/dist/ir/js-ic.test.js +153 -0
  675. package/dist/ir/js-ic.test.js.map +1 -1
  676. package/dist/ir/node-index.d.ts +7 -0
  677. package/dist/ir/node-index.js +32 -0
  678. package/dist/ir/node-index.js.map +1 -1
  679. package/dist/ir/receiver-readers.d.ts +6 -1
  680. package/dist/ir/receiver-readers.js +53 -28
  681. package/dist/ir/receiver-readers.js.map +1 -1
  682. package/dist/ir/row-pairs.d.ts +15 -0
  683. package/dist/ir/row-pairs.js +373 -0
  684. package/dist/ir/row-pairs.js.map +1 -0
  685. package/dist/ir/row-pairs.test.d.ts +1 -0
  686. package/dist/ir/row-pairs.test.js +129 -0
  687. package/dist/ir/row-pairs.test.js.map +1 -0
  688. package/dist/ir/runtime-features.d.ts +17 -4
  689. package/dist/ir/runtime-features.js +69 -12
  690. package/dist/ir/runtime-features.js.map +1 -1
  691. package/dist/ir/scalar-records.d.ts +15 -0
  692. package/dist/ir/scalar-records.js +301 -1
  693. package/dist/ir/scalar-records.js.map +1 -1
  694. package/dist/ir/scalar-records.test.js +181 -1
  695. package/dist/ir/scalar-records.test.js.map +1 -1
  696. package/dist/ir/self-captures.js +8 -0
  697. package/dist/ir/self-captures.js.map +1 -1
  698. package/dist/ir/validate.js +37 -28
  699. package/dist/ir/validate.js.map +1 -1
  700. package/dist/library/fence-eval.js +4 -4
  701. package/dist/library/fence-eval.js.map +1 -1
  702. package/dist/library/ir-policy.js +4 -0
  703. package/dist/library/ir-policy.js.map +1 -1
  704. package/dist/library/library-cache.d.ts +1 -0
  705. package/dist/library/library-cache.js +1 -0
  706. package/dist/library/library-cache.js.map +1 -1
  707. package/dist/library/library-cache.test.js +13 -0
  708. package/dist/library/library-cache.test.js.map +1 -1
  709. package/dist/native/cache.d.ts +5 -1
  710. package/dist/native/cache.js +15 -3
  711. package/dist/native/cache.js.map +1 -1
  712. package/dist/native/cli.js +6 -0
  713. package/dist/native/cli.js.map +1 -1
  714. package/dist/native/compiler.d.ts +3 -0
  715. package/dist/native/compiler.js +72 -26
  716. package/dist/native/compiler.js.map +1 -1
  717. package/dist/native/compiler.test.js +87 -2
  718. package/dist/native/compiler.test.js.map +1 -1
  719. package/dist/native/executable-cache-open.test.d.ts +1 -0
  720. package/dist/native/executable-cache-open.test.js +80 -0
  721. package/dist/native/executable-cache-open.test.js.map +1 -0
  722. package/dist/native/executable-cache.d.ts +43 -3
  723. package/dist/native/executable-cache.js +177 -36
  724. package/dist/native/executable-cache.js.map +1 -1
  725. package/dist/native/executable-cache.test.js +103 -0
  726. package/dist/native/executable-cache.test.js.map +1 -1
  727. package/dist/native/prepare.js +38 -16
  728. package/dist/native/prepare.js.map +1 -1
  729. package/dist/native/prepare.test.js +51 -1
  730. package/dist/native/prepare.test.js.map +1 -1
  731. package/dist/native/sanitizer.d.ts +1 -1
  732. package/dist/native/sanitizer.js +17 -3
  733. package/dist/native/sanitizer.js.map +1 -1
  734. package/dist/native/sanitizer.test.js +4 -0
  735. package/dist/native/sanitizer.test.js.map +1 -1
  736. package/dist/node-islands/classify.d.ts +14 -0
  737. package/dist/node-islands/classify.js +114 -0
  738. package/dist/node-islands/classify.js.map +1 -0
  739. package/dist/node-islands/detect.d.ts +13 -0
  740. package/dist/node-islands/detect.js +805 -0
  741. package/dist/node-islands/detect.js.map +1 -0
  742. package/dist/node-islands/detect.test.d.ts +1 -0
  743. package/dist/node-islands/detect.test.js +136 -0
  744. package/dist/node-islands/detect.test.js.map +1 -0
  745. package/dist/node-islands/origin.d.ts +21 -0
  746. package/dist/node-islands/origin.js +60 -0
  747. package/dist/node-islands/origin.js.map +1 -0
  748. package/dist/node-islands/policy.d.ts +49 -0
  749. package/dist/node-islands/policy.js +130 -0
  750. package/dist/node-islands/policy.js.map +1 -0
  751. package/dist/node-islands/report.d.ts +22 -0
  752. package/dist/node-islands/report.js +326 -0
  753. package/dist/node-islands/report.js.map +1 -0
  754. package/dist/node-islands/report.test.d.ts +1 -0
  755. package/dist/node-islands/report.test.js +228 -0
  756. package/dist/node-islands/report.test.js.map +1 -0
  757. package/dist/node-islands/rules.d.ts +20 -0
  758. package/dist/node-islands/rules.js +91 -0
  759. package/dist/node-islands/rules.js.map +1 -0
  760. package/dist/node-islands/scan.d.ts +53 -0
  761. package/dist/node-islands/scan.js +104 -0
  762. package/dist/node-islands/scan.js.map +1 -0
  763. package/dist/node-islands/summary.d.ts +78 -0
  764. package/dist/node-islands/summary.js +26 -0
  765. package/dist/node-islands/summary.js.map +1 -0
  766. package/dist/project-config.d.ts +50 -0
  767. package/dist/project-config.js +372 -0
  768. package/dist/project-config.js.map +1 -0
  769. package/dist/project-config.test.d.ts +1 -0
  770. package/dist/project-config.test.js +154 -0
  771. package/dist/project-config.test.js.map +1 -0
  772. package/dist/wasm/discover.js +6 -31
  773. package/dist/wasm/discover.js.map +1 -1
  774. package/package.json +20 -20
  775. package/surface-manifest.json +20 -35
@@ -733,6 +733,12 @@ export const OBJECT_CALLABLE_VALUES = {
733
733
  result: DYN,
734
734
  valueParams: exactValueParams(DYN, DYN),
735
735
  },
736
+ hasOwn: {
737
+ fn: "dyn.hasOwnComputed",
738
+ params: [DYN, DYN],
739
+ result: BOOL,
740
+ valueParams: exactValueParams(DYN, DYN),
741
+ },
736
742
  keys: { fn: "dyn.objKeys", params: [DYN], result: DYN, valueParams: exactValueParams(DYN) },
737
743
  values: { fn: "dyn.objValues", params: [DYN], result: DYN, valueParams: exactValueParams(DYN) },
738
744
  entries: { fn: "dyn.objEntries", params: [DYN], result: DYN, valueParams: exactValueParams(DYN) },
@@ -976,909 +982,936 @@ export const UTIL_TYPES_KEYS = [
976
982
  "isKeyObject",
977
983
  "isCryptoKey",
978
984
  ];
979
- export const BUILTIN_MODULE_FNS = {
980
- fs: {
981
- readFileSync: { fn: "fs.readFileSync", params: [STRING, STRING], result: STRING },
982
- // The exact-API subset is first-class. A fixed native ABI is not enough:
983
- // rows whose Node function has behavior-bearing trailing options remain
984
- // call-only, or function-width adaptation could discard those options
985
- // without a diagnostic before entering the fixed runtime call.
986
- writeFileSync: { fn: "fs.writeFileSync", params: [STRING, STRING], result: VOID },
987
- appendFileSync: { fn: "fs.appendFileSync", params: [STRING, STRING], result: VOID },
988
- existsSync: {
989
- fn: "fs.existsSync",
990
- params: [STRING],
991
- result: BOOL,
992
- valueParams: exactValueParams(STRING),
993
- },
994
- mkdirSync: { fn: "fs.mkdirSync", params: [STRING], result: VOID },
995
- rmSync: { fn: "fs.rmSync", params: [STRING], result: VOID },
996
- rmdirSync: { fn: "fs.rmdirSync", params: [STRING], result: VOID },
997
- readdirSync: { fn: "fs.readdirSync", params: [STRING], result: arrayOf(STRING) },
998
- // Pattern and options are checked by the runtime (lowerFsGlobSyncCall).
999
- globSync: { fn: "fs.globSync", params: [DYN, DYN], result: arrayOf(STRING) },
1000
- statSync: { fn: "fs.statSync", params: [STRING], result: STATS_T },
1001
- mkdtempSync: { fn: "fs.mkdtempSync", params: [STRING], result: STRING },
1002
- // accessSync's omitted mode completes to 0 (F_OK) in the special case
1003
- // in lowerBuiltinModuleCall — string `defaults` can't spell a number.
1004
- accessSync: { fn: "fs.accessSync", params: [STRING, F64], result: VOID },
1005
- unlinkSync: {
1006
- fn: "fs.unlinkSync",
1007
- params: [STRING],
1008
- result: VOID,
1009
- valueParams: exactValueParams(STRING),
1010
- },
1011
- chmodSync: {
1012
- fn: "fs.chmodSync",
1013
- params: [STRING, F64],
1014
- result: VOID,
1015
- valueParams: exactValueParams(STRING, F64),
1016
- },
1017
- chownSync: {
1018
- fn: "fs.chownSync",
1019
- params: [STRING, F64, F64],
1020
- result: VOID,
1021
- valueParams: exactValueParams(STRING, F64, F64),
1022
- },
1023
- lchownSync: {
1024
- fn: "fs.lchownSync",
1025
- params: [STRING, F64, F64],
1026
- result: VOID,
1027
- valueParams: exactValueParams(STRING, F64, F64),
1028
- },
1029
- fchownSync: {
1030
- fn: "fs.fchownSync",
1031
- params: [F64, F64, F64],
1032
- result: VOID,
1033
- valueParams: exactValueParams(F64, F64, F64),
1034
- },
1035
- // truncateSync's omitted len completes to 0 in lowerBuiltinModuleCall,
1036
- // like accessSync's mode.
1037
- truncateSync: { fn: "fs.truncateSync", params: [STRING, F64], result: VOID },
1038
- // The 2-argument form only: Node's mode flags (COPYFILE_EXCL, ...)
1039
- // land on the arity fence.
1040
- copyFileSync: { fn: "fs.copyFileSync", params: [STRING, STRING], result: VOID },
1041
- // The callback form is special-cased in lowerBuiltinModuleCall: its
1042
- // Error | null parameter is program-shaped and needs an emitted
1043
- // adapter. The row still projects the static surface and routes the
1044
- // dispatch.
1045
- rename: { fn: "fs.renameCb", params: [], result: VOID },
1046
- renameSync: {
1047
- fn: "fs.renameSync",
1048
- params: [STRING, STRING],
1049
- result: VOID,
1050
- valueParams: exactValueParams(STRING, STRING),
1051
- },
1052
- // statSync's no-follow sibling; stats.isSymbolicLink answers what the
1053
- // follow-free snapshot saw.
1054
- // opendirSync's options (a literal { bufferSize, encoding: "utf8" })
1055
- // lower in lowerBuiltinModuleCall; the row routes the dispatch.
1056
- opendirSync: { fn: "fs.opendirSync", params: [STRING, F64], result: DIR_T },
1057
- // createReadStream/createWriteStream lower in lowerBuiltinModuleCall
1058
- // (path and options cross as dyn values); the rows route the dispatch.
1059
- createReadStream: {
1060
- fn: "fs.createReadStream",
1061
- params: [DYN, DYN],
1062
- result: { kind: "object", className: "%Readable" },
1063
- },
1064
- createWriteStream: {
1065
- fn: "fs.createWriteStream",
1066
- params: [DYN, DYN],
1067
- result: { kind: "object", className: "%Writable" },
1068
- },
1069
- lstatSync: { fn: "fs.lstatSync", params: [STRING], result: STATS_T },
1070
- fstatSync: {
1071
- fn: "fs.fstatSync",
1072
- params: [F64],
1073
- result: STATS_T,
1074
- valueParams: exactValueParams(F64),
1075
- },
1076
- fchmodSync: {
1077
- fn: "fs.fchmodSync",
1078
- params: [F64, F64],
1079
- result: VOID,
1080
- valueParams: exactValueParams(F64, F64),
1081
- },
1082
- fsyncSync: {
1083
- fn: "fs.fsyncSync",
1084
- params: [F64],
1085
- result: VOID,
1086
- valueParams: exactValueParams(F64),
1087
- },
1088
- fdatasyncSync: {
1089
- fn: "fs.fdatasyncSync",
1090
- params: [F64],
1091
- result: VOID,
1092
- valueParams: exactValueParams(F64),
1093
- },
1094
- ftruncateSync: { fn: "fs.ftruncateSync", params: [F64, F64], result: VOID },
1095
- utimesSync: { fn: "fs.utimesSync", params: [DYN, DYN, DYN], result: VOID },
1096
- futimesSync: { fn: "fs.futimesSync", params: [DYN, DYN, DYN], result: VOID },
1097
- lutimesSync: { fn: "fs.lutimesSync", params: [DYN, DYN, DYN], result: VOID },
1098
- readvSync: { fn: "fs.readvSync", params: [F64, arrayOf(BYTES_U8), F64], result: F64 },
1099
- writevSync: { fn: "fs.writevSync", params: [F64, arrayOf(BYTES_U8), F64], result: F64 },
1100
- linkSync: {
1101
- fn: "fs.linkSync",
1102
- params: [DYN, DYN],
1103
- result: VOID,
1104
- valueParams: exactValueParams(DYN, DYN),
1105
- },
1106
- // Options and paths are checked by the runtime (scr_fs_cp_begin).
1107
- cpSync: {
1108
- fn: "fs.cpSync",
1109
- params: [DYN, DYN, DYN],
1110
- result: VOID,
1111
- valueParams: [
1112
- ...exactValueParams(DYN, DYN),
1113
- { mode: "optional", type: DYN, defaultValue: undefined },
1114
- ],
1115
- },
1116
- symlinkSync: {
1117
- fn: "fs.symlinkSync",
1118
- params: [DYN, DYN, DYN],
1119
- result: VOID,
1120
- valueParams: [
1121
- ...exactValueParams(DYN, DYN),
1122
- { mode: "optional", type: DYN, defaultValue: undefined },
1123
- ],
1124
- },
1125
- readlinkSync: {
1126
- fn: "fs.readlinkSync",
1127
- params: [DYN, DYN],
1128
- result: DYN,
1129
- valueParams: [
1130
- ...exactValueParams(DYN),
1131
- { mode: "optional", type: DYN, defaultValue: undefined },
1132
- ],
1133
- },
1134
- statfsSync: {
1135
- fn: "fs.statfsSync",
1136
- params: [DYN, DYN],
1137
- result: DYN,
1138
- valueParams: [
1139
- ...exactValueParams(DYN),
1140
- { mode: "optional", type: DYN, defaultValue: undefined },
1141
- ],
1142
- },
1143
- // realpath(3) — Node's realpathSync (failures spell syscall "lstat",
1144
- // Node's own message shape).
1145
- realpathSync: { fn: "fs.realpathSync", params: [STRING], result: STRING },
1146
- "realpathSync.native": { fn: "fs.realpathNativeSync", params: [STRING], result: STRING },
1147
- // The fd pair behind spawn's fd-stdio form (the daemon-log idiom:
1148
- // openSync(logPath, "a") → spawn stdio ["ignore", fd, fd] →
1149
- // closeSync). String flags use the established two-argument path;
1150
- // inline numeric O_* expressions route through openNumericSync, with
1151
- // an optional creation mode as the third argument.
1152
- openSync: { fn: "fs.openSync", params: [STRING, STRING], result: F64 },
1153
- // The buffer forms (fd, buffer, offset, length[, position]). The
1154
- // lowering completes an omitted or literal-null position to -1 (the
1155
- // runtime's current-offset sentinel); numeric positions read without
1156
- // advancing the fd. The options-object and bigint forms still fence.
1157
- readSync: { fn: "fs.readSync", params: [F64, BYTES_U8, F64, F64, F64], result: F64 },
1158
- // Entirely special-cased: the classic Buffer window and utf8 string
1159
- // overloads lower to separate fixed-width runtime ABIs. As with
1160
- // readSync, -1 is the current-offset sentinel.
1161
- writeSync: { fn: "fs.writeSync", params: [F64, BYTES_U8, F64, F64, F64], result: F64 },
1162
- closeSync: {
1163
- fn: "fs.closeSync",
1164
- params: [F64],
1165
- result: VOID,
1166
- valueParams: exactValueParams(F64),
1167
- },
1168
- // Entirely special-cased (lowerFsWatchCall — the callback needs an
1169
- // adapter per listener shape); this entry only routes the dispatch.
1170
- watch: { fn: "fs.watch", params: [], result: VOID },
1171
- },
1172
- "fs/promises": {
1173
- // The sync operations behind already-settled promises: failures
1174
- // REJECT (catchable at the await) instead of throwing. readFile is
1175
- // utf8-fenced exactly like readFileSync (same special case below).
1176
- readFile: {
1177
- fn: "fsp.readFile",
1178
- params: [STRING, STRING],
1179
- result: { kind: "promise", inner: STRING },
1180
- },
1181
- writeFile: {
1182
- fn: "fsp.writeFile",
1183
- params: [STRING, STRING],
1184
- result: { kind: "promise", inner: VOID },
1185
- },
1186
- mkdir: { fn: "fsp.mkdir", params: [STRING], result: { kind: "promise", inner: VOID } },
1187
- readdir: {
1188
- fn: "fsp.readdir",
1189
- params: [STRING],
1190
- result: { kind: "promise", inner: arrayOf(STRING) },
1191
- },
1192
- rm: { fn: "fsp.rm", params: [STRING], result: { kind: "promise", inner: VOID } },
1193
- // The async iterator lowers only as a for await head (lowerFspGlobCall).
1194
- glob: { fn: "fsp.globStrings", params: [DYN, DYN], result: arrayOf(STRING) },
1195
- stat: { fn: "fsp.stat", params: [STRING], result: { kind: "promise", inner: STATS_T } },
1196
- realpath: { fn: "fsp.realpath", params: [STRING], result: { kind: "promise", inner: STRING } },
1197
- lstat: { fn: "fsp.lstat", params: [STRING], result: { kind: "promise", inner: STATS_T } },
1198
- opendir: {
1199
- fn: "fsp.opendir",
1200
- params: [STRING, F64],
1201
- result: { kind: "promise", inner: DIR_T },
1202
- },
1203
- unlink: {
1204
- fn: "fsp.unlink",
1205
- params: [STRING],
1206
- result: { kind: "promise", inner: VOID },
1207
- valueParams: exactValueParams(STRING),
1208
- },
1209
- chmod: {
1210
- fn: "fsp.chmod",
1211
- params: [STRING, F64],
1212
- result: { kind: "promise", inner: VOID },
1213
- valueParams: exactValueParams(STRING, F64),
1214
- },
1215
- chown: {
1216
- fn: "fsp.chown",
1217
- params: [STRING, F64, F64],
1218
- result: { kind: "promise", inner: VOID },
1219
- valueParams: exactValueParams(STRING, F64, F64),
1220
- },
1221
- lchown: {
1222
- fn: "fsp.lchown",
1223
- params: [STRING, F64, F64],
1224
- result: { kind: "promise", inner: VOID },
1225
- valueParams: exactValueParams(STRING, F64, F64),
1226
- },
1227
- // access' omitted mode and truncate's omitted len complete to 0 in
1228
- // lowerBuiltinModuleCall, like their sync spellings.
1229
- access: { fn: "fsp.access", params: [STRING, F64], result: { kind: "promise", inner: VOID } },
1230
- truncate: {
1231
- fn: "fsp.truncate",
1232
- params: [STRING, F64],
1233
- result: { kind: "promise", inner: VOID },
1234
- },
1235
- // String data; Uint8Array/Buffer data routes to fsp.appendFileBytes in
1236
- // lowerBuiltinModuleCall.
1237
- appendFile: {
1238
- fn: "fsp.appendFile",
1239
- params: [STRING, STRING],
1240
- result: { kind: "promise", inner: VOID },
1241
- },
1242
- // The 2-argument form only, like copyFileSync.
1243
- copyFile: {
1244
- fn: "fsp.copyFile",
1245
- params: [STRING, STRING],
1246
- result: { kind: "promise", inner: VOID },
1247
- },
1248
- mkdtemp: { fn: "fsp.mkdtemp", params: [STRING], result: { kind: "promise", inner: STRING } },
1249
- rmdir: { fn: "fsp.rmdir", params: [STRING], result: { kind: "promise", inner: VOID } },
1250
- link: {
1251
- fn: "fsp.link",
1252
- params: [DYN, DYN],
1253
- result: { kind: "promise", inner: VOID },
1254
- valueParams: exactValueParams(DYN, DYN),
1255
- },
1256
- cp: {
1257
- fn: "fsp.cp",
1258
- params: [DYN, DYN, DYN],
1259
- result: { kind: "promise", inner: VOID },
1260
- valueParams: [
1261
- ...exactValueParams(DYN, DYN),
1262
- { mode: "optional", type: DYN, defaultValue: undefined },
1263
- ],
1264
- },
1265
- symlink: {
1266
- fn: "fsp.symlink",
1267
- params: [DYN, DYN, DYN],
1268
- result: { kind: "promise", inner: VOID },
1269
- valueParams: [
1270
- ...exactValueParams(DYN, DYN),
1271
- { mode: "optional", type: DYN, defaultValue: undefined },
1272
- ],
1273
- },
1274
- readlink: {
1275
- fn: "fsp.readlink",
1276
- params: [DYN, DYN],
1277
- result: { kind: "promise", inner: DYN },
1278
- valueParams: [
1279
- ...exactValueParams(DYN),
1280
- { mode: "optional", type: DYN, defaultValue: undefined },
1281
- ],
1282
- },
1283
- statfs: {
1284
- fn: "fsp.statfs",
1285
- params: [DYN, DYN],
1286
- result: { kind: "promise", inner: DYN },
1287
- valueParams: [
1288
- ...exactValueParams(DYN),
1289
- { mode: "optional", type: DYN, defaultValue: undefined },
1290
- ],
1291
- },
1292
- utimes: { fn: "fsp.utimes", params: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
1293
- lutimes: {
1294
- fn: "fsp.lutimes",
1295
- params: [DYN, DYN, DYN],
1296
- result: { kind: "promise", inner: VOID },
1297
- },
1298
- rename: {
1299
- fn: "fsp.rename",
1300
- params: [STRING, STRING],
1301
- result: { kind: "promise", inner: VOID },
1302
- valueParams: exactValueParams(STRING, STRING),
1303
- },
1304
- // open's optional flags/mode completion is special-cased in
1305
- // lowerBuiltinModuleCall; this row routes all import spellings and
1306
- // gives coverage the static member.
1307
- open: {
1308
- fn: "fsp.open",
1309
- params: [STRING, STRING, F64],
1310
- result: { kind: "promise", inner: FILEHANDLE_T },
1311
- valueParams: [
1312
- { mode: "required", type: STRING },
1313
- { mode: "optional", type: STRING, defaultValue: "r" },
1314
- { mode: "optional", type: F64, defaultValue: 0o666 },
1315
- ],
1316
- },
1317
- },
1318
- // The bare module's POSIX-target binding; a win32 target rebinds it to
1319
- // the win32 table (builtinModuleFnsOf — Node on Windows IS path.win32).
1320
- path: PATH_MODULE_FNS,
1321
- // Real Node modules ("node:path/posix" resolves), and the receivers of
1322
- // `path.posix.<member>` / `path.win32.<member>` through the namespace
1323
- // chain (builtinNamespaceModuleOf composes "path" + ".posix" to these
1324
- // keys). Both namespaces carry the FULL surface on every platform,
1325
- // Node's own rule: each answers its own platform's semantics anywhere.
1326
- "path/posix": PATH_MODULE_FNS,
1327
- "path/win32": PATH_WIN32_MODULE_FNS,
1328
- os: {
1329
- // One platform implementation: os.platform() === process.platform.
1330
- platform: { fn: "process.platform", params: [], result: STRING, valueParams: [] },
1331
- homedir: { fn: "os.homedir", params: [], result: STRING, valueParams: [] },
1332
- tmpdir: { fn: "os.tmpdir", params: [], result: STRING, valueParams: [] },
1333
- // uname(2)'s release field — Node's own implementation.
1334
- release: { fn: "os.release", params: [], result: STRING, valueParams: [] },
1335
- // uname(2)'s sysname field ("Darwin", "Linux", "Windows_NT") — the
1336
- // libFn/runtime pair predates this entry (the portless surface used
1337
- // them); this row makes the MODULE call reach them (test/common's
1338
- // isAIX/isIBMi getters are the canonical callers).
1339
- type: { fn: "os.type", params: [], result: STRING, valueParams: [] },
1340
- // Total physical memory in bytes — same predating-pair story.
1341
- totalmem: { fn: "os.totalmem", params: [], result: F64, valueParams: [] },
1342
- // uv_available_parallelism: the CPUs this process may use (affinity,
1343
- // then cgroup quota on Linux), at least 1.
1344
- availableParallelism: {
1345
- fn: "os.availableParallelism",
1346
- params: [],
1347
- result: F64,
1348
- valueParams: [],
1349
- },
1350
- // os.arch() IS process.arch, like platform().
1351
- arch: { fn: "process.arch", params: [], result: STRING, valueParams: [] },
1352
- hostname: { fn: "os.hostname", params: [], result: STRING, valueParams: [] },
1353
- // uv_os_uname's machine and version fields, read once at module load
1354
- // in Node (they never change while a process runs).
1355
- machine: { fn: "os.machine", params: [], result: STRING, valueParams: [] },
1356
- version: { fn: "os.version", params: [], result: STRING, valueParams: [] },
1357
- endianness: { fn: "os.endianness", params: [], result: STRING, valueParams: [] },
1358
- freemem: { fn: "os.freemem", params: [], result: F64, valueParams: [] },
1359
- uptime: { fn: "os.uptime", params: [], result: F64, valueParams: [] },
1360
- loadavg: { fn: "os.loadavg", params: [], result: arrayOf(F64), valueParams: [] },
1361
- // An omitted (or undefined) pid is 0, the current process
1362
- // (lowerOsGetPriorityCall completes it).
1363
- getPriority: {
1364
- fn: "os.getPriority",
1365
- params: [F64],
1366
- result: F64,
1367
- valueParams: [{ mode: "optional", type: F64, defaultValue: 0 }],
1368
- },
1369
- // A one-argument call is setPriority(0, priority)
1370
- // (lowerOsSetPriorityCall completes it).
1371
- setPriority: { fn: "os.setPriority", params: [F64, F64], result: VOID },
1372
- // Special-cased (lowerOsCpusCall): the call site's CpuInfo[] assembles
1373
- // from one uv_cpu_info snapshot.
1374
- cpus: { fn: "os.cpusTake", params: [], result: VOID },
1375
- // Entirely special-cased (lowerOsNetworkInterfacesCall): the result is
1376
- // the call site's mapped Dict<NetworkInterfaceInfo[]> shape, verified
1377
- // structurally there — this entry only routes the dispatch.
1378
- networkInterfaces: { fn: "os.networkInterfaces", params: [], result: VOID },
1379
- // Special-cased too (lowerOsUserInfoCall): the call site's mapped
1380
- // UserInfo record assembles field-by-field from scalar libCalls.
1381
- userInfo: { fn: "os.userName", params: [], result: VOID },
1382
- },
1383
- crypto: {
1384
- randomUUID: {
1385
- fn: "crypto.randomUUID",
1386
- params: [],
1387
- result: STRING,
1388
- // As a value (uuid's `export default { randomUUID }`), the optional
1389
- // options argument goes through the validating entry point.
1390
- valueFn: "crypto.randomUUIDOpts",
1391
- valueParams: [{ mode: "optional", type: DYN, defaultValue: undefined }],
1392
- },
1393
- // A real Buffer result. The composed randomBytes(n).toString(enc)
1394
- // form KEEPS its one-libCall lowering (lowerCryptoComposedCall runs
1395
- // first and the Buffer never materializes there); this entry covers
1396
- // the bare calls and non-composed uses.
1397
- randomBytes: {
1398
- fn: "crypto.randomBytes",
1399
- params: [F64],
1400
- result: BYTES_U8,
1401
- valueParams: exactValueParams(F64),
1402
- },
1403
- // The crypto utility surface is special-cased for overloads and
1404
- // string/Buffer splits in lowerCryptoModuleCall. These rows carry the
1405
- // canonical signatures for manifest projection and fallback dispatch.
1406
- createHash: { fn: "crypto.hashNew", params: [STRING], result: CRYPTOHASH_T },
1407
- createHmac: { fn: "crypto.hmacNewStr", params: [STRING, STRING], result: CRYPTOHMAC_T },
1408
- hash: { fn: "crypto.hashDigestStr", params: [STRING, STRING, STRING], result: STRING },
1409
- timingSafeEqual: { fn: "crypto.timingSafeEqual", params: [BYTES_U8, BYTES_U8], result: BOOL },
1410
- randomFillSync: { fn: "crypto.randomFill", params: [BYTES_U8, F64, F64], result: BYTES_U8 },
1411
- getRandomValues: { fn: "crypto.getRandomValues", params: [BYTES_U8], result: BYTES_U8 },
1412
- randomInt: { fn: "crypto.randomInt", params: [F64, F64], result: F64 },
1413
- randomFill: { fn: "crypto.randomFillCb", params: [], result: VOID },
1414
- randomUUIDv7: {
1415
- fn: "crypto.randomUUIDv7",
1416
- params: [DYN],
1417
- result: STRING,
1418
- valueParams: [{ mode: "optional", type: DYN, defaultValue: undefined }],
1419
- },
1420
- createSecretKey: { fn: "crypto.createSecretKey", params: [DYN, DYN], result: DYN },
1421
- generateKeySync: { fn: "crypto.generateKeySync", params: [DYN, DYN], result: DYN },
1422
- generateKey: { fn: "crypto.generateKeyCb", params: [], result: VOID },
1423
- // Asymmetric keys and signatures (lowerPkiCall): checked-dynamic
1424
- // arguments, results converted to the call site's type.
1425
- createPrivateKey: { fn: "crypto.createPrivateKey", params: [DYN], result: DYN },
1426
- createPublicKey: { fn: "crypto.createPublicKey", params: [DYN], result: DYN },
1427
- createSign: { fn: "crypto.createSign", params: [DYN], result: DYN },
1428
- createVerify: { fn: "crypto.createVerify", params: [DYN], result: DYN },
1429
- generateKeyPairSync: { fn: "crypto.generateKeyPairSync", params: [], result: DYN },
1430
- generateKeyPair: { fn: "crypto.generateKeyPairCb", params: [], result: VOID },
1431
- sign: { fn: "crypto.signOneshot", params: [], result: DYN },
1432
- verify: { fn: "crypto.verifyOneshot", params: [], result: DYN },
1433
- diffieHellman: { fn: "crypto.diffieHellman", params: [], result: DYN },
1434
- pbkdf2Sync: {
1435
- fn: "crypto.pbkdf2",
1436
- params: [BYTES_U8, BYTES_U8, F64, F64, STRING],
1437
- result: BYTES_U8,
1438
- },
1439
- pbkdf2: { fn: "crypto.pbkdf2Cb", params: [], result: VOID },
1440
- hkdfSync: {
1441
- fn: "crypto.hkdf",
1442
- params: [STRING, BYTES_U8, BYTES_U8, BYTES_U8, F64],
1443
- result: DYN,
1444
- },
1445
- hkdf: { fn: "crypto.hkdfCb", params: [], result: VOID },
1446
- scryptSync: { fn: "crypto.scrypt", params: [BYTES_U8, BYTES_U8, F64, DYN], result: BYTES_U8 },
1447
- scrypt: { fn: "crypto.scryptCb", params: [], result: VOID },
1448
- // Checked-dynamic arguments; the result is a native Cipheriv or
1449
- // Decipheriv handle (lowerCryptoModuleCall).
1450
- createCipheriv: { fn: "crypto.cipherNew", params: [BOOL, DYN, DYN, DYN, DYN], result: DYN },
1451
- createDecipheriv: { fn: "crypto.cipherNew", params: [BOOL, DYN, DYN, DYN, DYN], result: DYN },
1452
- // A checked-dynamic curve name; the result is a native ECDH handle
1453
- // (lowerCreateEcdh).
1454
- createECDH: { fn: "crypto.ecdhNew", params: [DYN], result: DYN },
1455
- // Checked-dynamic arguments; the result is a native DiffieHellman or
1456
- // DiffieHellmanGroup handle (lowerCreateDiffieHellman and
1457
- // lowerGetDiffieHellman).
1458
- createDiffieHellman: { fn: "crypto.dhNew", params: [DYN, DYN, DYN, DYN], result: DYN },
1459
- getDiffieHellman: { fn: "crypto.dhGroupNew", params: [DYN], result: DYN },
1460
- createDiffieHellmanGroup: { fn: "crypto.dhGroupNew", params: [DYN], result: DYN },
1461
- // Prime checks and generation (lowerPrimeCall): checked-dynamic
1462
- // arguments, results converted to the call site's type.
1463
- checkPrimeSync: { fn: "crypto.checkPrimeSync", params: [], result: DYN },
1464
- // Checked-dynamic arguments, the result converted to the call site's
1465
- // type (lowerPrimeCall).
1466
- getCipherInfo: { fn: "crypto.getCipherInfo", params: [], result: DYN },
1467
- checkPrime: { fn: "crypto.checkPrimeCb", params: [], result: VOID },
1468
- generatePrimeSync: { fn: "crypto.generatePrimeSync", params: [], result: DYN },
1469
- generatePrime: { fn: "crypto.generatePrimeCb", params: [], result: VOID },
1470
- },
1471
- zlib: {
1472
- // The default-options convenience family is special-cased in
1473
- // lowerBuiltinModuleCall: string inputs UTF-8 encode, callback forms
1474
- // carry program-shaped closures, and explicit options fence per site.
1475
- // native-toolchain.ts links libz only when these appear on the IR.
1476
- deflate: { fn: "zlib.deflateCb", params: [], result: VOID },
1477
- deflateSync: { fn: "zlib.deflateSync", params: [BYTES_U8], result: BYTES_U8 },
1478
- inflate: { fn: "zlib.inflateCb", params: [], result: VOID },
1479
- inflateSync: { fn: "zlib.inflateSync", params: [BYTES_U8], result: BYTES_U8 },
1480
- deflateRaw: { fn: "zlib.deflateRawCb", params: [], result: VOID },
1481
- deflateRawSync: { fn: "zlib.deflateRawSync", params: [BYTES_U8], result: BYTES_U8 },
1482
- inflateRaw: { fn: "zlib.inflateRawCb", params: [], result: VOID },
1483
- inflateRawSync: { fn: "zlib.inflateRawSync", params: [BYTES_U8], result: BYTES_U8 },
1484
- gzip: { fn: "zlib.gzipCb", params: [], result: VOID },
1485
- gzipSync: { fn: "zlib.gzipSync", params: [BYTES_U8], result: BYTES_U8 },
1486
- gunzip: { fn: "zlib.gunzipCb", params: [], result: VOID },
1487
- gunzipSync: { fn: "zlib.gunzipSync", params: [BYTES_U8], result: BYTES_U8 },
1488
- unzip: { fn: "zlib.unzipCb", params: [], result: VOID },
1489
- unzipSync: { fn: "zlib.unzipSync", params: [BYTES_U8], result: BYTES_U8 },
1490
- crc32: { fn: "zlib.crc32", params: [], result: F64 },
1491
- // The stream factories (special-cased in lowerZlibModuleCall): each
1492
- // answers a runtime Transform stream over the zlib engine.
1493
- createDeflate: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1494
- createInflate: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1495
- createGzip: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1496
- createGunzip: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1497
- createDeflateRaw: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1498
- createInflateRaw: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1499
- createUnzip: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1500
- },
1501
- url: {
1502
- fileURLToPath: {
1503
- fn: "url.fileURLToPathOptions",
1504
- params: [DYN, DYN],
1505
- result: STRING,
1506
- valueParams: [
1507
- { mode: "required", type: DYN },
1508
- { mode: "optional", type: DYN, defaultValue: undefined },
1509
- ],
1510
- },
1511
- fileURLToPathBuffer: {
1512
- fn: "url.fileURLToPathBuffer",
1513
- params: [DYN, DYN],
1514
- result: BYTES_U8,
1515
- valueParams: [
1516
- { mode: "required", type: DYN },
1517
- { mode: "optional", type: DYN, defaultValue: undefined },
1518
- ],
1519
- },
1520
- pathToFileURL: {
1521
- fn: "url.pathToFileURLChecked",
1522
- params: [DYN, DYN],
1523
- result: URL_T,
1524
- valueParams: [
1525
- { mode: "required", type: DYN },
1526
- { mode: "optional", type: DYN, defaultValue: undefined },
1527
- ],
1528
- },
1529
- // The legacy API and the domain pair (lowerLegacyUrlCall): arguments
1530
- // cross as dyn values for Node's own validators; url.parse() answers
1531
- // the checked-dynamic Url instance.
1532
- parse: { fn: "url.legacyParse", params: [DYN, DYN, DYN], result: DYN },
1533
- format: { fn: "url.legacyFormat", params: [DYN, DYN], result: STRING },
1534
- resolve: { fn: "url.legacyResolve", params: [DYN, DYN], result: STRING },
1535
- domainToASCII: { fn: "url.domainToASCII", params: [DYN], result: STRING },
1536
- domainToUnicode: { fn: "url.domainToUnicode", params: [DYN], result: STRING },
1537
- },
1538
- child_process: {
1539
- // spawnSync's and spawn's call completions are entirely special-cased
1540
- // (an omitted args list completes to an empty string[]; spawnSync
1541
- // accepts its documented literal options, while spawn supports the
1542
- // stdio/detached/env/cwd/windowsHide/shell subset — see
1543
- // lowerBuiltinModuleCall); the
1544
- // entries carry the canonical shapes.
1545
- spawnSync: { fn: "cp.spawnSync", params: [STRING, arrayOf(STRING)], result: SPAWNRES_T },
1546
- spawn: { fn: "cp.spawn", params: [STRING, arrayOf(STRING)], result: CHILD_T },
1547
- fork: { fn: "cp.fork", params: [STRING, arrayOf(STRING)], result: CHILD_T },
1548
- // execFileSync(file, args?, options?) and execSync(command, options?)
1549
- // share the cp.execSync runtime entry (execSync sets the shell flag);
1550
- // both call completions are special-cased in lowerBuiltinModuleCall.
1551
- // The entries carry canonical shapes for the coverage/fence machinery.
1552
- execFileSync: { fn: "cp.execSync", params: [STRING, arrayOf(STRING)], result: STRING },
1553
- execSync: { fn: "cp.execSync", params: [STRING], result: STRING },
1554
- },
1555
- // node:util lowers through dedicated paths: promisify
1556
- // only in the const-binding-over-execFile shape — recognized in
1557
- // lowerVarDecl / collectGlobals BEFORE any call lowering runs — and
1558
- // inspect/format/formatWithOptions plus parseArgs through the util spoke
1559
- // (lower-inspect.ts: per-type synthesized traversal helpers,
1560
- // compile-time format strings, checked-dynamic config/result for
1561
- // parseArgs), which both dispatch paths try before the generic table.
1562
- // parseArgs is tabled as well so the generated surface manifest records
1563
- // the dedicated static member; the spoke owns its optional arity and
1564
- // call-site-specific result type before this canonical signature is used.
1565
- util: {
1566
- styleText: {
1567
- fn: "util.styleText",
1568
- params: [DYN, DYN, DYN],
1569
- result: STRING,
1570
- valueParams: [
1571
- { mode: "required", type: DYN },
1572
- { mode: "required", type: DYN },
1573
- { mode: "optional", type: DYN, defaultValue: undefined },
1574
- ],
1575
- },
1576
- isDeepStrictEqual: {
1577
- fn: "util.isDeepStrictEqual",
1578
- params: [DYN, DYN, DYN],
1579
- result: BOOL,
1580
- valueParams: [
1581
- { mode: "required", type: DYN },
1582
- { mode: "required", type: DYN },
1583
- { mode: "optional", type: DYN, defaultValue: undefined },
1584
- ],
1585
- },
1586
- parseArgs: { fn: "util.parseArgs", params: [DYN], result: DYN },
1587
- parseEnv: { fn: "util.parseEnv", params: [DYN], result: DYN },
1588
- getSystemErrorName: {
1589
- fn: "util.getSystemErrorName",
1590
- params: [DYN],
1591
- result: STRING,
1592
- valueParams: exactValueParams(DYN),
1593
- },
1594
- getSystemErrorMessage: {
1595
- fn: "util.getSystemErrorMessage",
1596
- params: [DYN],
1597
- result: STRING,
1598
- valueParams: exactValueParams(DYN),
1599
- },
1600
- getSystemErrorMap: { fn: "util.systemErrorEntries", params: [], result: DYN },
1601
- stripVTControlCharacters: {
1602
- fn: "util.stripVTControlCharacters",
1603
- params: [DYN],
1604
- result: STRING,
1605
- valueParams: exactValueParams(DYN),
1606
- },
1607
- toUSVString: {
1608
- fn: "util.toUSVString",
1609
- params: [DYN],
1610
- result: STRING,
1611
- valueParams: exactValueParams(DYN),
1612
- },
1613
- // The function helpers take checked-dynamic arguments and answer native
1614
- // dyn functions, which a static function slot checks when it receives
1615
- // one (lowerUtilCallableCall in the util spoke).
1616
- inherits: {
1617
- fn: "util.inherits",
1618
- params: [DYN, DYN],
1619
- result: VOID,
1620
- valueParams: [
1621
- { mode: "required", type: DYN },
1622
- { mode: "required", type: DYN },
1623
- ],
1624
- },
1625
- deprecate: {
1626
- fn: "util.deprecate",
1627
- params: [DYN, DYN, DYN, DYN],
1628
- result: DYN,
1629
- valueParams: [
1630
- { mode: "required", type: DYN },
1631
- { mode: "required", type: DYN },
1632
- { mode: "optional", type: DYN, defaultValue: undefined },
1633
- { mode: "optional", type: DYN, defaultValue: undefined },
1634
- ],
1635
- },
1636
- callbackify: {
1637
- fn: "util.callbackify",
1638
- params: [DYN],
1639
- result: DYN,
1640
- valueParams: [{ mode: "required", type: DYN }],
1641
- },
1642
- debuglog: {
1643
- fn: "util.debuglog",
1644
- params: [DYN, DYN],
1645
- result: DYN,
1646
- valueParams: [
1647
- { mode: "required", type: DYN },
1648
- { mode: "optional", type: DYN, defaultValue: undefined },
1649
- ],
1650
- },
1651
- debug: {
1652
- fn: "util.debuglog",
1653
- params: [DYN, DYN],
1654
- result: DYN,
1655
- valueParams: [
1656
- { mode: "required", type: DYN },
1657
- { mode: "optional", type: DYN, defaultValue: undefined },
1658
- ],
1659
- },
1660
- },
1661
- // The util/types spoke supplies the probe name to the shared brand check.
1662
- "util/types": {
1663
- isAnyArrayBuffer: { fn: "util.typeIs", params: [DYN], result: BOOL },
1664
- isArrayBuffer: { fn: "util.typeIs", params: [DYN], result: BOOL },
1665
- isArrayBufferView: { fn: "util.typeIs", params: [DYN], result: BOOL },
1666
- isDataView: { fn: "util.typeIs", params: [DYN], result: BOOL },
1667
- isTypedArray: { fn: "util.typeIs", params: [DYN], result: BOOL },
1668
- isUint8Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1669
- isUint8ClampedArray: { fn: "util.typeIs", params: [DYN], result: BOOL },
1670
- isUint16Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1671
- isUint32Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1672
- isInt8Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1673
- isInt16Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1674
- isInt32Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1675
- isFloat32Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1676
- isFloat64Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1677
- isMap: { fn: "util.typeIs", params: [DYN], result: BOOL },
1678
- isSet: { fn: "util.typeIs", params: [DYN], result: BOOL },
1679
- isWeakMap: { fn: "util.typeIs", params: [DYN], result: BOOL },
1680
- isWeakSet: { fn: "util.typeIs", params: [DYN], result: BOOL },
1681
- isRegExp: { fn: "util.typeIs", params: [DYN], result: BOOL },
1682
- isNativeError: { fn: "util.typeIs", params: [DYN], result: BOOL },
1683
- isPromise: { fn: "util.typeIs", params: [DYN], result: BOOL },
1684
- isProxy: { fn: "util.typeIs", params: [DYN], result: BOOL },
1685
- isAsyncFunction: { fn: "util.typeIs", params: [DYN], result: BOOL },
1686
- isGeneratorFunction: { fn: "util.typeIs", params: [DYN], result: BOOL },
1687
- isGeneratorObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1688
- isDate: { fn: "util.typeIs", params: [DYN], result: BOOL },
1689
- isSharedArrayBuffer: { fn: "util.typeIs", params: [DYN], result: BOOL },
1690
- isMapIterator: { fn: "util.typeIs", params: [DYN], result: BOOL },
1691
- isSetIterator: { fn: "util.typeIs", params: [DYN], result: BOOL },
1692
- isKeyObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1693
- isNumberObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1694
- isStringObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1695
- isBooleanObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1696
- isBigIntObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1697
- isSymbolObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1698
- isBoxedPrimitive: { fn: "util.typeIs", params: [DYN], result: BOOL },
1699
- isBigInt64Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1700
- isBigUint64Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1701
- isFloat16Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1702
- isCryptoKey: { fn: "util.typeIs", params: [DYN], result: BOOL },
1703
- isExternal: { fn: "util.typeIs", params: [DYN], result: BOOL },
1704
- },
1705
- buffer: {
1706
- isAscii: { fn: "buffer.isAscii", params: [DYN], result: BOOL },
1707
- isUtf8: { fn: "buffer.isUtf8", params: [DYN], result: BOOL },
1708
- transcode: { fn: "buffer.transcode", params: [DYN, DYN, DYN], result: BYTES_U8 },
1709
- },
1710
- tty: {
1711
- isatty: { fn: "process.isTTY", params: [F64], result: BOOL },
1712
- },
1713
- process: {
1714
- loadEnvFile: { fn: "process.loadEnvFile", params: [DYN], result: VOID },
1715
- },
1716
- // node:string_decoder's surface is the StringDecoder CLASS — new/write/
1717
- // end are special-cased (lowerNew + lowerStringDecoderMethodCall); no
1718
- // function members exist to table.
1719
- string_decoder: {},
1720
- // node:querystring — the legacy query-string codec (NOT URLSearchParams;
1721
- // the escaping and '+' rules differ). escape/unescape ride the table
1722
- // path directly; parse and stringify are special-cased in
1723
- // lowerBuiltinModuleCall (parse's result is the call site's mapped
1724
- // ParsedUrlQuery dictionary — the networkInterfaces verification stance
1725
- // — and its sep/eq/options complete there; stringify's object argument
1726
- // crosses as a dyn value). decode/encode are Node's own aliases of
1727
- // parse/stringify (`const decode = parse` in lib/querystring.js) and
1728
- // route to the same special cases; the entries carry canonical shapes.
1729
- querystring: {
1730
- parse: { fn: "qs.parse", params: [STRING], result: VOID },
1731
- decode: { fn: "qs.parse", params: [STRING], result: VOID },
1732
- stringify: { fn: "qs.stringify", params: [DYN], result: STRING },
1733
- encode: { fn: "qs.stringify", params: [DYN], result: STRING },
1734
- escape: {
1735
- fn: "qs.escape",
1736
- params: [STRING],
1737
- result: STRING,
1738
- valueParams: [{ mode: "required", type: STRING }],
1739
- },
1740
- unescape: {
1741
- fn: "qs.unescape",
1742
- params: [STRING],
1743
- result: STRING,
1744
- valueParams: [{ mode: "required", type: STRING }],
1745
- },
1746
- },
1747
- // node:punycode (deprecated): punycode.js 2.1.0's conversions over
1748
- // strings (scr_url.c). ucs2.decode/encode are members of the module's
1749
- // ucs2 object, dispatched as module members (builtinMemberOf). The
1750
- // DEP0040 report rides the module's load sites (punycodeLoadWarning).
1751
- punycode: {
1752
- decode: { fn: "punycode.decode", params: [STRING], result: STRING },
1753
- encode: { fn: "punycode.encode", params: [STRING], result: STRING },
1754
- toASCII: { fn: "punycode.toASCII", params: [STRING], result: STRING },
1755
- toUnicode: { fn: "punycode.toUnicode", params: [STRING], result: STRING },
1756
- "ucs2.decode": { fn: "punycode.ucs2Decode", params: [STRING], result: arrayOf(F64) },
1757
- "ucs2.encode": { fn: "punycode.ucs2Encode", params: [arrayOf(F64)], result: STRING },
1758
- },
1759
- // node:constants (deprecated) is one frozen object (Object.assign of
1760
- // os.constants' groups, fs.constants and crypto.constants): bindings of
1761
- // the module read it as a checked-dynamic value (builtinConstantsObject).
1762
- constants: {},
1763
- // node:readline: createInterface's options are entirely special-cased
1764
- // (exactly { input: process.stdin, output?: process.stdout } — see
1765
- // lowerBuiltinModuleCall); the entry carries the canonical shape. The
1766
- // interface's question/close/on lower through
1767
- // lowerReadlineMethodCall.
1768
- readline: {
1769
- createInterface: { fn: "rl.create", params: [], result: F64 },
1770
- },
1771
- // node:readline/promises: the same Interface with the promise question
1772
- // (lowerReadlineMethodCall tells the forms apart by the call's result).
1773
- "readline/promises": {
1774
- createInterface: { fn: "rl.create", params: [], result: F64 },
1775
- },
1776
- // node:net and node:http lower ENTIRELY through the server spoke
1777
- // (lower-server.ts — every call shape is special-cased: closures, the
1778
- // optional connect host, writeHead's literal headers); the member list
1779
- // is the lower-server dispatch there. The modules still need keys here so future
1780
- // table entries have a home, and so the "recognized module, unlowered
1781
- // member" fence wording applies.
1782
- net: {
1783
- // The process-wide happy-eyeballs attempt budget: one runtime double
1784
- // in the core unit (never links scr_net.c by itself), default 250ms
1785
- // like Node's.
1786
- getDefaultAutoSelectFamilyAttemptTimeout: {
1787
- fn: "net.getAutoSelTimeout",
1788
- params: [],
1789
- result: F64,
1790
- },
1791
- setDefaultAutoSelectFamilyAttemptTimeout: {
1792
- fn: "net.setAutoSelTimeout",
1793
- params: [F64],
1794
- result: VOID,
1795
- },
1796
- // Node's IPv4Reg / IPv6Reg tests over String(input).
1797
- isIP: { fn: "net.isIP", params: [DYN], result: F64 },
1798
- isIPv4: { fn: "net.isIPv4", params: [DYN], result: BOOL },
1799
- isIPv6: { fn: "net.isIPv6", params: [DYN], result: BOOL },
1800
- },
1801
- http: {},
1802
- // node:tls and node:https ride the same spoke (tls.createServer's
1803
- // options + secureConnection handler, https.createServer, and the
1804
- // https client's rejectUnauthorized/ca options are all special-cased
1805
- // in lower-server.ts).
1806
- tls: {},
1807
- https: {},
1808
- // node:dgram and node:dns lower ENTIRELY through the dgram spoke
1809
- // (lower-dgram.ts — createSocket's option literal, dns.lookup's
1810
- // options + callback, and the Socket method surface are all
1811
- // special-cased); the keys exist for the same reason net/http's do.
1812
- dgram: {},
1813
- dns: {},
1814
- // node:dns/promises rides the same spoke (lookup's promise form).
1815
- "dns/promises": {},
1816
- // node:v8: getHeapStatistics answers allocator-derived figures in
1817
- // Node's shape (builtins/v8.ts — the entry carries the canonical
1818
- // shape); every other member fences with the by-design reason
1819
- // (builtinFenceHintOf).
1820
- v8: {
1821
- getHeapStatistics: { fn: "process.memoryUsageTake", params: [], result: VOID },
1822
- },
1823
- // node:stream/web re-exports the web stream globals (the same objects);
1824
- // its members lower through the globals' own paths.
1825
- "stream/web": {},
1826
- // node:assert lowers ENTIRELY through the assert spoke (lower-assert.ts
1827
- // — every call shape is special-cased: optional messages complete, the
1828
- // comparisons pick per-type libCalls, deep equality synthesizes
1829
- // helpers); the keys exist so unlowered members fence module-qualified
1830
- // with the hints below.
1831
- assert: {},
1832
- "assert/strict": {},
1833
- // node:test lowers ENTIRELY through the test spoke (lower-test.ts —
1834
- // registrations, suites, hooks, the TestContext surface); the key
1835
- // exists so unlowered members fence module-qualified.
1836
- test: {},
1837
- // node:stream/promises lowers through the stream spoke too
1838
- // (lower-stream.ts — finished/pipeline's promise forms special-case
1839
- // their stream arguments exactly like the callback forms); the key
1840
- // exists so unlowered members fence module-qualified.
1841
- "stream/promises": {},
1842
- // node:stream/consumers rides the stream spoke as well (text/json/
1843
- // buffer/arrayBuffer special-case their stream argument); blob fences
1844
- // module-qualified with the pointed hint below.
1845
- "stream/consumers": {},
1846
- // node:timers/promises — the delay-only setTimeout and bare setImmediate
1847
- // (void promises the shared timer heap settles), and scheduler.wait /
1848
- // scheduler.yield, which Node defines as setTimeout(delay, undefined,
1849
- // options) and setImmediate(). The arity completion (omitted delay =
1850
- // Node's 1ms) and the value/options fences are special-cased in
1851
- // lowerBuiltinModuleCall; these entries carry the canonical shapes and
1852
- // route the dispatch.
1853
- "timers/promises": {
1854
- setTimeout: { fn: "tp.setTimeout", params: [F64], result: { kind: "promise", inner: VOID } },
1855
- setImmediate: { fn: "tp.setImmediate", params: [], result: { kind: "promise", inner: VOID } },
1856
- "scheduler.wait": {
1857
- fn: "tp.setTimeout",
1858
- params: [F64],
1859
- result: { kind: "promise", inner: VOID },
1860
- },
1861
- "scheduler.yield": {
1862
- fn: "tp.setImmediate",
1863
- params: [],
1864
- result: { kind: "promise", inner: VOID },
985
+ let builtinModuleFnTable;
986
+ /** Every builtin module's lowered function members, keyed by module and
987
+ * member. The table is built on the first call, so runs that do not lower
988
+ * a module do not construct it. */
989
+ export function builtinModuleFns() {
990
+ builtinModuleFnTable ??= buildBuiltinModuleFns();
991
+ return builtinModuleFnTable;
992
+ }
993
+ function buildBuiltinModuleFns() {
994
+ return {
995
+ fs: {
996
+ readFileSync: { fn: "fs.readFileSync", params: [STRING, STRING], result: STRING },
997
+ // The exact-API subset is first-class. A fixed native ABI is not enough:
998
+ // rows whose Node function has behavior-bearing trailing options remain
999
+ // call-only, or function-width adaptation could discard those options
1000
+ // without a diagnostic before entering the fixed runtime call.
1001
+ writeFileSync: { fn: "fs.writeFileSync", params: [STRING, STRING], result: VOID },
1002
+ appendFileSync: { fn: "fs.appendFileSync", params: [STRING, STRING], result: VOID },
1003
+ existsSync: {
1004
+ fn: "fs.existsSync",
1005
+ params: [STRING],
1006
+ result: BOOL,
1007
+ valueParams: exactValueParams(STRING),
1008
+ },
1009
+ mkdirSync: { fn: "fs.mkdirSync", params: [STRING], result: VOID },
1010
+ rmSync: { fn: "fs.rmSync", params: [STRING], result: VOID },
1011
+ rmdirSync: { fn: "fs.rmdirSync", params: [STRING], result: VOID },
1012
+ readdirSync: { fn: "fs.readdirSync", params: [STRING], result: arrayOf(STRING) },
1013
+ // Pattern and options are checked by the runtime (lowerFsGlobSyncCall).
1014
+ globSync: { fn: "fs.globSync", params: [DYN, DYN], result: arrayOf(STRING) },
1015
+ statSync: { fn: "fs.statSync", params: [STRING], result: STATS_T },
1016
+ mkdtempSync: { fn: "fs.mkdtempSync", params: [STRING], result: STRING },
1017
+ // accessSync's omitted mode completes to 0 (F_OK) in the special case
1018
+ // in lowerBuiltinModuleCall — string `defaults` can't spell a number.
1019
+ accessSync: { fn: "fs.accessSync", params: [STRING, F64], result: VOID },
1020
+ unlinkSync: {
1021
+ fn: "fs.unlinkSync",
1022
+ params: [STRING],
1023
+ result: VOID,
1024
+ valueParams: exactValueParams(STRING),
1025
+ },
1026
+ chmodSync: {
1027
+ fn: "fs.chmodSync",
1028
+ params: [STRING, F64],
1029
+ result: VOID,
1030
+ valueParams: exactValueParams(STRING, F64),
1031
+ },
1032
+ chownSync: {
1033
+ fn: "fs.chownSync",
1034
+ params: [STRING, F64, F64],
1035
+ result: VOID,
1036
+ valueParams: exactValueParams(STRING, F64, F64),
1037
+ },
1038
+ lchownSync: {
1039
+ fn: "fs.lchownSync",
1040
+ params: [STRING, F64, F64],
1041
+ result: VOID,
1042
+ valueParams: exactValueParams(STRING, F64, F64),
1043
+ },
1044
+ fchownSync: {
1045
+ fn: "fs.fchownSync",
1046
+ params: [F64, F64, F64],
1047
+ result: VOID,
1048
+ valueParams: exactValueParams(F64, F64, F64),
1049
+ },
1050
+ // truncateSync's omitted len completes to 0 in lowerBuiltinModuleCall,
1051
+ // like accessSync's mode.
1052
+ truncateSync: { fn: "fs.truncateSync", params: [STRING, F64], result: VOID },
1053
+ // The 2-argument form only: Node's mode flags (COPYFILE_EXCL, ...)
1054
+ // land on the arity fence.
1055
+ copyFileSync: { fn: "fs.copyFileSync", params: [STRING, STRING], result: VOID },
1056
+ // The callback form is special-cased in lowerBuiltinModuleCall: its
1057
+ // Error | null parameter is program-shaped and needs an emitted
1058
+ // adapter. The row still projects the static surface and routes the
1059
+ // dispatch.
1060
+ rename: { fn: "fs.renameCb", params: [], result: VOID },
1061
+ renameSync: {
1062
+ fn: "fs.renameSync",
1063
+ params: [STRING, STRING],
1064
+ result: VOID,
1065
+ valueParams: exactValueParams(STRING, STRING),
1066
+ },
1067
+ // statSync's no-follow sibling; stats.isSymbolicLink answers what the
1068
+ // follow-free snapshot saw.
1069
+ // opendirSync's options (a literal { bufferSize, encoding: "utf8" })
1070
+ // lower in lowerBuiltinModuleCall; the row routes the dispatch.
1071
+ opendirSync: { fn: "fs.opendirSync", params: [STRING, F64], result: DIR_T },
1072
+ // createReadStream/createWriteStream lower in lowerBuiltinModuleCall
1073
+ // (path and options cross as dyn values); the rows route the dispatch.
1074
+ createReadStream: {
1075
+ fn: "fs.createReadStream",
1076
+ params: [DYN, DYN],
1077
+ result: { kind: "object", className: "%Readable" },
1078
+ },
1079
+ createWriteStream: {
1080
+ fn: "fs.createWriteStream",
1081
+ params: [DYN, DYN],
1082
+ result: { kind: "object", className: "%Writable" },
1083
+ },
1084
+ lstatSync: { fn: "fs.lstatSync", params: [STRING], result: STATS_T },
1085
+ fstatSync: {
1086
+ fn: "fs.fstatSync",
1087
+ params: [F64],
1088
+ result: STATS_T,
1089
+ valueParams: exactValueParams(F64),
1090
+ },
1091
+ fchmodSync: {
1092
+ fn: "fs.fchmodSync",
1093
+ params: [F64, F64],
1094
+ result: VOID,
1095
+ valueParams: exactValueParams(F64, F64),
1096
+ },
1097
+ fsyncSync: {
1098
+ fn: "fs.fsyncSync",
1099
+ params: [F64],
1100
+ result: VOID,
1101
+ valueParams: exactValueParams(F64),
1102
+ },
1103
+ fdatasyncSync: {
1104
+ fn: "fs.fdatasyncSync",
1105
+ params: [F64],
1106
+ result: VOID,
1107
+ valueParams: exactValueParams(F64),
1108
+ },
1109
+ ftruncateSync: { fn: "fs.ftruncateSync", params: [F64, F64], result: VOID },
1110
+ utimesSync: { fn: "fs.utimesSync", params: [DYN, DYN, DYN], result: VOID },
1111
+ futimesSync: { fn: "fs.futimesSync", params: [DYN, DYN, DYN], result: VOID },
1112
+ lutimesSync: { fn: "fs.lutimesSync", params: [DYN, DYN, DYN], result: VOID },
1113
+ readvSync: { fn: "fs.readvSync", params: [F64, arrayOf(BYTES_U8), F64], result: F64 },
1114
+ writevSync: { fn: "fs.writevSync", params: [F64, arrayOf(BYTES_U8), F64], result: F64 },
1115
+ linkSync: {
1116
+ fn: "fs.linkSync",
1117
+ params: [DYN, DYN],
1118
+ result: VOID,
1119
+ valueParams: exactValueParams(DYN, DYN),
1120
+ },
1121
+ // Options and paths are checked by the runtime (scr_fs_cp_begin).
1122
+ cpSync: {
1123
+ fn: "fs.cpSync",
1124
+ params: [DYN, DYN, DYN],
1125
+ result: VOID,
1126
+ valueParams: [
1127
+ ...exactValueParams(DYN, DYN),
1128
+ { mode: "optional", type: DYN, defaultValue: undefined },
1129
+ ],
1130
+ },
1131
+ symlinkSync: {
1132
+ fn: "fs.symlinkSync",
1133
+ params: [DYN, DYN, DYN],
1134
+ result: VOID,
1135
+ valueParams: [
1136
+ ...exactValueParams(DYN, DYN),
1137
+ { mode: "optional", type: DYN, defaultValue: undefined },
1138
+ ],
1139
+ },
1140
+ readlinkSync: {
1141
+ fn: "fs.readlinkSync",
1142
+ params: [DYN, DYN],
1143
+ result: DYN,
1144
+ valueParams: [
1145
+ ...exactValueParams(DYN),
1146
+ { mode: "optional", type: DYN, defaultValue: undefined },
1147
+ ],
1148
+ },
1149
+ statfsSync: {
1150
+ fn: "fs.statfsSync",
1151
+ params: [DYN, DYN],
1152
+ result: DYN,
1153
+ valueParams: [
1154
+ ...exactValueParams(DYN),
1155
+ { mode: "optional", type: DYN, defaultValue: undefined },
1156
+ ],
1157
+ },
1158
+ // realpath(3) — Node's realpathSync (failures spell syscall "lstat",
1159
+ // Node's own message shape).
1160
+ realpathSync: { fn: "fs.realpathSync", params: [STRING], result: STRING },
1161
+ "realpathSync.native": { fn: "fs.realpathNativeSync", params: [STRING], result: STRING },
1162
+ // The fd pair behind spawn's fd-stdio form (the daemon-log idiom:
1163
+ // openSync(logPath, "a") → spawn stdio ["ignore", fd, fd] →
1164
+ // closeSync). String flags use the established two-argument path;
1165
+ // inline numeric O_* expressions route through openNumericSync, with
1166
+ // an optional creation mode as the third argument.
1167
+ openSync: { fn: "fs.openSync", params: [STRING, STRING], result: F64 },
1168
+ // The buffer forms (fd, buffer, offset, length[, position]). The
1169
+ // lowering completes an omitted or literal-null position to -1 (the
1170
+ // runtime's current-offset sentinel); numeric positions read without
1171
+ // advancing the fd. The options-object and bigint forms still fence.
1172
+ readSync: { fn: "fs.readSync", params: [F64, BYTES_U8, F64, F64, F64], result: F64 },
1173
+ // Entirely special-cased: the classic Buffer window and utf8 string
1174
+ // overloads lower to separate fixed-width runtime ABIs. As with
1175
+ // readSync, -1 is the current-offset sentinel.
1176
+ writeSync: { fn: "fs.writeSync", params: [F64, BYTES_U8, F64, F64, F64], result: F64 },
1177
+ closeSync: {
1178
+ fn: "fs.closeSync",
1179
+ params: [F64],
1180
+ result: VOID,
1181
+ valueParams: exactValueParams(F64),
1182
+ },
1183
+ // Entirely special-cased (lowerFsWatchCall — the callback needs an
1184
+ // adapter per listener shape); this entry only routes the dispatch.
1185
+ watch: { fn: "fs.watch", params: [], result: VOID },
1186
+ },
1187
+ "fs/promises": {
1188
+ // The sync operations behind already-settled promises: failures
1189
+ // REJECT (catchable at the await) instead of throwing. readFile is
1190
+ // utf8-fenced exactly like readFileSync (same special case below).
1191
+ readFile: {
1192
+ fn: "fsp.readFile",
1193
+ params: [STRING, STRING],
1194
+ result: { kind: "promise", inner: STRING },
1195
+ },
1196
+ writeFile: {
1197
+ fn: "fsp.writeFile",
1198
+ params: [STRING, STRING],
1199
+ result: { kind: "promise", inner: VOID },
1200
+ },
1201
+ mkdir: { fn: "fsp.mkdir", params: [STRING], result: { kind: "promise", inner: VOID } },
1202
+ readdir: {
1203
+ fn: "fsp.readdir",
1204
+ params: [STRING],
1205
+ result: { kind: "promise", inner: arrayOf(STRING) },
1206
+ },
1207
+ rm: { fn: "fsp.rm", params: [STRING], result: { kind: "promise", inner: VOID } },
1208
+ // The async iterator lowers only as a for await head (lowerFspGlobCall).
1209
+ glob: { fn: "fsp.globStrings", params: [DYN, DYN], result: arrayOf(STRING) },
1210
+ stat: { fn: "fsp.stat", params: [STRING], result: { kind: "promise", inner: STATS_T } },
1211
+ realpath: {
1212
+ fn: "fsp.realpath",
1213
+ params: [STRING],
1214
+ result: { kind: "promise", inner: STRING },
1215
+ },
1216
+ lstat: { fn: "fsp.lstat", params: [STRING], result: { kind: "promise", inner: STATS_T } },
1217
+ opendir: {
1218
+ fn: "fsp.opendir",
1219
+ params: [STRING, F64],
1220
+ result: { kind: "promise", inner: DIR_T },
1221
+ },
1222
+ unlink: {
1223
+ fn: "fsp.unlink",
1224
+ params: [STRING],
1225
+ result: { kind: "promise", inner: VOID },
1226
+ valueParams: exactValueParams(STRING),
1227
+ },
1228
+ chmod: {
1229
+ fn: "fsp.chmod",
1230
+ params: [STRING, F64],
1231
+ result: { kind: "promise", inner: VOID },
1232
+ valueParams: exactValueParams(STRING, F64),
1233
+ },
1234
+ chown: {
1235
+ fn: "fsp.chown",
1236
+ params: [STRING, F64, F64],
1237
+ result: { kind: "promise", inner: VOID },
1238
+ valueParams: exactValueParams(STRING, F64, F64),
1239
+ },
1240
+ lchown: {
1241
+ fn: "fsp.lchown",
1242
+ params: [STRING, F64, F64],
1243
+ result: { kind: "promise", inner: VOID },
1244
+ valueParams: exactValueParams(STRING, F64, F64),
1245
+ },
1246
+ // access' omitted mode and truncate's omitted len complete to 0 in
1247
+ // lowerBuiltinModuleCall, like their sync spellings.
1248
+ access: { fn: "fsp.access", params: [STRING, F64], result: { kind: "promise", inner: VOID } },
1249
+ truncate: {
1250
+ fn: "fsp.truncate",
1251
+ params: [STRING, F64],
1252
+ result: { kind: "promise", inner: VOID },
1253
+ },
1254
+ // String data; Uint8Array/Buffer data routes to fsp.appendFileBytes in
1255
+ // lowerBuiltinModuleCall.
1256
+ appendFile: {
1257
+ fn: "fsp.appendFile",
1258
+ params: [STRING, STRING],
1259
+ result: { kind: "promise", inner: VOID },
1260
+ },
1261
+ // The 2-argument form only, like copyFileSync.
1262
+ copyFile: {
1263
+ fn: "fsp.copyFile",
1264
+ params: [STRING, STRING],
1265
+ result: { kind: "promise", inner: VOID },
1266
+ },
1267
+ mkdtemp: { fn: "fsp.mkdtemp", params: [STRING], result: { kind: "promise", inner: STRING } },
1268
+ rmdir: { fn: "fsp.rmdir", params: [STRING], result: { kind: "promise", inner: VOID } },
1269
+ link: {
1270
+ fn: "fsp.link",
1271
+ params: [DYN, DYN],
1272
+ result: { kind: "promise", inner: VOID },
1273
+ valueParams: exactValueParams(DYN, DYN),
1274
+ },
1275
+ cp: {
1276
+ fn: "fsp.cp",
1277
+ params: [DYN, DYN, DYN],
1278
+ result: { kind: "promise", inner: VOID },
1279
+ valueParams: [
1280
+ ...exactValueParams(DYN, DYN),
1281
+ { mode: "optional", type: DYN, defaultValue: undefined },
1282
+ ],
1283
+ },
1284
+ symlink: {
1285
+ fn: "fsp.symlink",
1286
+ params: [DYN, DYN, DYN],
1287
+ result: { kind: "promise", inner: VOID },
1288
+ valueParams: [
1289
+ ...exactValueParams(DYN, DYN),
1290
+ { mode: "optional", type: DYN, defaultValue: undefined },
1291
+ ],
1292
+ },
1293
+ readlink: {
1294
+ fn: "fsp.readlink",
1295
+ params: [DYN, DYN],
1296
+ result: { kind: "promise", inner: DYN },
1297
+ valueParams: [
1298
+ ...exactValueParams(DYN),
1299
+ { mode: "optional", type: DYN, defaultValue: undefined },
1300
+ ],
1301
+ },
1302
+ statfs: {
1303
+ fn: "fsp.statfs",
1304
+ params: [DYN, DYN],
1305
+ result: { kind: "promise", inner: DYN },
1306
+ valueParams: [
1307
+ ...exactValueParams(DYN),
1308
+ { mode: "optional", type: DYN, defaultValue: undefined },
1309
+ ],
1310
+ },
1311
+ utimes: {
1312
+ fn: "fsp.utimes",
1313
+ params: [DYN, DYN, DYN],
1314
+ result: { kind: "promise", inner: VOID },
1315
+ },
1316
+ lutimes: {
1317
+ fn: "fsp.lutimes",
1318
+ params: [DYN, DYN, DYN],
1319
+ result: { kind: "promise", inner: VOID },
1320
+ },
1321
+ rename: {
1322
+ fn: "fsp.rename",
1323
+ params: [STRING, STRING],
1324
+ result: { kind: "promise", inner: VOID },
1325
+ valueParams: exactValueParams(STRING, STRING),
1326
+ },
1327
+ // open's optional flags/mode completion is special-cased in
1328
+ // lowerBuiltinModuleCall; this row routes all import spellings and
1329
+ // gives coverage the static member.
1330
+ open: {
1331
+ fn: "fsp.open",
1332
+ params: [STRING, STRING, F64],
1333
+ result: { kind: "promise", inner: FILEHANDLE_T },
1334
+ valueParams: [
1335
+ { mode: "required", type: STRING },
1336
+ { mode: "optional", type: STRING, defaultValue: "r" },
1337
+ { mode: "optional", type: F64, defaultValue: 0o666 },
1338
+ ],
1339
+ },
1340
+ },
1341
+ // The bare module's POSIX-target binding; a win32 target rebinds it to
1342
+ // the win32 table (builtinModuleFnsOf — Node on Windows IS path.win32).
1343
+ path: PATH_MODULE_FNS,
1344
+ // Real Node modules ("node:path/posix" resolves), and the receivers of
1345
+ // `path.posix.<member>` / `path.win32.<member>` through the namespace
1346
+ // chain (builtinNamespaceModuleOf composes "path" + ".posix" to these
1347
+ // keys). Both namespaces carry the FULL surface on every platform,
1348
+ // Node's own rule: each answers its own platform's semantics anywhere.
1349
+ "path/posix": PATH_MODULE_FNS,
1350
+ "path/win32": PATH_WIN32_MODULE_FNS,
1351
+ os: {
1352
+ // One platform implementation: os.platform() === process.platform.
1353
+ platform: { fn: "process.platform", params: [], result: STRING, valueParams: [] },
1354
+ homedir: { fn: "os.homedir", params: [], result: STRING, valueParams: [] },
1355
+ tmpdir: { fn: "os.tmpdir", params: [], result: STRING, valueParams: [] },
1356
+ // uname(2)'s release field — Node's own implementation.
1357
+ release: { fn: "os.release", params: [], result: STRING, valueParams: [] },
1358
+ // uname(2)'s sysname field ("Darwin", "Linux", "Windows_NT") — the
1359
+ // libFn/runtime pair predates this entry (the portless surface used
1360
+ // them); this row makes the MODULE call reach them (test/common's
1361
+ // isAIX/isIBMi getters are the canonical callers).
1362
+ type: { fn: "os.type", params: [], result: STRING, valueParams: [] },
1363
+ // Total physical memory in bytes — same predating-pair story.
1364
+ totalmem: { fn: "os.totalmem", params: [], result: F64, valueParams: [] },
1365
+ // uv_available_parallelism: the CPUs this process may use (affinity,
1366
+ // then cgroup quota on Linux), at least 1.
1367
+ availableParallelism: {
1368
+ fn: "os.availableParallelism",
1369
+ params: [],
1370
+ result: F64,
1371
+ valueParams: [],
1372
+ },
1373
+ // os.arch() IS process.arch, like platform().
1374
+ arch: { fn: "process.arch", params: [], result: STRING, valueParams: [] },
1375
+ hostname: { fn: "os.hostname", params: [], result: STRING, valueParams: [] },
1376
+ // uv_os_uname's machine and version fields, read once at module load
1377
+ // in Node (they never change while a process runs).
1378
+ machine: { fn: "os.machine", params: [], result: STRING, valueParams: [] },
1379
+ version: { fn: "os.version", params: [], result: STRING, valueParams: [] },
1380
+ endianness: { fn: "os.endianness", params: [], result: STRING, valueParams: [] },
1381
+ freemem: { fn: "os.freemem", params: [], result: F64, valueParams: [] },
1382
+ uptime: { fn: "os.uptime", params: [], result: F64, valueParams: [] },
1383
+ loadavg: { fn: "os.loadavg", params: [], result: arrayOf(F64), valueParams: [] },
1384
+ // An omitted (or undefined) pid is 0, the current process
1385
+ // (lowerOsGetPriorityCall completes it).
1386
+ getPriority: {
1387
+ fn: "os.getPriority",
1388
+ params: [F64],
1389
+ result: F64,
1390
+ valueParams: [{ mode: "optional", type: F64, defaultValue: 0 }],
1391
+ },
1392
+ // A one-argument call is setPriority(0, priority)
1393
+ // (lowerOsSetPriorityCall completes it).
1394
+ setPriority: { fn: "os.setPriority", params: [F64, F64], result: VOID },
1395
+ // Special-cased (lowerOsCpusCall): the call site's CpuInfo[] assembles
1396
+ // from one uv_cpu_info snapshot.
1397
+ cpus: { fn: "os.cpusTake", params: [], result: VOID },
1398
+ // Entirely special-cased (lowerOsNetworkInterfacesCall): the result is
1399
+ // the call site's mapped Dict<NetworkInterfaceInfo[]> shape, verified
1400
+ // structurally there — this entry only routes the dispatch.
1401
+ networkInterfaces: { fn: "os.networkInterfaces", params: [], result: VOID },
1402
+ // Special-cased too (lowerOsUserInfoCall): the call site's mapped
1403
+ // UserInfo record assembles field-by-field from scalar libCalls.
1404
+ userInfo: { fn: "os.userName", params: [], result: VOID },
1405
+ },
1406
+ crypto: {
1407
+ randomUUID: {
1408
+ fn: "crypto.randomUUID",
1409
+ params: [],
1410
+ result: STRING,
1411
+ // As a value (uuid's `export default { randomUUID }`), the optional
1412
+ // options argument goes through the validating entry point.
1413
+ valueFn: "crypto.randomUUIDOpts",
1414
+ valueParams: [{ mode: "optional", type: DYN, defaultValue: undefined }],
1415
+ },
1416
+ // A real Buffer result. The composed randomBytes(n).toString(enc)
1417
+ // form KEEPS its one-libCall lowering (lowerCryptoComposedCall runs
1418
+ // first and the Buffer never materializes there); this entry covers
1419
+ // the bare calls and non-composed uses.
1420
+ randomBytes: {
1421
+ fn: "crypto.randomBytes",
1422
+ params: [F64],
1423
+ result: BYTES_U8,
1424
+ valueParams: exactValueParams(F64),
1425
+ },
1426
+ // The crypto utility surface is special-cased for overloads and
1427
+ // string/Buffer splits in lowerCryptoModuleCall. These rows carry the
1428
+ // canonical signatures for manifest projection and fallback dispatch.
1429
+ createHash: { fn: "crypto.hashNew", params: [STRING], result: CRYPTOHASH_T },
1430
+ createHmac: { fn: "crypto.hmacNewStr", params: [STRING, STRING], result: CRYPTOHMAC_T },
1431
+ hash: { fn: "crypto.hashDigestStr", params: [STRING, STRING, STRING], result: STRING },
1432
+ timingSafeEqual: { fn: "crypto.timingSafeEqual", params: [BYTES_U8, BYTES_U8], result: BOOL },
1433
+ randomFillSync: { fn: "crypto.randomFill", params: [BYTES_U8, F64, F64], result: BYTES_U8 },
1434
+ getRandomValues: { fn: "crypto.getRandomValues", params: [BYTES_U8], result: BYTES_U8 },
1435
+ randomInt: { fn: "crypto.randomInt", params: [F64, F64], result: F64 },
1436
+ randomFill: { fn: "crypto.randomFillCb", params: [], result: VOID },
1437
+ randomUUIDv7: {
1438
+ fn: "crypto.randomUUIDv7",
1439
+ params: [DYN],
1440
+ result: STRING,
1441
+ valueParams: [{ mode: "optional", type: DYN, defaultValue: undefined }],
1442
+ },
1443
+ createSecretKey: { fn: "crypto.createSecretKey", params: [DYN, DYN], result: DYN },
1444
+ generateKeySync: { fn: "crypto.generateKeySync", params: [DYN, DYN], result: DYN },
1445
+ generateKey: { fn: "crypto.generateKeyCb", params: [], result: VOID },
1446
+ // Asymmetric keys and signatures (lowerPkiCall): checked-dynamic
1447
+ // arguments, results converted to the call site's type.
1448
+ createPrivateKey: { fn: "crypto.createPrivateKey", params: [DYN], result: DYN },
1449
+ createPublicKey: { fn: "crypto.createPublicKey", params: [DYN], result: DYN },
1450
+ createSign: { fn: "crypto.createSign", params: [DYN], result: DYN },
1451
+ createVerify: { fn: "crypto.createVerify", params: [DYN], result: DYN },
1452
+ generateKeyPairSync: { fn: "crypto.generateKeyPairSync", params: [], result: DYN },
1453
+ generateKeyPair: { fn: "crypto.generateKeyPairCb", params: [], result: VOID },
1454
+ sign: { fn: "crypto.signOneshot", params: [], result: DYN },
1455
+ verify: { fn: "crypto.verifyOneshot", params: [], result: DYN },
1456
+ diffieHellman: { fn: "crypto.diffieHellman", params: [], result: DYN },
1457
+ pbkdf2Sync: {
1458
+ fn: "crypto.pbkdf2",
1459
+ params: [BYTES_U8, BYTES_U8, F64, F64, STRING],
1460
+ result: BYTES_U8,
1461
+ },
1462
+ pbkdf2: { fn: "crypto.pbkdf2Cb", params: [], result: VOID },
1463
+ hkdfSync: {
1464
+ fn: "crypto.hkdf",
1465
+ params: [STRING, BYTES_U8, BYTES_U8, BYTES_U8, F64],
1466
+ result: DYN,
1467
+ },
1468
+ hkdf: { fn: "crypto.hkdfCb", params: [], result: VOID },
1469
+ scryptSync: { fn: "crypto.scrypt", params: [BYTES_U8, BYTES_U8, F64, DYN], result: BYTES_U8 },
1470
+ scrypt: { fn: "crypto.scryptCb", params: [], result: VOID },
1471
+ // Checked-dynamic arguments; the result is a native Cipheriv or
1472
+ // Decipheriv handle (lowerCryptoModuleCall).
1473
+ createCipheriv: { fn: "crypto.cipherNew", params: [BOOL, DYN, DYN, DYN, DYN], result: DYN },
1474
+ createDecipheriv: { fn: "crypto.cipherNew", params: [BOOL, DYN, DYN, DYN, DYN], result: DYN },
1475
+ // A checked-dynamic curve name; the result is a native ECDH handle
1476
+ // (lowerCreateEcdh).
1477
+ createECDH: { fn: "crypto.ecdhNew", params: [DYN], result: DYN },
1478
+ // Checked-dynamic arguments; the result is a native DiffieHellman or
1479
+ // DiffieHellmanGroup handle (lowerCreateDiffieHellman and
1480
+ // lowerGetDiffieHellman).
1481
+ createDiffieHellman: { fn: "crypto.dhNew", params: [DYN, DYN, DYN, DYN], result: DYN },
1482
+ getDiffieHellman: { fn: "crypto.dhGroupNew", params: [DYN], result: DYN },
1483
+ createDiffieHellmanGroup: { fn: "crypto.dhGroupNew", params: [DYN], result: DYN },
1484
+ // Prime checks and generation (lowerPrimeCall): checked-dynamic
1485
+ // arguments, results converted to the call site's type.
1486
+ checkPrimeSync: { fn: "crypto.checkPrimeSync", params: [], result: DYN },
1487
+ // Checked-dynamic arguments, the result converted to the call site's
1488
+ // type (lowerPrimeCall).
1489
+ getCipherInfo: { fn: "crypto.getCipherInfo", params: [], result: DYN },
1490
+ checkPrime: { fn: "crypto.checkPrimeCb", params: [], result: VOID },
1491
+ generatePrimeSync: { fn: "crypto.generatePrimeSync", params: [], result: DYN },
1492
+ generatePrime: { fn: "crypto.generatePrimeCb", params: [], result: VOID },
1493
+ },
1494
+ zlib: {
1495
+ // The default-options convenience family is special-cased in
1496
+ // lowerBuiltinModuleCall: string inputs UTF-8 encode, callback forms
1497
+ // carry program-shaped closures, and explicit options fence per site.
1498
+ // native-toolchain.ts links libz only when these appear on the IR.
1499
+ deflate: { fn: "zlib.deflateCb", params: [], result: VOID },
1500
+ deflateSync: { fn: "zlib.deflateSync", params: [BYTES_U8], result: BYTES_U8 },
1501
+ inflate: { fn: "zlib.inflateCb", params: [], result: VOID },
1502
+ inflateSync: { fn: "zlib.inflateSync", params: [BYTES_U8], result: BYTES_U8 },
1503
+ deflateRaw: { fn: "zlib.deflateRawCb", params: [], result: VOID },
1504
+ deflateRawSync: { fn: "zlib.deflateRawSync", params: [BYTES_U8], result: BYTES_U8 },
1505
+ inflateRaw: { fn: "zlib.inflateRawCb", params: [], result: VOID },
1506
+ inflateRawSync: { fn: "zlib.inflateRawSync", params: [BYTES_U8], result: BYTES_U8 },
1507
+ gzip: { fn: "zlib.gzipCb", params: [], result: VOID },
1508
+ gzipSync: { fn: "zlib.gzipSync", params: [BYTES_U8], result: BYTES_U8 },
1509
+ gunzip: { fn: "zlib.gunzipCb", params: [], result: VOID },
1510
+ gunzipSync: { fn: "zlib.gunzipSync", params: [BYTES_U8], result: BYTES_U8 },
1511
+ unzip: { fn: "zlib.unzipCb", params: [], result: VOID },
1512
+ unzipSync: { fn: "zlib.unzipSync", params: [BYTES_U8], result: BYTES_U8 },
1513
+ crc32: { fn: "zlib.crc32", params: [], result: F64 },
1514
+ // Brotli (special-cased in lowerZlibModuleCall): every form takes the
1515
+ // options entries with Node's BROTLI_ENCODE or BROTLI_DECODE mode.
1516
+ brotliCompress: { fn: "zlib.cbOpts", params: [], result: VOID },
1517
+ brotliCompressSync: { fn: "zlib.syncOpts", params: [], result: BYTES_U8 },
1518
+ brotliDecompress: { fn: "zlib.cbOpts", params: [], result: VOID },
1519
+ brotliDecompressSync: { fn: "zlib.syncOpts", params: [], result: BYTES_U8 },
1520
+ // The stream factories (special-cased in lowerZlibModuleCall): each
1521
+ // answers a runtime Transform stream over the zlib engine.
1522
+ createDeflate: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1523
+ createInflate: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1524
+ createGzip: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1525
+ createGunzip: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1526
+ createDeflateRaw: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1527
+ createInflateRaw: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1528
+ createUnzip: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1529
+ createBrotliCompress: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1530
+ createBrotliDecompress: { fn: "zlib.streamNew", params: [], result: ZLIB_STREAM },
1531
+ },
1532
+ url: {
1533
+ fileURLToPath: {
1534
+ fn: "url.fileURLToPathOptions",
1535
+ params: [DYN, DYN],
1536
+ result: STRING,
1537
+ valueParams: [
1538
+ { mode: "required", type: DYN },
1539
+ { mode: "optional", type: DYN, defaultValue: undefined },
1540
+ ],
1541
+ },
1542
+ fileURLToPathBuffer: {
1543
+ fn: "url.fileURLToPathBuffer",
1544
+ params: [DYN, DYN],
1545
+ result: BYTES_U8,
1546
+ valueParams: [
1547
+ { mode: "required", type: DYN },
1548
+ { mode: "optional", type: DYN, defaultValue: undefined },
1549
+ ],
1550
+ },
1551
+ pathToFileURL: {
1552
+ fn: "url.pathToFileURLChecked",
1553
+ params: [DYN, DYN],
1554
+ result: URL_T,
1555
+ valueParams: [
1556
+ { mode: "required", type: DYN },
1557
+ { mode: "optional", type: DYN, defaultValue: undefined },
1558
+ ],
1559
+ },
1560
+ // The legacy API and the domain pair (lowerLegacyUrlCall): arguments
1561
+ // cross as dyn values for Node's own validators; url.parse() answers
1562
+ // the checked-dynamic Url instance.
1563
+ parse: { fn: "url.legacyParse", params: [DYN, DYN, DYN], result: DYN },
1564
+ format: { fn: "url.legacyFormat", params: [DYN, DYN], result: STRING },
1565
+ resolve: { fn: "url.legacyResolve", params: [DYN, DYN], result: STRING },
1566
+ domainToASCII: { fn: "url.domainToASCII", params: [DYN], result: STRING },
1567
+ domainToUnicode: { fn: "url.domainToUnicode", params: [DYN], result: STRING },
1568
+ urlToHttpOptions: { fn: "url.toHttpOptions", params: [DYN], result: DYN },
1569
+ },
1570
+ child_process: {
1571
+ // spawnSync's and spawn's call completions are entirely special-cased
1572
+ // (an omitted args list completes to an empty string[]; spawnSync
1573
+ // accepts its documented literal options, while spawn supports the
1574
+ // stdio/detached/env/cwd/windowsHide/shell subset — see
1575
+ // lowerBuiltinModuleCall); the
1576
+ // entries carry the canonical shapes.
1577
+ spawnSync: { fn: "cp.spawnSync", params: [STRING, arrayOf(STRING)], result: SPAWNRES_T },
1578
+ spawn: { fn: "cp.spawn", params: [STRING, arrayOf(STRING)], result: CHILD_T },
1579
+ fork: { fn: "cp.fork", params: [STRING, arrayOf(STRING)], result: CHILD_T },
1580
+ // execFileSync(file, args?, options?) and execSync(command, options?)
1581
+ // share the cp.execSync runtime entry (execSync sets the shell flag);
1582
+ // both call completions are special-cased in lowerBuiltinModuleCall.
1583
+ // The entries carry canonical shapes for the coverage/fence machinery.
1584
+ execFileSync: { fn: "cp.execSync", params: [STRING, arrayOf(STRING)], result: STRING },
1585
+ execSync: { fn: "cp.execSync", params: [STRING], result: STRING },
1586
+ },
1587
+ // node:util lowers through dedicated paths: promisify
1588
+ // only in the const-binding-over-execFile shape — recognized in
1589
+ // lowerVarDecl / collectGlobals BEFORE any call lowering runs — and
1590
+ // inspect/format/formatWithOptions plus parseArgs through the util spoke
1591
+ // (lower-inspect.ts: per-type synthesized traversal helpers,
1592
+ // compile-time format strings, checked-dynamic config/result for
1593
+ // parseArgs), which both dispatch paths try before the generic table.
1594
+ // parseArgs is tabled as well so the generated surface manifest records
1595
+ // the dedicated static member; the spoke owns its optional arity and
1596
+ // call-site-specific result type before this canonical signature is used.
1597
+ util: {
1598
+ styleText: {
1599
+ fn: "util.styleText",
1600
+ params: [DYN, DYN, DYN],
1601
+ result: STRING,
1602
+ valueParams: [
1603
+ { mode: "required", type: DYN },
1604
+ { mode: "required", type: DYN },
1605
+ { mode: "optional", type: DYN, defaultValue: undefined },
1606
+ ],
1607
+ },
1608
+ isDeepStrictEqual: {
1609
+ fn: "util.isDeepStrictEqual",
1610
+ params: [DYN, DYN, DYN],
1611
+ result: BOOL,
1612
+ valueParams: [
1613
+ { mode: "required", type: DYN },
1614
+ { mode: "required", type: DYN },
1615
+ { mode: "optional", type: DYN, defaultValue: undefined },
1616
+ ],
1617
+ },
1618
+ parseArgs: { fn: "util.parseArgs", params: [DYN], result: DYN },
1619
+ parseEnv: { fn: "util.parseEnv", params: [DYN], result: DYN },
1620
+ getSystemErrorName: {
1621
+ fn: "util.getSystemErrorName",
1622
+ params: [DYN],
1623
+ result: STRING,
1624
+ valueParams: exactValueParams(DYN),
1625
+ },
1626
+ getSystemErrorMessage: {
1627
+ fn: "util.getSystemErrorMessage",
1628
+ params: [DYN],
1629
+ result: STRING,
1630
+ valueParams: exactValueParams(DYN),
1631
+ },
1632
+ getSystemErrorMap: { fn: "util.systemErrorEntries", params: [], result: DYN },
1633
+ stripVTControlCharacters: {
1634
+ fn: "util.stripVTControlCharacters",
1635
+ params: [DYN],
1636
+ result: STRING,
1637
+ valueParams: exactValueParams(DYN),
1638
+ },
1639
+ toUSVString: {
1640
+ fn: "util.toUSVString",
1641
+ params: [DYN],
1642
+ result: STRING,
1643
+ valueParams: exactValueParams(DYN),
1644
+ },
1645
+ // The function helpers take checked-dynamic arguments and answer native
1646
+ // dyn functions, which a static function slot checks when it receives
1647
+ // one (lowerUtilCallableCall in the util spoke).
1648
+ inherits: {
1649
+ fn: "util.inherits",
1650
+ params: [DYN, DYN],
1651
+ result: VOID,
1652
+ valueParams: [
1653
+ { mode: "required", type: DYN },
1654
+ { mode: "required", type: DYN },
1655
+ ],
1656
+ },
1657
+ deprecate: {
1658
+ fn: "util.deprecate",
1659
+ params: [DYN, DYN, DYN, DYN],
1660
+ result: DYN,
1661
+ valueParams: [
1662
+ { mode: "required", type: DYN },
1663
+ { mode: "required", type: DYN },
1664
+ { mode: "optional", type: DYN, defaultValue: undefined },
1665
+ { mode: "optional", type: DYN, defaultValue: undefined },
1666
+ ],
1667
+ },
1668
+ callbackify: {
1669
+ fn: "util.callbackify",
1670
+ params: [DYN],
1671
+ result: DYN,
1672
+ valueParams: [{ mode: "required", type: DYN }],
1673
+ },
1674
+ debuglog: {
1675
+ fn: "util.debuglog",
1676
+ params: [DYN, DYN],
1677
+ result: DYN,
1678
+ valueParams: [
1679
+ { mode: "required", type: DYN },
1680
+ { mode: "optional", type: DYN, defaultValue: undefined },
1681
+ ],
1682
+ },
1683
+ debug: {
1684
+ fn: "util.debuglog",
1685
+ params: [DYN, DYN],
1686
+ result: DYN,
1687
+ valueParams: [
1688
+ { mode: "required", type: DYN },
1689
+ { mode: "optional", type: DYN, defaultValue: undefined },
1690
+ ],
1691
+ },
1692
+ },
1693
+ // The util/types spoke supplies the probe name to the shared brand check.
1694
+ "util/types": {
1695
+ isAnyArrayBuffer: { fn: "util.typeIs", params: [DYN], result: BOOL },
1696
+ isArrayBuffer: { fn: "util.typeIs", params: [DYN], result: BOOL },
1697
+ isArrayBufferView: { fn: "util.typeIs", params: [DYN], result: BOOL },
1698
+ isDataView: { fn: "util.typeIs", params: [DYN], result: BOOL },
1699
+ isTypedArray: { fn: "util.typeIs", params: [DYN], result: BOOL },
1700
+ isUint8Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1701
+ isUint8ClampedArray: { fn: "util.typeIs", params: [DYN], result: BOOL },
1702
+ isUint16Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1703
+ isUint32Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1704
+ isInt8Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1705
+ isInt16Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1706
+ isInt32Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1707
+ isFloat32Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1708
+ isFloat64Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1709
+ isMap: { fn: "util.typeIs", params: [DYN], result: BOOL },
1710
+ isSet: { fn: "util.typeIs", params: [DYN], result: BOOL },
1711
+ isWeakMap: { fn: "util.typeIs", params: [DYN], result: BOOL },
1712
+ isWeakSet: { fn: "util.typeIs", params: [DYN], result: BOOL },
1713
+ isRegExp: { fn: "util.typeIs", params: [DYN], result: BOOL },
1714
+ isNativeError: { fn: "util.typeIs", params: [DYN], result: BOOL },
1715
+ isPromise: { fn: "util.typeIs", params: [DYN], result: BOOL },
1716
+ isProxy: { fn: "util.typeIs", params: [DYN], result: BOOL },
1717
+ isAsyncFunction: { fn: "util.typeIs", params: [DYN], result: BOOL },
1718
+ isGeneratorFunction: { fn: "util.typeIs", params: [DYN], result: BOOL },
1719
+ isGeneratorObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1720
+ isDate: { fn: "util.typeIs", params: [DYN], result: BOOL },
1721
+ isSharedArrayBuffer: { fn: "util.typeIs", params: [DYN], result: BOOL },
1722
+ isMapIterator: { fn: "util.typeIs", params: [DYN], result: BOOL },
1723
+ isSetIterator: { fn: "util.typeIs", params: [DYN], result: BOOL },
1724
+ isKeyObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1725
+ isNumberObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1726
+ isStringObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1727
+ isBooleanObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1728
+ isBigIntObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1729
+ isSymbolObject: { fn: "util.typeIs", params: [DYN], result: BOOL },
1730
+ isBoxedPrimitive: { fn: "util.typeIs", params: [DYN], result: BOOL },
1731
+ isBigInt64Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1732
+ isBigUint64Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1733
+ isFloat16Array: { fn: "util.typeIs", params: [DYN], result: BOOL },
1734
+ isCryptoKey: { fn: "util.typeIs", params: [DYN], result: BOOL },
1735
+ isExternal: { fn: "util.typeIs", params: [DYN], result: BOOL },
1736
+ },
1737
+ buffer: {
1738
+ isAscii: { fn: "buffer.isAscii", params: [DYN], result: BOOL },
1739
+ isUtf8: { fn: "buffer.isUtf8", params: [DYN], result: BOOL },
1740
+ transcode: { fn: "buffer.transcode", params: [DYN, DYN, DYN], result: BYTES_U8 },
1741
+ },
1742
+ tty: {
1743
+ isatty: { fn: "process.isTTY", params: [F64], result: BOOL },
1744
+ },
1745
+ process: {
1746
+ loadEnvFile: { fn: "process.loadEnvFile", params: [DYN], result: VOID },
1747
+ },
1748
+ // node:string_decoder's surface is the StringDecoder CLASS — new/write/
1749
+ // end are special-cased (lowerNew + lowerStringDecoderMethodCall); no
1750
+ // function members exist to table.
1751
+ string_decoder: {},
1752
+ // node:querystring — the legacy query-string codec (NOT URLSearchParams;
1753
+ // the escaping and '+' rules differ). escape/unescape ride the table
1754
+ // path directly; parse and stringify are special-cased in
1755
+ // lowerBuiltinModuleCall (parse's result is the call site's mapped
1756
+ // ParsedUrlQuery dictionary — the networkInterfaces verification stance
1757
+ // — and its sep/eq/options complete there; stringify's object argument
1758
+ // crosses as a dyn value). decode/encode are Node's own aliases of
1759
+ // parse/stringify (`const decode = parse` in lib/querystring.js) and
1760
+ // route to the same special cases; the entries carry canonical shapes.
1761
+ querystring: {
1762
+ parse: { fn: "qs.parse", params: [STRING], result: VOID },
1763
+ decode: { fn: "qs.parse", params: [STRING], result: VOID },
1764
+ stringify: { fn: "qs.stringify", params: [DYN], result: STRING },
1765
+ encode: { fn: "qs.stringify", params: [DYN], result: STRING },
1766
+ escape: {
1767
+ fn: "qs.escape",
1768
+ params: [STRING],
1769
+ result: STRING,
1770
+ valueParams: [{ mode: "required", type: STRING }],
1771
+ },
1772
+ unescape: {
1773
+ fn: "qs.unescape",
1774
+ params: [STRING],
1775
+ result: STRING,
1776
+ valueParams: [{ mode: "required", type: STRING }],
1777
+ },
1778
+ },
1779
+ // node:punycode (deprecated): punycode.js 2.1.0's conversions over
1780
+ // strings (scr_url.c). ucs2.decode/encode are members of the module's
1781
+ // ucs2 object, dispatched as module members (builtinMemberOf). The
1782
+ // DEP0040 report rides the module's load sites (punycodeLoadWarning).
1783
+ punycode: {
1784
+ decode: { fn: "punycode.decode", params: [STRING], result: STRING },
1785
+ encode: { fn: "punycode.encode", params: [STRING], result: STRING },
1786
+ toASCII: { fn: "punycode.toASCII", params: [STRING], result: STRING },
1787
+ toUnicode: { fn: "punycode.toUnicode", params: [STRING], result: STRING },
1788
+ "ucs2.decode": { fn: "punycode.ucs2Decode", params: [STRING], result: arrayOf(F64) },
1789
+ "ucs2.encode": { fn: "punycode.ucs2Encode", params: [arrayOf(F64)], result: STRING },
1790
+ },
1791
+ // node:constants (deprecated) is one frozen object (Object.assign of
1792
+ // os.constants' groups, fs.constants and crypto.constants): bindings of
1793
+ // the module read it as a checked-dynamic value (builtinConstantsObject).
1794
+ constants: {},
1795
+ // node:readline: createInterface's options are entirely special-cased
1796
+ // (exactly { input: process.stdin, output?: process.stdout } — see
1797
+ // lowerBuiltinModuleCall); the entry carries the canonical shape. The
1798
+ // interface's question/close/on lower through
1799
+ // lowerReadlineMethodCall.
1800
+ readline: {
1801
+ createInterface: { fn: "rl.create", params: [], result: F64 },
1802
+ },
1803
+ // node:readline/promises: the same Interface with the promise question
1804
+ // (lowerReadlineMethodCall tells the forms apart by the call's result).
1805
+ "readline/promises": {
1806
+ createInterface: { fn: "rl.create", params: [], result: F64 },
1807
+ },
1808
+ // node:net and node:http lower ENTIRELY through the server spoke
1809
+ // (lower-server.ts — every call shape is special-cased: closures, the
1810
+ // optional connect host, writeHead's literal headers); the member list
1811
+ // is the lower-server dispatch there. The modules still need keys here so future
1812
+ // table entries have a home, and so the "recognized module, unlowered
1813
+ // member" fence wording applies.
1814
+ net: {
1815
+ // The process-wide happy-eyeballs attempt budget: one runtime double
1816
+ // in the core unit (never links scr_net.c by itself), default 250ms
1817
+ // like Node's.
1818
+ getDefaultAutoSelectFamilyAttemptTimeout: {
1819
+ fn: "net.getAutoSelTimeout",
1820
+ params: [],
1821
+ result: F64,
1822
+ },
1823
+ setDefaultAutoSelectFamilyAttemptTimeout: {
1824
+ fn: "net.setAutoSelTimeout",
1825
+ params: [F64],
1826
+ result: VOID,
1827
+ },
1828
+ // Node's IPv4Reg / IPv6Reg tests over String(input).
1829
+ isIP: { fn: "net.isIP", params: [DYN], result: F64 },
1830
+ isIPv4: { fn: "net.isIPv4", params: [DYN], result: BOOL },
1831
+ isIPv6: { fn: "net.isIPv6", params: [DYN], result: BOOL },
1832
+ },
1833
+ http: {},
1834
+ // node:tls and node:https ride the same spoke (tls.createServer's
1835
+ // options + secureConnection handler, https.createServer, and the
1836
+ // https client's rejectUnauthorized/ca options are all special-cased
1837
+ // in lower-server.ts).
1838
+ tls: {},
1839
+ https: {},
1840
+ // node:dgram and node:dns lower ENTIRELY through the dgram spoke
1841
+ // (lower-dgram.ts — createSocket's option literal, dns.lookup's
1842
+ // options + callback, and the Socket method surface are all
1843
+ // special-cased); the keys exist for the same reason net/http's do.
1844
+ dgram: {},
1845
+ dns: {},
1846
+ // node:dns/promises rides the same spoke (lookup's promise form).
1847
+ "dns/promises": {},
1848
+ // node:v8: getHeapStatistics answers allocator-derived figures in
1849
+ // Node's shape (builtins/v8.ts — the entry carries the canonical
1850
+ // shape); every other member fences with the by-design reason
1851
+ // (builtinFenceHintOf).
1852
+ v8: {
1853
+ getHeapStatistics: { fn: "process.memoryUsageTake", params: [], result: VOID },
1854
+ },
1855
+ // node:stream/web re-exports the web stream globals (the same objects);
1856
+ // its members lower through the globals' own paths.
1857
+ "stream/web": {},
1858
+ // node:assert lowers ENTIRELY through the assert spoke (lower-assert.ts
1859
+ // — every call shape is special-cased: optional messages complete, the
1860
+ // comparisons pick per-type libCalls, deep equality synthesizes
1861
+ // helpers); the keys exist so unlowered members fence module-qualified
1862
+ // with the hints below.
1863
+ assert: {},
1864
+ "assert/strict": {},
1865
+ // node:test lowers ENTIRELY through the test spoke (lower-test.ts —
1866
+ // registrations, suites, hooks, the TestContext surface); the key
1867
+ // exists so unlowered members fence module-qualified.
1868
+ test: {},
1869
+ // node:stream/promises lowers through the stream spoke too
1870
+ // (lower-stream.ts — finished/pipeline's promise forms special-case
1871
+ // their stream arguments exactly like the callback forms); the key
1872
+ // exists so unlowered members fence module-qualified.
1873
+ "stream/promises": {},
1874
+ // node:stream/consumers rides the stream spoke as well (text/json/
1875
+ // buffer/arrayBuffer special-case their stream argument); blob fences
1876
+ // module-qualified with the pointed hint below.
1877
+ "stream/consumers": {},
1878
+ // node:timers/promises — the delay-only setTimeout and bare setImmediate
1879
+ // (void promises the shared timer heap settles), and scheduler.wait /
1880
+ // scheduler.yield, which Node defines as setTimeout(delay, undefined,
1881
+ // options) and setImmediate(). The arity completion (omitted delay =
1882
+ // Node's 1ms) and the value/options fences are special-cased in
1883
+ // lowerBuiltinModuleCall; these entries carry the canonical shapes and
1884
+ // route the dispatch.
1885
+ "timers/promises": {
1886
+ setTimeout: { fn: "tp.setTimeout", params: [F64], result: { kind: "promise", inner: VOID } },
1887
+ setImmediate: { fn: "tp.setImmediate", params: [], result: { kind: "promise", inner: VOID } },
1888
+ "scheduler.wait": {
1889
+ fn: "tp.setTimeout",
1890
+ params: [F64],
1891
+ result: { kind: "promise", inner: VOID },
1892
+ },
1893
+ "scheduler.yield": {
1894
+ fn: "tp.setImmediate",
1895
+ params: [],
1896
+ result: { kind: "promise", inner: VOID },
1897
+ },
1898
+ },
1899
+ // node:diagnostics_channel — the pub/sub core. channel() answers an f64
1900
+ // handle (type-mapper.ts maps Channel to F64); the subscriber arguments box
1901
+ // into the checked-dynamic tree (special-cased in lowerBuiltinModuleCall — the entries
1902
+ // carry canonical shapes and route the dispatch). The Channel method
1903
+ // surface lowers through lowerDiagnosticsChannelMethodCall/lowerDiagnosticsChannelProperty.
1904
+ diagnostics_channel: {
1905
+ channel: { fn: "dc.channel", params: [STRING], result: F64 },
1906
+ subscribe: { fn: "dc.subscribe", params: [STRING, DYN], result: VOID },
1907
+ unsubscribe: { fn: "dc.unsubscribe", params: [STRING, DYN], result: BOOL },
1908
+ hasSubscribers: { fn: "dc.hasSubscribers", params: [STRING], result: BOOL },
1909
+ // The string form's canonical shape; the collection form (an object
1910
+ // literal of five Channels) is special-cased in lowerBuiltinModuleCall.
1911
+ tracingChannel: { fn: "dc.tracingChannel", params: [STRING], result: F64 },
1865
1912
  },
1866
- },
1867
- // node:diagnostics_channel — the pub/sub core. channel() answers an f64
1868
- // handle (type-mapper.ts maps Channel to F64); the subscriber arguments box
1869
- // into the checked-dynamic tree (special-cased in lowerBuiltinModuleCall — the entries
1870
- // carry canonical shapes and route the dispatch). The Channel method
1871
- // surface lowers through lowerDiagnosticsChannelMethodCall/lowerDiagnosticsChannelProperty.
1872
- diagnostics_channel: {
1873
- channel: { fn: "dc.channel", params: [STRING], result: F64 },
1874
- subscribe: { fn: "dc.subscribe", params: [STRING, DYN], result: VOID },
1875
- unsubscribe: { fn: "dc.unsubscribe", params: [STRING, DYN], result: BOOL },
1876
- hasSubscribers: { fn: "dc.hasSubscribers", params: [STRING], result: BOOL },
1877
- // The string form's canonical shape; the collection form (an object
1878
- // literal of five Channels) is special-cased in lowerBuiltinModuleCall.
1879
- tracingChannel: { fn: "dc.tracingChannel", params: [STRING], result: F64 },
1880
- },
1881
- };
1913
+ };
1914
+ }
1882
1915
  /** Builtin-module CONSTANTS (value reads of named imports): each lowers to
1883
1916
  * a literal of its value's kind. The bare-module values are the TARGET
1884
1917
  * platform's (builtinModuleConstOf swaps the win32 values in under a win32
@@ -1908,7 +1941,7 @@ export const BUILTIN_MODULE_CONSTS = {
1908
1941
  * the sidecar's determinism attestation demotes on them by prefix, so the
1909
1942
  * member's fence detector must witness them too (fencing one spelling
1910
1943
  * fences the operation, the trimLeft/trimStart rule). Keyed like
1911
- * BUILTIN_MODULE_FNS; consumed by the fence taxonomy
1944
+ * builtinModuleFns(); consumed by the fence taxonomy
1912
1945
  * (library/fence-eval.ts) and the attestation-parity test. */
1913
1946
  export const BUILTIN_MODULE_FN_ALIASES = {
1914
1947
  url: {
@@ -1961,6 +1994,8 @@ export const BUILTIN_MODULE_FN_ALIASES = {
1961
1994
  ],
1962
1995
  // The utf8 string overload; the table row is the Buffer-window form.
1963
1996
  writeSync: ["fs.writeStrSync"],
1997
+ // The form whose arguments Node checks at run time.
1998
+ readSync: ["fs.readSyncDyn"],
1964
1999
  // The { recursive, mode } option lowerings.
1965
2000
  mkdirSync: ["fs.mkdirModeSync", "fs.mkdirRecursiveSync", "fs.mkdirRecursiveModeSync"],
1966
2001
  // The { recursive, force } and maxRetries/retryDelay option lowerings.
@@ -2035,621 +2070,641 @@ export const BUILTIN_MODULE_FN_ALIASES = {
2035
2070
  cpus: ["os.cpusModel", "os.cpusField"],
2036
2071
  },
2037
2072
  };
2038
- export const AMBIENT_SURFACE_FNS = [
2039
- {
2040
- id: "node-builtin.worker_threads.Worker",
2041
- kind: "node-builtin",
2042
- name: "worker_threads.Worker",
2043
- fns: ["worker.new"],
2044
- note: "native threads with statically compiled entry points, workerData, argv and message events",
2045
- },
2046
- {
2047
- id: "node-builtin.worker_threads.metadata",
2048
- kind: "node-builtin",
2049
- name: "worker_threads metadata",
2050
- fns: [
2051
- "worker.isMainThread",
2052
- "worker.threadId",
2053
- "worker.data",
2054
- "worker.parentPort",
2055
- "worker.resourceLimits",
2056
- "worker.threadName",
2057
- ],
2058
- note: "current-thread metadata and the worker's parent message port",
2059
- },
2060
- {
2061
- id: "stdlib.sharedArrayBuffer",
2062
- kind: "stdlib",
2063
- name: "SharedArrayBuffer",
2064
- fns: ["sharedArrayBuffer.new"],
2065
- note: "fixed shared storage with context-local typed-array and DataView wrappers",
2066
- },
2067
- {
2068
- id: "stdlib.blob",
2069
- kind: "stdlib",
2070
- name: "Blob",
2071
- fns: ["blob.new", "blob.slice", "blob.text", "blob.bytes", "blob.arrayBuffer", "blob.is"],
2072
- note: "immutable bytes with size, type, slice(), text(), bytes(), arrayBuffer() and structured cloning",
2073
- },
2074
- {
2075
- id: "stdlib.file",
2076
- kind: "stdlib",
2077
- name: "File",
2078
- fns: ["blob.fileNew"],
2079
- note: "a Blob with name and lastModified (Date.now() when absent)",
2080
- },
2081
- {
2082
- id: "stdlib.webcrypto.subtle",
2083
- kind: "stdlib",
2084
- name: "globalThis.crypto.subtle",
2085
- fns: [
2086
- "webcrypto.generateKey",
2087
- "webcrypto.importKey",
2088
- "webcrypto.exportKey",
2089
- "webcrypto.encrypt",
2090
- "webcrypto.decrypt",
2091
- "webcrypto.wrapKey",
2092
- "webcrypto.unwrapKey",
2093
- "webcrypto.deriveBits",
2094
- "webcrypto.deriveKey",
2095
- "webcrypto.sign",
2096
- "webcrypto.verify",
2097
- "webcrypto.digest",
2098
- ],
2099
- note: "importKey, generateKey and exportKey (raw and jwk) for HMAC and AES keys, importKey for PBKDF2 and HKDF keys, AES-GCM, AES-CBC and AES-CTR encrypt and decrypt, wrapKey and unwrapKey of secret keys with AES-KW or those ciphers, PBKDF2 and HKDF deriveBits and deriveKey, HMAC sign and verify, generateKey, importKey, exportKey, sign and verify for ECDSA, Ed25519, RSASSA-PKCS1-v1_5 and RSA-PSS, and SHA-1/SHA-2 digest; other methods, algorithms and key formats are refused",
2100
- },
2101
- {
2102
- id: "stdlib.webcrypto.CryptoKey",
2103
- kind: "stdlib",
2104
- name: "CryptoKey",
2105
- fns: ["webcrypto.isCryptoKey"],
2106
- note: "secret HMAC, AES, PBKDF2 and HKDF keys with type, extractable, algorithm and usages, and instanceof CryptoKey",
2107
- },
2108
- {
2109
- id: "stdlib.atomics",
2110
- kind: "stdlib",
2111
- name: "Atomics",
2112
- fns: ["atomics.op", "atomics.wait", "atomics.notify"],
2113
- note: "8-, 16- and 32-bit integer operations, plus Int32Array wait and notify",
2114
- },
2115
- {
2116
- id: "node-builtin.fs.callbacks",
2117
- kind: "node-builtin",
2118
- name: "fs error-first callbacks",
2119
- fns: ["fs.callbackValue", "fs.callbackCall", "fs.callbackGlob"],
2120
- note: "native filesystem callbacks, including stored platform adapter functions",
2121
- },
2122
- // ── the Date slice (lowerDateCall/lowerNew): statics, construction,
2123
- // stored read-only values, calendar getters, and ISO formatting.
2124
- {
2125
- id: "stdlib.date.now",
2126
- kind: "stdlib",
2127
- name: "Date.now",
2128
- fns: ["date.now"],
2129
- note: "the live clock",
2130
- },
2131
- {
2132
- id: "stdlib.date.parse",
2133
- kind: "stdlib",
2134
- name: "Date.parse",
2135
- fns: ["date.parse"],
2136
- note: "one date string, using V8's date parser shared with new Date(dateString)",
2137
- },
2138
- {
2139
- id: "stdlib.date.constructor",
2140
- kind: "stdlib",
2141
- name: "Date constructor",
2142
- fns: [
2143
- "date.newNow",
2144
- "date.newMs",
2145
- "date.newString",
2146
- "date.nativeNew",
2147
- "date.newLocal",
2148
- "date.nativeNewFields",
2149
- "date.nativeNewValue",
2150
- "date.argumentsTime",
2151
- "date.classOperation",
2152
- ],
2153
- note: "zero arguments, one milliseconds/date-string argument, or local-time year/month fields; values are the read-only TimeClip scalar slice",
2154
- },
2155
- {
2156
- id: "stdlib.date.UTC",
2157
- kind: "stdlib",
2158
- name: "Date.UTC",
2159
- fns: ["date.utc"],
2160
- note: "the lowered call form takes 1 to 7 number arguments",
2161
- },
2162
- {
2163
- id: "stdlib.date.getTime",
2164
- kind: "stdlib",
2165
- name: "Date.prototype.getTime",
2166
- fns: ["date.getTime", "date.parseGetTime"],
2167
- note: "the millisecond value of a stored Date",
2168
- },
2169
- {
2170
- id: "stdlib.date.valueOf",
2171
- kind: "stdlib",
2172
- name: "Date.prototype.valueOf",
2173
- fns: ["date.valueOf"],
2174
- note: "the same millisecond read as getTime()",
2175
- },
2176
- {
2177
- id: "stdlib.date.toISOString",
2178
- kind: "stdlib",
2179
- name: "Date.prototype.toISOString",
2180
- fns: ["date.toISOString", "date.toISOStringValue"],
2181
- note: "UTC ISO formatting over constructed and stored Date values",
2182
- },
2183
- {
2184
- id: "stdlib.date.toUTCString",
2185
- kind: "stdlib",
2186
- name: "Date.prototype.toUTCString",
2187
- fns: ["date.toUTCString"],
2188
- note: "RFC 7231 IMF-fixdate formatting over stored Date values",
2189
- },
2190
- {
2191
- id: "stdlib.date.getFullYear",
2192
- kind: "stdlib",
2193
- name: "Date.prototype.getFullYear",
2194
- fns: ["date.getFullYear"],
2195
- },
2196
- {
2197
- id: "stdlib.date.getUTCFullYear",
2198
- kind: "stdlib",
2199
- name: "Date.prototype.getUTCFullYear",
2200
- fns: ["date.getUTCFullYear"],
2201
- },
2202
- {
2203
- id: "stdlib.date.getMonth",
2204
- kind: "stdlib",
2205
- name: "Date.prototype.getMonth",
2206
- fns: ["date.getMonth"],
2207
- },
2208
- {
2209
- id: "stdlib.date.getUTCMonth",
2210
- kind: "stdlib",
2211
- name: "Date.prototype.getUTCMonth",
2212
- fns: ["date.getUTCMonth"],
2213
- },
2214
- {
2215
- id: "stdlib.date.getDate",
2216
- kind: "stdlib",
2217
- name: "Date.prototype.getDate",
2218
- fns: ["date.getDate"],
2219
- },
2220
- {
2221
- id: "stdlib.date.getUTCDate",
2222
- kind: "stdlib",
2223
- name: "Date.prototype.getUTCDate",
2224
- fns: ["date.getUTCDate"],
2225
- },
2226
- { id: "stdlib.date.getDay", kind: "stdlib", name: "Date.prototype.getDay", fns: ["date.getDay"] },
2227
- {
2228
- id: "stdlib.date.getUTCDay",
2229
- kind: "stdlib",
2230
- name: "Date.prototype.getUTCDay",
2231
- fns: ["date.getUTCDay"],
2232
- },
2233
- {
2234
- id: "stdlib.date.getHours",
2235
- kind: "stdlib",
2236
- name: "Date.prototype.getHours",
2237
- fns: ["date.getHours"],
2238
- },
2239
- {
2240
- id: "stdlib.date.getUTCHours",
2241
- kind: "stdlib",
2242
- name: "Date.prototype.getUTCHours",
2243
- fns: ["date.getUTCHours"],
2244
- },
2245
- {
2246
- id: "stdlib.date.getMinutes",
2247
- kind: "stdlib",
2248
- name: "Date.prototype.getMinutes",
2249
- fns: ["date.getMinutes"],
2250
- },
2251
- {
2252
- id: "stdlib.date.getUTCMinutes",
2253
- kind: "stdlib",
2254
- name: "Date.prototype.getUTCMinutes",
2255
- fns: ["date.getUTCMinutes"],
2256
- },
2257
- {
2258
- id: "stdlib.date.getSeconds",
2259
- kind: "stdlib",
2260
- name: "Date.prototype.getSeconds",
2261
- fns: ["date.getSeconds"],
2262
- },
2263
- {
2264
- id: "stdlib.date.getUTCSeconds",
2265
- kind: "stdlib",
2266
- name: "Date.prototype.getUTCSeconds",
2267
- fns: ["date.getUTCSeconds"],
2268
- },
2269
- {
2270
- id: "stdlib.date.getMilliseconds",
2271
- kind: "stdlib",
2272
- name: "Date.prototype.getMilliseconds",
2273
- fns: ["date.getMilliseconds"],
2274
- },
2275
- {
2276
- id: "stdlib.date.getUTCMilliseconds",
2277
- kind: "stdlib",
2278
- name: "Date.prototype.getUTCMilliseconds",
2279
- fns: ["date.getUTCMilliseconds"],
2280
- },
2281
- {
2282
- id: "stdlib.date.getTimezoneOffset",
2283
- kind: "stdlib",
2284
- name: "Date.prototype.getTimezoneOffset",
2285
- fns: ["date.getTimezoneOffset"],
2286
- },
2287
- {
2288
- id: "stdlib.date.toString",
2289
- kind: "stdlib",
2290
- name: "Date.prototype.toString",
2291
- fns: ["date.toString"],
2292
- note: "local time with the host zone's long English name; String(date) and template literals use it",
2293
- },
2294
- {
2295
- id: "stdlib.date.toDateString",
2296
- kind: "stdlib",
2297
- name: "Date.prototype.toDateString",
2298
- fns: ["date.toDateString"],
2299
- },
2300
- {
2301
- id: "stdlib.date.toTimeString",
2302
- kind: "stdlib",
2303
- name: "Date.prototype.toTimeString",
2304
- fns: ["date.toTimeString"],
2305
- },
2306
- // ── perf_hooks (lowerPerfHooksCall): the monotonic clock.
2307
- {
2308
- id: "node-builtin.perf_hooks.performance.now",
2309
- kind: "node-builtin",
2310
- name: "perf_hooks.performance.now",
2311
- fns: ["perf.now"],
2312
- note: "the global performance object and the performance.now.bind(performance) function value reach the same clock",
2313
- },
2314
- {
2315
- id: "node-builtin.perf_hooks.performance.mark",
2316
- kind: "node-builtin",
2317
- name: "perf_hooks.performance.mark",
2318
- fns: [
2319
- "perf.mark",
2320
- "perf.entryName",
2321
- "perf.entryType",
2322
- "perf.entryStart",
2323
- "perf.entryDuration",
2324
- "perf.entryDetail",
2325
- "perf.entryKeep",
2326
- "perf.entryRef",
2327
- ],
2328
- note: "records a mark in the thread's performance timeline at the live clock or the given startTime",
2329
- },
2330
- {
2331
- id: "node-builtin.perf_hooks.performance.measure",
2332
- kind: "node-builtin",
2333
- name: "perf_hooks.performance.measure",
2334
- fns: ["perf.measure"],
2335
- note: "the mark-name, timestamp, and options forms are one surface",
2336
- },
2337
- {
2338
- id: "node-builtin.perf_hooks.performance.getEntries",
2339
- kind: "node-builtin",
2340
- name: "perf_hooks.performance.getEntries",
2341
- fns: ["perf.entries"],
2342
- note: "getEntries, getEntriesByName, and getEntriesByType read the same timeline",
2343
- },
2344
- {
2345
- id: "node-builtin.perf_hooks.performance.clearMarks",
2346
- kind: "node-builtin",
2347
- name: "perf_hooks.performance.clearMarks",
2348
- fns: ["perf.clearMarks"],
2349
- },
2350
- {
2351
- id: "node-builtin.perf_hooks.performance.clearMeasures",
2352
- kind: "node-builtin",
2353
- name: "perf_hooks.performance.clearMeasures",
2354
- fns: ["perf.clearMeasures"],
2355
- },
2356
- {
2357
- id: "node-builtin.perf_hooks.performance.eventLoopUtilization",
2358
- kind: "node-builtin",
2359
- name: "perf_hooks.performance.eventLoopUtilization",
2360
- fns: ["perf.loopStart", "perf.idleTime"],
2361
- note: "active time is the main thread's CPU time since the loop started; the one- and two-argument difference forms are supported",
2362
- },
2363
- {
2364
- id: "node-builtin.perf_hooks.monitorEventLoopDelay",
2365
- kind: "node-builtin",
2366
- name: "perf_hooks.monitorEventLoopDelay",
2367
- fns: [
2368
- "perf.eldNew",
2369
- "perf.eldEnable",
2370
- "perf.eldDisable",
2371
- "perf.eldReset",
2372
- "perf.eldPercentile",
2373
- "perf.eldStat",
2374
- ],
2375
- note: "an unref'd sampling interval records the delay histogram; enable, disable, reset, percentile and the min, max, mean, stddev, count and exceeds readings are supported",
2376
- },
2377
- // ── the process global's ambient reads and authority calls
2378
- // (lowerProcessProperty/lowerProcessMethodCall — process is a
2379
- // provenance-checked global here, not an importable module).
2380
- {
2381
- id: "node-builtin.process.env",
2382
- kind: "node-builtin",
2383
- name: "process.env",
2384
- fns: ["process.envGet", "process.envSet", "process.envUnset", "process.envPairs"],
2385
- note: "reads, writes, deletes, and enumeration of the process environment (the process global)",
2386
- },
2387
- {
2388
- id: "node-builtin.process.argv",
2389
- kind: "node-builtin",
2390
- name: "process.argv",
2391
- fns: ["process.argv"],
2392
- },
2393
- {
2394
- id: "node-builtin.process.hrtime",
2395
- kind: "node-builtin",
2396
- name: "process.hrtime",
2397
- fns: ["process.hrtimeValue"],
2398
- note: "native monotonic tuple clock and bigint member; direct calls and stored JavaScript callable values",
2399
- },
2400
- {
2401
- id: "node-builtin.process.getBuiltinModule",
2402
- kind: "node-builtin",
2403
- name: "process.getBuiltinModule",
2404
- fns: ["process.builtinId", "process.builtinModule", "process.builtinUnsupported"],
2405
- note: "native path and os export subsets plus current-thread worker_threads metadata; other modules and exports throw SC2020",
2406
- },
2407
- {
2408
- id: "node-builtin.process.versions",
2409
- kind: "node-builtin",
2410
- name: "process.versions",
2411
- fns: ["process.versions"],
2412
- note: "shared version dictionary containing node and openssl; other components are absent unless defined by the program",
2413
- },
2414
- {
2415
- id: "node-builtin.process.release",
2416
- kind: "node-builtin",
2417
- name: "process.release",
2418
- fns: ["process.release"],
2419
- note: "the compatibility target's release metadata as one stable read-only object",
2420
- },
2421
- {
2422
- id: "node-builtin.process.cwd",
2423
- kind: "node-builtin",
2424
- name: "process.cwd",
2425
- fns: ["process.cwd"],
2426
- },
2427
- {
2428
- id: "node-builtin.process.chdir",
2429
- kind: "node-builtin",
2430
- name: "process.chdir",
2431
- fns: ["process.chdir"],
2432
- },
2433
- {
2434
- id: "node-builtin.process.pid",
2435
- kind: "node-builtin",
2436
- name: "process.pid",
2437
- fns: ["process.pid"],
2438
- },
2439
- {
2440
- id: "node-builtin.process.getuid",
2441
- kind: "node-builtin",
2442
- name: "process.getuid",
2443
- fns: ["process.getuid"],
2444
- },
2445
- {
2446
- id: "node-builtin.process.getgid",
2447
- kind: "node-builtin",
2448
- name: "process.getgid",
2449
- fns: ["process.getgid"],
2450
- },
2451
- {
2452
- id: "node-builtin.process.geteuid",
2453
- kind: "node-builtin",
2454
- name: "process.geteuid",
2455
- fns: ["process.geteuid"],
2456
- },
2457
- {
2458
- id: "node-builtin.process.getegid",
2459
- kind: "node-builtin",
2460
- name: "process.getegid",
2461
- fns: ["process.getegid"],
2462
- },
2463
- {
2464
- id: "node-builtin.process.getgroups",
2465
- kind: "node-builtin",
2466
- name: "process.getgroups",
2467
- fns: ["process.getgroups"],
2468
- },
2469
- {
2470
- id: "node-builtin.process.ppid",
2471
- kind: "node-builtin",
2472
- name: "process.ppid",
2473
- fns: ["process.ppid"],
2474
- },
2475
- {
2476
- id: "node-builtin.process.title",
2477
- kind: "node-builtin",
2478
- name: "process.title",
2479
- fns: ["process.title", "process.setTitle"],
2480
- note: "reads and writes of the process title are one surface",
2481
- },
2482
- {
2483
- id: "node-builtin.process.argv0",
2484
- kind: "node-builtin",
2485
- name: "process.argv0",
2486
- fns: ["process.argv0"],
2487
- },
2488
- {
2489
- id: "node-builtin.process.execArgv",
2490
- kind: "node-builtin",
2491
- name: "process.execArgv",
2492
- fns: ["process.execArgv"],
2493
- },
2494
- {
2495
- id: "node-builtin.process.execPath",
2496
- kind: "node-builtin",
2497
- name: "process.execPath",
2498
- fns: ["process.execPath"],
2499
- },
2500
- {
2501
- id: "node-builtin.process.uptime",
2502
- kind: "node-builtin",
2503
- name: "process.uptime",
2504
- fns: ["process.uptime"],
2505
- },
2506
- {
2507
- id: "node-builtin.process.availableMemory",
2508
- kind: "node-builtin",
2509
- name: "process.availableMemory",
2510
- fns: ["process.availableMemory"],
2511
- },
2512
- {
2513
- id: "node-builtin.process.constrainedMemory",
2514
- kind: "node-builtin",
2515
- name: "process.constrainedMemory",
2516
- fns: ["process.constrainedMemory"],
2517
- },
2518
- {
2519
- id: "node-builtin.process.memoryUsage",
2520
- kind: "node-builtin",
2521
- name: "process.memoryUsage",
2522
- fns: ["process.memoryUsageTake", "process.memoryUsageField", "process.rss"],
2523
- note: "the record and memoryUsage.rss() read live memory state; external and arrayBuffers are 0",
2524
- },
2525
- {
2526
- id: "node-builtin.process.resourceUsage",
2527
- kind: "node-builtin",
2528
- name: "process.resourceUsage",
2529
- fns: ["process.rusage"],
2530
- note: "getrusage's 16 fields — every field read samples live machine state",
2531
- },
2532
- {
2533
- id: "node-builtin.process.cpuUsage",
2534
- kind: "node-builtin",
2535
- name: "process.cpuUsage",
2536
- fns: [
2537
- "process.cpuUser",
2538
- "process.cpuSystem",
2539
- "process.cpuUserDiff",
2540
- "process.cpuSystemDiff",
2541
- "process.cpuPrevValidate",
2542
- ],
2543
- note: "the plain-sample and previous-value diff forms are one surface",
2544
- },
2545
- {
2546
- id: "node-builtin.process.threadCpuUsage",
2547
- kind: "node-builtin",
2548
- name: "process.threadCpuUsage",
2549
- fns: [
2550
- "process.threadCpuUser",
2551
- "process.threadCpuSystem",
2552
- "process.threadCpuUserDiff",
2553
- "process.threadCpuSystemDiff",
2554
- ],
2555
- note: "the plain-sample and previous-value diff forms are one surface",
2556
- },
2557
- {
2558
- id: "node-builtin.process.isTTY",
2559
- kind: "node-builtin",
2560
- name: "process.isTTY",
2561
- fns: ["process.isTTY"],
2562
- note: "the isTTY read on process.stdin/stdout/stderr — one surface across the three streams",
2563
- },
2564
- {
2565
- id: "node-builtin.process.columns",
2566
- kind: "node-builtin",
2567
- name: "process.columns",
2568
- fns: ["process.columns"],
2569
- note: "the columns read on the process stdio streams (terminal geometry)",
2570
- },
2571
- {
2572
- id: "node-builtin.process.rows",
2573
- kind: "node-builtin",
2574
- name: "process.rows",
2575
- fns: ["process.rows"],
2576
- note: "the rows read on process.stdout/stderr (terminal geometry)",
2577
- },
2578
- {
2579
- id: "node-builtin.process.kill",
2580
- kind: "node-builtin",
2581
- name: "process.kill",
2582
- fns: ["process.kill", "process.killNum"],
2583
- note: "the signal-name and signal-number forms are one surface",
2584
- },
2585
- {
2586
- id: "node-builtin.process.umask",
2587
- kind: "node-builtin",
2588
- name: "process.umask",
2589
- fns: ["process.umask"],
2590
- },
2591
- {
2592
- id: "node-builtin.process.exit",
2593
- kind: "node-builtin",
2594
- name: "process.exit",
2595
- fns: ["process.exit", "process.exiting"],
2596
- note: "process.exit and the process._exiting flag read are one surface",
2597
- },
2598
- {
2599
- id: "node-builtin.process.exitCode",
2600
- kind: "node-builtin",
2601
- name: "process.exitCode",
2602
- fns: ["process.setExitCode", "process.setExitCodeTracked", "process.hasExitCode"],
2603
- note: "numeric writes in statement position set the implicit exit status; reads answer the assigned code or undefined; process.exit() reads it",
2604
- },
2605
- // ── the tls CA store (lowerTlsCaCall / lowerTlsRootCertificates): the
2606
- // host's trust anchors, read and replaced. Dedicated paths, and
2607
- // rootCertificates is a VALUE read with no call form at all, so none of
2608
- // the three can hang off a lowering-table row. Split three ways rather
2609
- // than folded into one "CA store" surface: a library author who denies
2610
- // REPLACING the trust anchors is making a different decision from one
2611
- // who denies reading them, and each Node spelling is the name they will
2612
- // reach for when writing the fence.
2613
- {
2614
- id: "node-builtin.tls.getCACertificates",
2615
- kind: "node-builtin",
2616
- name: "tls.getCACertificates",
2617
- fns: ["tlsca.get"],
2618
- note: "the per-type cached PEM bundle: 'default' and 'extra' additionally read NODE_EXTRA_CA_CERTS, 'system' the platform store",
2619
- },
2620
- {
2621
- id: "node-builtin.tls.rootCertificates",
2622
- kind: "node-builtin",
2623
- name: "tls.rootCertificates",
2624
- fns: ["tlsca.root"],
2625
- note: "the value read; answers the same bundled array as getCACertificates('bundled'), but fenced under its own id — the spelling an author writes",
2626
- },
2627
- {
2628
- id: "node-builtin.tls.setDefaultCACertificates",
2629
- kind: "node-builtin",
2630
- name: "tls.setDefaultCACertificates",
2631
- fns: ["tlsca.set"],
2632
- note: "replaces the default set and the client trust anchors for the rest of the process",
2633
- },
2634
- // os.constants is a VALUE read (lowerNamespaceBuiltinProperty and the
2635
- // named-import path): the platform's null-prototype constants object.
2636
- {
2637
- id: "node-builtin.os.constants",
2638
- kind: "node-builtin",
2639
- name: "os.constants",
2640
- fns: ["os.constants"],
2641
- note: "the platform's dlopen, errno, signals and priority groups; members a platform lacks read as undefined",
2642
- },
2643
- // fs.constants as a value, and its members beyond the baked access-mode
2644
- // bits: the target libc's null-prototype constants object.
2645
- {
2646
- id: "node-builtin.fs.constants",
2647
- kind: "node-builtin",
2648
- name: "fs.constants",
2649
- fns: ["fs.constants"],
2650
- note: "node_constants.cc's fs group under the target libc's macros; members a platform lacks read as undefined",
2651
- },
2652
- ];
2073
+ let ambientSurfaceRows;
2074
+ /** The ambient surface rows, built on the first call. */
2075
+ export function ambientSurfaceFns() {
2076
+ ambientSurfaceRows ??= buildAmbientSurfaceFns();
2077
+ return ambientSurfaceRows;
2078
+ }
2079
+ function buildAmbientSurfaceFns() {
2080
+ return [
2081
+ {
2082
+ id: "node-builtin.worker_threads.Worker",
2083
+ kind: "node-builtin",
2084
+ name: "worker_threads.Worker",
2085
+ fns: ["worker.new"],
2086
+ note: "native threads with statically compiled entry points, workerData, argv and message events",
2087
+ },
2088
+ {
2089
+ id: "node-builtin.worker_threads.metadata",
2090
+ kind: "node-builtin",
2091
+ name: "worker_threads metadata",
2092
+ fns: [
2093
+ "worker.isMainThread",
2094
+ "worker.threadId",
2095
+ "worker.data",
2096
+ "worker.parentPort",
2097
+ "worker.resourceLimits",
2098
+ "worker.threadName",
2099
+ ],
2100
+ note: "current-thread metadata and the worker's parent message port",
2101
+ },
2102
+ {
2103
+ id: "stdlib.sharedArrayBuffer",
2104
+ kind: "stdlib",
2105
+ name: "SharedArrayBuffer",
2106
+ fns: ["sharedArrayBuffer.new"],
2107
+ note: "fixed shared storage with context-local typed-array and DataView wrappers",
2108
+ },
2109
+ {
2110
+ id: "stdlib.blob",
2111
+ kind: "stdlib",
2112
+ name: "Blob",
2113
+ fns: ["blob.new", "blob.slice", "blob.text", "blob.bytes", "blob.arrayBuffer", "blob.is"],
2114
+ note: "immutable bytes with size, type, slice(), text(), bytes(), arrayBuffer() and structured cloning",
2115
+ },
2116
+ {
2117
+ id: "stdlib.file",
2118
+ kind: "stdlib",
2119
+ name: "File",
2120
+ fns: ["blob.fileNew"],
2121
+ note: "a Blob with name and lastModified (Date.now() when absent)",
2122
+ },
2123
+ {
2124
+ id: "stdlib.webcrypto.subtle",
2125
+ kind: "stdlib",
2126
+ name: "globalThis.crypto.subtle",
2127
+ fns: [
2128
+ "webcrypto.generateKey",
2129
+ "webcrypto.importKey",
2130
+ "webcrypto.exportKey",
2131
+ "webcrypto.encrypt",
2132
+ "webcrypto.decrypt",
2133
+ "webcrypto.wrapKey",
2134
+ "webcrypto.unwrapKey",
2135
+ "webcrypto.deriveBits",
2136
+ "webcrypto.deriveKey",
2137
+ "webcrypto.sign",
2138
+ "webcrypto.verify",
2139
+ "webcrypto.digest",
2140
+ ],
2141
+ note: "importKey, generateKey and exportKey (raw and jwk) for HMAC and AES keys, importKey for PBKDF2 and HKDF keys, AES-GCM, AES-CBC and AES-CTR encrypt and decrypt, wrapKey and unwrapKey of secret keys with AES-KW or those ciphers, PBKDF2 and HKDF deriveBits and deriveKey, HMAC sign and verify, generateKey, importKey, exportKey, sign and verify for ECDSA, Ed25519, RSASSA-PKCS1-v1_5 and RSA-PSS, and SHA-1/SHA-2 digest; other methods, algorithms and key formats are refused",
2142
+ },
2143
+ {
2144
+ id: "stdlib.webcrypto.CryptoKey",
2145
+ kind: "stdlib",
2146
+ name: "CryptoKey",
2147
+ fns: ["webcrypto.isCryptoKey"],
2148
+ note: "secret HMAC, AES, PBKDF2 and HKDF keys with type, extractable, algorithm and usages, and instanceof CryptoKey",
2149
+ },
2150
+ {
2151
+ id: "stdlib.atomics",
2152
+ kind: "stdlib",
2153
+ name: "Atomics",
2154
+ fns: ["atomics.op", "atomics.wait", "atomics.notify"],
2155
+ note: "8-, 16- and 32-bit integer operations, plus Int32Array wait and notify",
2156
+ },
2157
+ {
2158
+ id: "node-builtin.fs.callbacks",
2159
+ kind: "node-builtin",
2160
+ name: "fs error-first callbacks",
2161
+ fns: ["fs.callbackValue", "fs.callbackCall", "fs.callbackGlob"],
2162
+ note: "native filesystem callbacks, including stored platform adapter functions",
2163
+ },
2164
+ // ── the Date slice (lowerDateCall/lowerNew): statics, construction,
2165
+ // stored read-only values, calendar getters, and ISO formatting.
2166
+ {
2167
+ id: "stdlib.date.now",
2168
+ kind: "stdlib",
2169
+ name: "Date.now",
2170
+ fns: ["date.now"],
2171
+ note: "the live clock",
2172
+ },
2173
+ {
2174
+ id: "stdlib.date.parse",
2175
+ kind: "stdlib",
2176
+ name: "Date.parse",
2177
+ fns: ["date.parse"],
2178
+ note: "one date string, using V8's date parser shared with new Date(dateString)",
2179
+ },
2180
+ {
2181
+ id: "stdlib.date.constructor",
2182
+ kind: "stdlib",
2183
+ name: "Date constructor",
2184
+ fns: [
2185
+ "date.newNow",
2186
+ "date.newMs",
2187
+ "date.newString",
2188
+ "date.nativeNew",
2189
+ "date.newLocal",
2190
+ "date.nativeNewFields",
2191
+ "date.nativeNewValue",
2192
+ "date.argumentsTime",
2193
+ "date.classOperation",
2194
+ ],
2195
+ note: "zero arguments, one milliseconds/date-string argument, or local-time year/month fields; values are the read-only TimeClip scalar slice",
2196
+ },
2197
+ {
2198
+ id: "stdlib.date.setters",
2199
+ kind: "stdlib",
2200
+ name: "Date.prototype setters",
2201
+ fns: ["date.setFields", "date.timeClip", "date.store"],
2202
+ note: "setTime and the local and UTC field setters, with their optional arguments",
2203
+ },
2204
+ {
2205
+ id: "stdlib.date.UTC",
2206
+ kind: "stdlib",
2207
+ name: "Date.UTC",
2208
+ fns: ["date.utc"],
2209
+ note: "the lowered call form takes 1 to 7 number arguments",
2210
+ },
2211
+ {
2212
+ id: "stdlib.date.getTime",
2213
+ kind: "stdlib",
2214
+ name: "Date.prototype.getTime",
2215
+ fns: ["date.getTime", "date.parseGetTime"],
2216
+ note: "the millisecond value of a stored Date",
2217
+ },
2218
+ {
2219
+ id: "stdlib.date.valueOf",
2220
+ kind: "stdlib",
2221
+ name: "Date.prototype.valueOf",
2222
+ fns: ["date.valueOf"],
2223
+ note: "the same millisecond read as getTime()",
2224
+ },
2225
+ {
2226
+ id: "stdlib.date.toISOString",
2227
+ kind: "stdlib",
2228
+ name: "Date.prototype.toISOString",
2229
+ fns: ["date.toISOString", "date.toISOStringValue"],
2230
+ note: "UTC ISO formatting over constructed and stored Date values",
2231
+ },
2232
+ {
2233
+ id: "stdlib.date.toUTCString",
2234
+ kind: "stdlib",
2235
+ name: "Date.prototype.toUTCString",
2236
+ fns: ["date.toUTCString"],
2237
+ note: "RFC 7231 IMF-fixdate formatting over stored Date values",
2238
+ },
2239
+ {
2240
+ id: "stdlib.date.getFullYear",
2241
+ kind: "stdlib",
2242
+ name: "Date.prototype.getFullYear",
2243
+ fns: ["date.getFullYear"],
2244
+ },
2245
+ {
2246
+ id: "stdlib.date.getUTCFullYear",
2247
+ kind: "stdlib",
2248
+ name: "Date.prototype.getUTCFullYear",
2249
+ fns: ["date.getUTCFullYear"],
2250
+ },
2251
+ {
2252
+ id: "stdlib.date.getMonth",
2253
+ kind: "stdlib",
2254
+ name: "Date.prototype.getMonth",
2255
+ fns: ["date.getMonth"],
2256
+ },
2257
+ {
2258
+ id: "stdlib.date.getUTCMonth",
2259
+ kind: "stdlib",
2260
+ name: "Date.prototype.getUTCMonth",
2261
+ fns: ["date.getUTCMonth"],
2262
+ },
2263
+ {
2264
+ id: "stdlib.date.getDate",
2265
+ kind: "stdlib",
2266
+ name: "Date.prototype.getDate",
2267
+ fns: ["date.getDate"],
2268
+ },
2269
+ {
2270
+ id: "stdlib.date.getUTCDate",
2271
+ kind: "stdlib",
2272
+ name: "Date.prototype.getUTCDate",
2273
+ fns: ["date.getUTCDate"],
2274
+ },
2275
+ {
2276
+ id: "stdlib.date.getDay",
2277
+ kind: "stdlib",
2278
+ name: "Date.prototype.getDay",
2279
+ fns: ["date.getDay"],
2280
+ },
2281
+ {
2282
+ id: "stdlib.date.getUTCDay",
2283
+ kind: "stdlib",
2284
+ name: "Date.prototype.getUTCDay",
2285
+ fns: ["date.getUTCDay"],
2286
+ },
2287
+ {
2288
+ id: "stdlib.date.getHours",
2289
+ kind: "stdlib",
2290
+ name: "Date.prototype.getHours",
2291
+ fns: ["date.getHours"],
2292
+ },
2293
+ {
2294
+ id: "stdlib.date.getUTCHours",
2295
+ kind: "stdlib",
2296
+ name: "Date.prototype.getUTCHours",
2297
+ fns: ["date.getUTCHours"],
2298
+ },
2299
+ {
2300
+ id: "stdlib.date.getMinutes",
2301
+ kind: "stdlib",
2302
+ name: "Date.prototype.getMinutes",
2303
+ fns: ["date.getMinutes"],
2304
+ },
2305
+ {
2306
+ id: "stdlib.date.getUTCMinutes",
2307
+ kind: "stdlib",
2308
+ name: "Date.prototype.getUTCMinutes",
2309
+ fns: ["date.getUTCMinutes"],
2310
+ },
2311
+ {
2312
+ id: "stdlib.date.getSeconds",
2313
+ kind: "stdlib",
2314
+ name: "Date.prototype.getSeconds",
2315
+ fns: ["date.getSeconds"],
2316
+ },
2317
+ {
2318
+ id: "stdlib.date.getUTCSeconds",
2319
+ kind: "stdlib",
2320
+ name: "Date.prototype.getUTCSeconds",
2321
+ fns: ["date.getUTCSeconds"],
2322
+ },
2323
+ {
2324
+ id: "stdlib.date.getMilliseconds",
2325
+ kind: "stdlib",
2326
+ name: "Date.prototype.getMilliseconds",
2327
+ fns: ["date.getMilliseconds"],
2328
+ },
2329
+ {
2330
+ id: "stdlib.date.getUTCMilliseconds",
2331
+ kind: "stdlib",
2332
+ name: "Date.prototype.getUTCMilliseconds",
2333
+ fns: ["date.getUTCMilliseconds"],
2334
+ },
2335
+ {
2336
+ id: "stdlib.date.getTimezoneOffset",
2337
+ kind: "stdlib",
2338
+ name: "Date.prototype.getTimezoneOffset",
2339
+ fns: ["date.getTimezoneOffset"],
2340
+ },
2341
+ {
2342
+ id: "stdlib.date.toString",
2343
+ kind: "stdlib",
2344
+ name: "Date.prototype.toString",
2345
+ fns: ["date.toString"],
2346
+ note: "local time with the host zone's long English name; String(date) and template literals use it",
2347
+ },
2348
+ {
2349
+ id: "stdlib.date.toDateString",
2350
+ kind: "stdlib",
2351
+ name: "Date.prototype.toDateString",
2352
+ fns: ["date.toDateString"],
2353
+ },
2354
+ {
2355
+ id: "stdlib.date.toTimeString",
2356
+ kind: "stdlib",
2357
+ name: "Date.prototype.toTimeString",
2358
+ fns: ["date.toTimeString"],
2359
+ },
2360
+ // ── perf_hooks (lowerPerfHooksCall): the monotonic clock.
2361
+ {
2362
+ id: "node-builtin.perf_hooks.performance.now",
2363
+ kind: "node-builtin",
2364
+ name: "perf_hooks.performance.now",
2365
+ fns: ["perf.now"],
2366
+ note: "the global performance object and the performance.now.bind(performance) function value reach the same clock",
2367
+ },
2368
+ {
2369
+ id: "node-builtin.perf_hooks.performance.mark",
2370
+ kind: "node-builtin",
2371
+ name: "perf_hooks.performance.mark",
2372
+ fns: [
2373
+ "perf.mark",
2374
+ "perf.entryName",
2375
+ "perf.entryType",
2376
+ "perf.entryStart",
2377
+ "perf.entryDuration",
2378
+ "perf.entryDetail",
2379
+ "perf.entryKeep",
2380
+ "perf.entryRef",
2381
+ ],
2382
+ note: "records a mark in the thread's performance timeline at the live clock or the given startTime",
2383
+ },
2384
+ {
2385
+ id: "node-builtin.perf_hooks.performance.measure",
2386
+ kind: "node-builtin",
2387
+ name: "perf_hooks.performance.measure",
2388
+ fns: ["perf.measure"],
2389
+ note: "the mark-name, timestamp, and options forms are one surface",
2390
+ },
2391
+ {
2392
+ id: "node-builtin.perf_hooks.performance.getEntries",
2393
+ kind: "node-builtin",
2394
+ name: "perf_hooks.performance.getEntries",
2395
+ fns: ["perf.entries"],
2396
+ note: "getEntries, getEntriesByName, and getEntriesByType read the same timeline",
2397
+ },
2398
+ {
2399
+ id: "node-builtin.perf_hooks.performance.clearMarks",
2400
+ kind: "node-builtin",
2401
+ name: "perf_hooks.performance.clearMarks",
2402
+ fns: ["perf.clearMarks"],
2403
+ },
2404
+ {
2405
+ id: "node-builtin.perf_hooks.performance.clearMeasures",
2406
+ kind: "node-builtin",
2407
+ name: "perf_hooks.performance.clearMeasures",
2408
+ fns: ["perf.clearMeasures"],
2409
+ },
2410
+ {
2411
+ id: "node-builtin.perf_hooks.performance.eventLoopUtilization",
2412
+ kind: "node-builtin",
2413
+ name: "perf_hooks.performance.eventLoopUtilization",
2414
+ fns: ["perf.loopStart", "perf.idleTime"],
2415
+ note: "active time is the main thread's CPU time since the loop started; the one- and two-argument difference forms are supported",
2416
+ },
2417
+ {
2418
+ id: "node-builtin.perf_hooks.monitorEventLoopDelay",
2419
+ kind: "node-builtin",
2420
+ name: "perf_hooks.monitorEventLoopDelay",
2421
+ fns: [
2422
+ "perf.eldNew",
2423
+ "perf.eldEnable",
2424
+ "perf.eldDisable",
2425
+ "perf.eldReset",
2426
+ "perf.eldPercentile",
2427
+ "perf.eldStat",
2428
+ ],
2429
+ note: "an unref'd sampling interval records the delay histogram; enable, disable, reset, percentile and the min, max, mean, stddev, count and exceeds readings are supported",
2430
+ },
2431
+ // ── the process global's ambient reads and authority calls
2432
+ // (lowerProcessProperty/lowerProcessMethodCall — process is a
2433
+ // provenance-checked global here, not an importable module).
2434
+ {
2435
+ id: "node-builtin.process.env",
2436
+ kind: "node-builtin",
2437
+ name: "process.env",
2438
+ fns: ["process.envGet", "process.envSet", "process.envUnset", "process.envPairs"],
2439
+ note: "reads, writes, deletes, and enumeration of the process environment (the process global)",
2440
+ },
2441
+ {
2442
+ id: "node-builtin.process.argv",
2443
+ kind: "node-builtin",
2444
+ name: "process.argv",
2445
+ fns: ["process.argv"],
2446
+ },
2447
+ {
2448
+ id: "node-builtin.process.hrtime",
2449
+ kind: "node-builtin",
2450
+ name: "process.hrtime",
2451
+ fns: ["process.hrtimeValue"],
2452
+ note: "native monotonic tuple clock and bigint member; direct calls and stored JavaScript callable values",
2453
+ },
2454
+ {
2455
+ id: "node-builtin.process.getBuiltinModule",
2456
+ kind: "node-builtin",
2457
+ name: "process.getBuiltinModule",
2458
+ fns: ["process.builtinId", "process.builtinModule", "process.builtinUnsupported"],
2459
+ note: "native path and os export subsets plus current-thread worker_threads metadata; other modules and exports throw SC2020",
2460
+ },
2461
+ {
2462
+ id: "node-builtin.process.versions",
2463
+ kind: "node-builtin",
2464
+ name: "process.versions",
2465
+ fns: ["process.versions"],
2466
+ note: "shared version dictionary containing node and openssl; other components are absent unless defined by the program",
2467
+ },
2468
+ {
2469
+ id: "node-builtin.process.release",
2470
+ kind: "node-builtin",
2471
+ name: "process.release",
2472
+ fns: ["process.release"],
2473
+ note: "the compatibility target's release metadata as one stable read-only object",
2474
+ },
2475
+ {
2476
+ id: "node-builtin.process.cwd",
2477
+ kind: "node-builtin",
2478
+ name: "process.cwd",
2479
+ fns: ["process.cwd"],
2480
+ },
2481
+ {
2482
+ id: "node-builtin.process.chdir",
2483
+ kind: "node-builtin",
2484
+ name: "process.chdir",
2485
+ fns: ["process.chdir"],
2486
+ },
2487
+ {
2488
+ id: "node-builtin.process.pid",
2489
+ kind: "node-builtin",
2490
+ name: "process.pid",
2491
+ fns: ["process.pid"],
2492
+ },
2493
+ {
2494
+ id: "node-builtin.process.getuid",
2495
+ kind: "node-builtin",
2496
+ name: "process.getuid",
2497
+ fns: ["process.getuid"],
2498
+ },
2499
+ {
2500
+ id: "node-builtin.process.getgid",
2501
+ kind: "node-builtin",
2502
+ name: "process.getgid",
2503
+ fns: ["process.getgid"],
2504
+ },
2505
+ {
2506
+ id: "node-builtin.process.geteuid",
2507
+ kind: "node-builtin",
2508
+ name: "process.geteuid",
2509
+ fns: ["process.geteuid"],
2510
+ },
2511
+ {
2512
+ id: "node-builtin.process.getegid",
2513
+ kind: "node-builtin",
2514
+ name: "process.getegid",
2515
+ fns: ["process.getegid"],
2516
+ },
2517
+ {
2518
+ id: "node-builtin.process.getgroups",
2519
+ kind: "node-builtin",
2520
+ name: "process.getgroups",
2521
+ fns: ["process.getgroups"],
2522
+ },
2523
+ {
2524
+ id: "node-builtin.process.ppid",
2525
+ kind: "node-builtin",
2526
+ name: "process.ppid",
2527
+ fns: ["process.ppid"],
2528
+ },
2529
+ {
2530
+ id: "node-builtin.process.title",
2531
+ kind: "node-builtin",
2532
+ name: "process.title",
2533
+ fns: ["process.title", "process.setTitle"],
2534
+ note: "reads and writes of the process title are one surface",
2535
+ },
2536
+ {
2537
+ id: "node-builtin.process.argv0",
2538
+ kind: "node-builtin",
2539
+ name: "process.argv0",
2540
+ fns: ["process.argv0"],
2541
+ },
2542
+ {
2543
+ id: "node-builtin.process.execArgv",
2544
+ kind: "node-builtin",
2545
+ name: "process.execArgv",
2546
+ fns: ["process.execArgv"],
2547
+ },
2548
+ {
2549
+ id: "node-builtin.process.execPath",
2550
+ kind: "node-builtin",
2551
+ name: "process.execPath",
2552
+ fns: ["process.execPath"],
2553
+ },
2554
+ {
2555
+ id: "node-builtin.process.uptime",
2556
+ kind: "node-builtin",
2557
+ name: "process.uptime",
2558
+ fns: ["process.uptime"],
2559
+ },
2560
+ {
2561
+ id: "node-builtin.process.availableMemory",
2562
+ kind: "node-builtin",
2563
+ name: "process.availableMemory",
2564
+ fns: ["process.availableMemory"],
2565
+ },
2566
+ {
2567
+ id: "node-builtin.process.constrainedMemory",
2568
+ kind: "node-builtin",
2569
+ name: "process.constrainedMemory",
2570
+ fns: ["process.constrainedMemory"],
2571
+ },
2572
+ {
2573
+ id: "node-builtin.process.memoryUsage",
2574
+ kind: "node-builtin",
2575
+ name: "process.memoryUsage",
2576
+ fns: ["process.memoryUsageTake", "process.memoryUsageField", "process.rss"],
2577
+ note: "the record and memoryUsage.rss() read live memory state; external and arrayBuffers are 0",
2578
+ },
2579
+ {
2580
+ id: "node-builtin.process.resourceUsage",
2581
+ kind: "node-builtin",
2582
+ name: "process.resourceUsage",
2583
+ fns: ["process.rusage"],
2584
+ note: "getrusage's 16 fields — every field read samples live machine state",
2585
+ },
2586
+ {
2587
+ id: "node-builtin.process.cpuUsage",
2588
+ kind: "node-builtin",
2589
+ name: "process.cpuUsage",
2590
+ fns: [
2591
+ "process.cpuUser",
2592
+ "process.cpuSystem",
2593
+ "process.cpuUserDiff",
2594
+ "process.cpuSystemDiff",
2595
+ "process.cpuPrevValidate",
2596
+ ],
2597
+ note: "the plain-sample and previous-value diff forms are one surface",
2598
+ },
2599
+ {
2600
+ id: "node-builtin.process.threadCpuUsage",
2601
+ kind: "node-builtin",
2602
+ name: "process.threadCpuUsage",
2603
+ fns: [
2604
+ "process.threadCpuUser",
2605
+ "process.threadCpuSystem",
2606
+ "process.threadCpuUserDiff",
2607
+ "process.threadCpuSystemDiff",
2608
+ ],
2609
+ note: "the plain-sample and previous-value diff forms are one surface",
2610
+ },
2611
+ {
2612
+ id: "node-builtin.process.isTTY",
2613
+ kind: "node-builtin",
2614
+ name: "process.isTTY",
2615
+ fns: ["process.isTTY"],
2616
+ note: "the isTTY read on process.stdin/stdout/stderr — one surface across the three streams",
2617
+ },
2618
+ {
2619
+ id: "node-builtin.process.columns",
2620
+ kind: "node-builtin",
2621
+ name: "process.columns",
2622
+ fns: ["process.columns"],
2623
+ note: "the columns read on the process stdio streams (terminal geometry)",
2624
+ },
2625
+ {
2626
+ id: "node-builtin.process.rows",
2627
+ kind: "node-builtin",
2628
+ name: "process.rows",
2629
+ fns: ["process.rows"],
2630
+ note: "the rows read on process.stdout/stderr (terminal geometry)",
2631
+ },
2632
+ {
2633
+ id: "node-builtin.process.kill",
2634
+ kind: "node-builtin",
2635
+ name: "process.kill",
2636
+ fns: ["process.kill", "process.killNum"],
2637
+ note: "the signal-name and signal-number forms are one surface",
2638
+ },
2639
+ {
2640
+ id: "node-builtin.process.umask",
2641
+ kind: "node-builtin",
2642
+ name: "process.umask",
2643
+ fns: ["process.umask"],
2644
+ },
2645
+ {
2646
+ id: "node-builtin.process.exit",
2647
+ kind: "node-builtin",
2648
+ name: "process.exit",
2649
+ fns: ["process.exit", "process.exiting"],
2650
+ note: "process.exit and the process._exiting flag read are one surface",
2651
+ },
2652
+ {
2653
+ id: "node-builtin.process.exitCode",
2654
+ kind: "node-builtin",
2655
+ name: "process.exitCode",
2656
+ fns: ["process.setExitCode", "process.setExitCodeTracked", "process.hasExitCode"],
2657
+ note: "numeric writes in statement position set the implicit exit status; reads answer the assigned code or undefined; process.exit() reads it",
2658
+ },
2659
+ // ── the tls CA store (lowerTlsCaCall / lowerTlsRootCertificates): the
2660
+ // host's trust anchors, read and replaced. Dedicated paths, and
2661
+ // rootCertificates is a VALUE read with no call form at all, so none of
2662
+ // the three can hang off a lowering-table row. Split three ways rather
2663
+ // than folded into one "CA store" surface: a library author who denies
2664
+ // REPLACING the trust anchors is making a different decision from one
2665
+ // who denies reading them, and each Node spelling is the name they will
2666
+ // reach for when writing the fence.
2667
+ {
2668
+ id: "node-builtin.tls.getCACertificates",
2669
+ kind: "node-builtin",
2670
+ name: "tls.getCACertificates",
2671
+ fns: ["tlsca.get"],
2672
+ note: "the per-type cached PEM bundle: 'default' and 'extra' additionally read NODE_EXTRA_CA_CERTS, 'system' the platform store",
2673
+ },
2674
+ {
2675
+ id: "node-builtin.tls.rootCertificates",
2676
+ kind: "node-builtin",
2677
+ name: "tls.rootCertificates",
2678
+ fns: ["tlsca.root"],
2679
+ note: "the value read; answers the same bundled array as getCACertificates('bundled'), but fenced under its own id — the spelling an author writes",
2680
+ },
2681
+ {
2682
+ id: "node-builtin.tls.setDefaultCACertificates",
2683
+ kind: "node-builtin",
2684
+ name: "tls.setDefaultCACertificates",
2685
+ fns: ["tlsca.set"],
2686
+ note: "replaces the default set and the client trust anchors for the rest of the process",
2687
+ },
2688
+ // os.constants is a VALUE read (lowerNamespaceBuiltinProperty and the
2689
+ // named-import path): the platform's null-prototype constants object.
2690
+ {
2691
+ id: "node-builtin.os.constants",
2692
+ kind: "node-builtin",
2693
+ name: "os.constants",
2694
+ fns: ["os.constants"],
2695
+ note: "the platform's dlopen, errno, signals and priority groups; members a platform lacks read as undefined",
2696
+ },
2697
+ // fs.constants as a value, and its members beyond the baked access-mode
2698
+ // bits: the target libc's null-prototype constants object.
2699
+ {
2700
+ id: "node-builtin.fs.constants",
2701
+ kind: "node-builtin",
2702
+ name: "fs.constants",
2703
+ fns: ["fs.constants"],
2704
+ note: "node_constants.cc's fs group under the target libc's macros; members a platform lacks read as undefined",
2705
+ },
2706
+ ];
2707
+ }
2653
2708
  /** The win32-target overrides of the bare modules' constants: path's
2654
2709
  * constants ARE the path/win32 namespace's, and os.EOL is CRLF (Node's
2655
2710
  * `isWindows ? '\r\n' : '\n'`). */
@@ -2657,16 +2712,16 @@ const WIN32_TARGET_CONSTS = {
2657
2712
  path: BUILTIN_MODULE_CONSTS["path/win32"],
2658
2713
  os: { EOL: "\r\n", devNull: "\\\\.\\nul" },
2659
2714
  };
2660
- /** BUILTIN_MODULE_FNS with the platform-conditional modules bound per
2715
+ /** builtinModuleFns() with the platform-conditional modules bound per
2661
2716
  * TARGET: a win32 triple compiles Node-on-Windows semantics — `path` is
2662
2717
  * path.win32 and url's bridge selects the Windows runtime behavior. Fence wording is
2663
2718
  * unaffected — callers keep naming the module the source spelled. */
2664
2719
  function builtinModuleFnsOf(lowerer, module) {
2665
2720
  if (lowerer.targetPlatform === "win32") {
2666
2721
  if (module === "path")
2667
- return BUILTIN_MODULE_FNS["path/win32"];
2722
+ return builtinModuleFns()["path/win32"];
2668
2723
  }
2669
- return ownEntry(BUILTIN_MODULE_FNS, module);
2724
+ return ownEntry(builtinModuleFns(), module);
2670
2725
  }
2671
2726
  /** Own-property lookup — lowerer.ts's own(), duplicated locally because
2672
2727
  * lowerer.ts already imports surfaces.ts (a value import back would
@@ -2856,14 +2911,6 @@ export function builtinModulesArrayLit(loc) {
2856
2911
  loc,
2857
2912
  };
2858
2913
  }
2859
- /** Member-specific hints for RECOGNIZED builtin modules whose member has
2860
- * no lowering. The default-options one-shot zlib/deflate-raw/gzip codecs
2861
- * lower for strings and Buffers; the remaining surface points at them. */
2862
- const ZLIB_HINT = "the deflate/inflate, raw, gzip/gunzip, and unzip sync/callback forms with Node's options, crc32, " +
2863
- "and the Deflate/Inflate/Gzip/Gunzip/DeflateRaw/InflateRaw/Unzip streams are the lowered zlib surface";
2864
- /** Brotli has no codec in the static runtime (zlib is the only vendored
2865
- * compression library). */
2866
- const BROTLI_HINT = "Brotli needs a Brotli codec, which the static runtime does not vendor — " + ZLIB_HINT;
2867
2914
  const ASSERT_MODULE_HINTS = {
2868
2915
  ifError: "test explicitly instead: assert.strictEqual(err, null) / " +
2869
2916
  "assert.strictEqual(err, undefined)",
@@ -2910,16 +2957,6 @@ export const BUILTIN_MODULE_FENCE_HINTS = {
2910
2957
  setFips: "a compiled binary has no FIPS provider to enable, and Node itself throws on setFips(true) " +
2911
2958
  "in a non-FIPS build — getFips() answers 0 here",
2912
2959
  },
2913
- zlib: {
2914
- brotliCompressSync: BROTLI_HINT,
2915
- brotliDecompressSync: BROTLI_HINT,
2916
- brotliCompress: BROTLI_HINT,
2917
- brotliDecompress: BROTLI_HINT,
2918
- createBrotliCompress: BROTLI_HINT,
2919
- createBrotliDecompress: BROTLI_HINT,
2920
- BrotliCompress: BROTLI_HINT,
2921
- BrotliDecompress: BROTLI_HINT,
2922
- },
2923
2960
  http2: {
2924
2961
  connect: "HTTP/2 client sessions have no lowering — the lowered http2 surface is the SERVER side: " +
2925
2962
  "createSecureServer({ allowHTTP1: true, cert, key }), which serves HTTP/1.1 only " +