typenative 0.4.0 → 0.5.0

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 (167) hide show
  1. package/.github/workflows/ci.yml +2 -0
  2. package/CHANGELOG.md +372 -0
  3. package/CONTRIBUTION.md +1 -1
  4. package/README.md +62 -22
  5. package/ROUND2-HANDOFF.md +200 -0
  6. package/bin/cli.js +2 -0
  7. package/bin/go/bridge.js +74 -14
  8. package/bin/go/convert.js +48 -0
  9. package/bin/go/metadata.js +13 -4
  10. package/bin/go/overrides.js +4 -6
  11. package/bin/go/stdlib.generated.js +2 -0
  12. package/bin/index.js +130 -2
  13. package/bin/main.js +2 -0
  14. package/bin/node/assert.js +2 -2
  15. package/bin/node/async_hooks.js +1 -1
  16. package/bin/node/buffer.js +16 -5
  17. package/bin/node/child_process.js +57 -9
  18. package/bin/node/cluster.js +44 -6
  19. package/bin/node/core.js +1 -1
  20. package/bin/node/crypto.js +205 -4
  21. package/bin/node/crypto_keys.js +21 -21
  22. package/bin/node/dgram.js +231 -7
  23. package/bin/node/diagnostics_channel.js +3 -3
  24. package/bin/node/dns.js +472 -9
  25. package/bin/node/errno_tables.js +445 -0
  26. package/bin/node/events.js +3 -3
  27. package/bin/node/fetch.js +2 -2
  28. package/bin/node/fs.js +24 -17
  29. package/bin/node/fs_watch.js +5 -5
  30. package/bin/node/http.js +131 -33
  31. package/bin/node/http2.js +7 -4
  32. package/bin/node/module_v8.js +142 -0
  33. package/bin/node/net.js +17 -14
  34. package/bin/node/path.js +17 -3
  35. package/bin/node/process.js +274 -9
  36. package/bin/node/readline.js +272 -1
  37. package/bin/node/registry.js +5 -1
  38. package/bin/node/sqlite.js +65 -17
  39. package/bin/node/stream.js +220 -22
  40. package/bin/node/stream_web.js +10 -10
  41. package/bin/node/system_extra.js +3 -3
  42. package/bin/node/test.js +834 -234
  43. package/bin/node/test_coverage.js +187 -0
  44. package/bin/node/test_report.js +1392 -0
  45. package/bin/node/test_run.js +575 -0
  46. package/bin/node/timers.js +4 -4
  47. package/bin/node/tls.js +5 -5
  48. package/bin/node/url.js +23 -5
  49. package/bin/node/util.js +49 -8
  50. package/bin/node/util_extra.js +13 -37
  51. package/bin/node/webview.js +654 -0
  52. package/bin/node/worker_threads.js +80 -20
  53. package/bin/node/zlib.js +3 -3
  54. package/bin/parse-node.js +4 -0
  55. package/bin/transpiler.js +14457 -1723
  56. package/bin/typecheck-node.js +1 -0
  57. package/bin/version.js +1 -1
  58. package/conformance.md +1153 -884
  59. package/examples/README.md +47 -10
  60. package/examples/desktop-notes/README.md +108 -0
  61. package/examples/desktop-notes/bench.mjs +125 -0
  62. package/examples/desktop-notes/main.ts +131 -0
  63. package/examples/desktop-notes/package-lock.json +726 -0
  64. package/examples/desktop-notes/package.json +9 -0
  65. package/examples/desktop-notes/ui.ts +176 -0
  66. package/examples/dupe-finder/README.md +76 -0
  67. package/examples/dupe-finder/bench.mjs +120 -0
  68. package/examples/dupe-finder/main.ts +87 -0
  69. package/examples/json-server/README.md +31 -29
  70. package/examples/json-server/bench.mjs +130 -38
  71. package/examples/mandelbrot-png/README.md +65 -0
  72. package/examples/mandelbrot-png/bench.mjs +95 -0
  73. package/examples/mandelbrot-png/main.ts +98 -0
  74. package/examples/mandelbrot-png/preview.png +0 -0
  75. package/examples/marked-cli/README.md +159 -0
  76. package/examples/marked-cli/bench.mjs +178 -0
  77. package/examples/marked-cli/main.ts +292 -0
  78. package/examples/marked-cli/parity.mjs +185 -0
  79. package/examples/marked-cli/vendor/marked/LICENSE +44 -0
  80. package/examples/marked-cli/vendor/marked/VENDOR.md +26 -0
  81. package/examples/todo-cli/README.md +69 -0
  82. package/examples/todo-cli/bench.mjs +89 -0
  83. package/examples/todo-cli/main.ts +92 -0
  84. package/examples/yaml-cli/README.md +136 -0
  85. package/examples/yaml-cli/bench.mjs +265 -0
  86. package/examples/yaml-cli/main.ts +29 -0
  87. package/examples/yaml-cli/parity.mjs +156 -0
  88. package/examples/yaml-cli/vendor/yaml/LICENSE +13 -0
  89. package/examples/yaml-cli/vendor/yaml/VENDOR.md +25 -0
  90. package/govendor/github.com/jchv/go-webview2/LICENSE +22 -0
  91. package/govendor/github.com/jchv/go-webview2/README.md +21 -0
  92. package/govendor/github.com/jchv/go-webview2/common.go +84 -0
  93. package/govendor/github.com/jchv/go-webview2/go.mod +3 -0
  94. package/govendor/github.com/jchv/go-webview2/internal/w32/w32.go +194 -0
  95. package/govendor/github.com/jchv/go-webview2/internal/w32/w32_386.go +14 -0
  96. package/govendor/github.com/jchv/go-webview2/internal/w32/w32_64bit.go +15 -0
  97. package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_COLOR.go +8 -0
  98. package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND.go +9 -0
  99. package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_KEY_EVENT_KIND.go +10 -0
  100. package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_MOVE_FOCUS_REASON.go +9 -0
  101. package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_PHYSICAL_KEY_STATUS.go +10 -0
  102. package/govendor/github.com/jchv/go-webview2/pkg/edge/COREWEBVIEW2_WEB_RESOURCE_CONTEXT.go +23 -0
  103. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventArgs.go +78 -0
  104. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventHandler.go +52 -0
  105. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2Controller.go +132 -0
  106. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2Controller2.go +74 -0
  107. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.go +48 -0
  108. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventArgs.go +17 -0
  109. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventHandler.go +48 -0
  110. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2Settings.go +270 -0
  111. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2WebResourceRequest.go +43 -0
  112. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventArgs.go +51 -0
  113. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventHandler.go +48 -0
  114. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2WebResourceResponse.go +21 -0
  115. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2_2.go +21 -0
  116. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebView2_3.go +60 -0
  117. package/govendor/github.com/jchv/go-webview2/pkg/edge/ICoreWebViewSettings.go +396 -0
  118. package/govendor/github.com/jchv/go-webview2/pkg/edge/chromium.go +361 -0
  119. package/govendor/github.com/jchv/go-webview2/pkg/edge/chromium_386.go +24 -0
  120. package/govendor/github.com/jchv/go-webview2/pkg/edge/chromium_amd64.go +22 -0
  121. package/govendor/github.com/jchv/go-webview2/pkg/edge/chromium_arm64.go +26 -0
  122. package/govendor/github.com/jchv/go-webview2/pkg/edge/comproc.go +13 -0
  123. package/govendor/github.com/jchv/go-webview2/pkg/edge/comproc_go17.go +51 -0
  124. package/govendor/github.com/jchv/go-webview2/pkg/edge/comproc_go18.go +16 -0
  125. package/govendor/github.com/jchv/go-webview2/pkg/edge/corewebview2.go +411 -0
  126. package/govendor/github.com/jchv/go-webview2/pkg/edge/guid.go +223 -0
  127. package/govendor/github.com/jchv/go-webview2/webview.go +482 -0
  128. package/govendor/github.com/jchv/go-webview2/webviewloader/README.md +3 -0
  129. package/govendor/github.com/jchv/go-webview2/webviewloader/module.go +153 -0
  130. package/govendor/github.com/jchv/go-webview2/webviewloader/module_386.go +6 -0
  131. package/govendor/github.com/jchv/go-webview2/webviewloader/module_amd64.go +6 -0
  132. package/govendor/github.com/jchv/go-webview2/webviewloader/module_arm64.go +6 -0
  133. package/govendor/github.com/jchv/go-webview2/webviewloader/sdk/arm64/WebView2Loader.dll +0 -0
  134. package/govendor/github.com/jchv/go-webview2/webviewloader/sdk/x64/WebView2Loader.dll +0 -0
  135. package/govendor/github.com/jchv/go-webview2/webviewloader/sdk/x86/WebView2Loader.dll +0 -0
  136. package/govendor/github.com/jchv/go-winloader/LICENSE.md +7 -0
  137. package/govendor/github.com/jchv/go-winloader/README.md +124 -0
  138. package/govendor/github.com/jchv/go-winloader/common.go +11 -0
  139. package/govendor/github.com/jchv/go-winloader/go.mod +3 -0
  140. package/govendor/github.com/jchv/go-winloader/internal/loader/loader.go +25 -0
  141. package/govendor/github.com/jchv/go-winloader/internal/loader/machine.go +53 -0
  142. package/govendor/github.com/jchv/go-winloader/internal/memloader/cache.go +42 -0
  143. package/govendor/github.com/jchv/go-winloader/internal/memloader/loader.go +253 -0
  144. package/govendor/github.com/jchv/go-winloader/internal/pe/export.go +76 -0
  145. package/govendor/github.com/jchv/go-winloader/internal/pe/format.go +522 -0
  146. package/govendor/github.com/jchv/go-winloader/internal/pe/import.go +106 -0
  147. package/govendor/github.com/jchv/go-winloader/internal/pe/module.go +91 -0
  148. package/govendor/github.com/jchv/go-winloader/internal/pe/reloc.go +177 -0
  149. package/govendor/github.com/jchv/go-winloader/internal/pe/util.go +40 -0
  150. package/govendor/github.com/jchv/go-winloader/internal/vmem/common.go +55 -0
  151. package/govendor/github.com/jchv/go-winloader/internal/vmem/memory_other.go +71 -0
  152. package/govendor/github.com/jchv/go-winloader/internal/vmem/memory_windows.go +179 -0
  153. package/govendor/github.com/jchv/go-winloader/internal/winloader/hacks_other.go +17 -0
  154. package/govendor/github.com/jchv/go-winloader/internal/winloader/hacks_windows.go +73 -0
  155. package/govendor/github.com/jchv/go-winloader/internal/winloader/loader_windows.go +64 -0
  156. package/govendor/github.com/jchv/go-winloader/internal/winloader/machine_windows.go +32 -0
  157. package/govendor/github.com/jchv/go-winloader/internal/winloader/nativearch_386.go +9 -0
  158. package/govendor/github.com/jchv/go-winloader/internal/winloader/nativearch_amd64.go +9 -0
  159. package/govendor/github.com/jchv/go-winloader/internal/winloader/nativearch_arm64.go +9 -0
  160. package/govendor/github.com/jchv/go-winloader/loader_other.go +24 -0
  161. package/govendor/github.com/jchv/go-winloader/loader_windows.go +33 -0
  162. package/govendor/manifest.txt +3 -1
  163. package/package.json +1 -1
  164. package/tsparser/main.go +4 -0
  165. package/types/typenative-go.d.ts +23 -0
  166. package/types/typenative-npm.d.ts +359 -7
  167. package/types/typenative.d.ts +283 -42
package/conformance.md CHANGED
@@ -4,257 +4,382 @@ Every TypeScript language feature and standard-library API TypeNative aims to
4
4
  support, split by area. Each ✅ row links to the [conformance/](conformance/)
5
5
  probe that proves it transpiles correctly (`npm run conformance`, filter with an
6
6
  optional substring: `node scripts/conformance.mjs <filter>`; `--native` runs the
7
- self-hosted binary). Each ❌ row is a known gap with no passing probe yet.
7
+ self-hosted binary). The same run also type-checks and builds every program in
8
+ [examples/](#examples).
9
+
10
+ | Status | Meaning |
11
+ | :----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
12
+ | ✅ | Implemented; the linked probe proves it (`—` in the Probe column: implemented, not probed yet) |
13
+ | ❌ | Not implemented yet, but feasible: a known gap |
14
+ | 🚫 | Will not be implemented: needs something a native Go binary doesn't have (a JavaScript engine, mutable prototypes, shared memory between isolates, cgo), or is deprecated upstream |
15
+
16
+ User programs are type-checked against [types/](types/) only (`lib: []`), so an API that isn't
17
+ declared there fails the type check before it reaches the transpiler. The
18
+ [roadmap](#roadmap-known-limitations) lists the structural limitations and the order in which the
19
+ ❌ rows are planned.
8
20
 
9
21
  ## Basic types
10
22
 
11
- | Feature | Status | Probe | Notes |
12
- | ---------------------------------------------- | :----: | -------------------------------------------------------------------- | ------------------------------------------------------------------------- |
13
- | `number` | ✅ | [syntax-arithmetic.ts](conformance/syntax-arithmetic.ts) | Transpiled to `float64` |
14
- | `boolean` | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | Transpiled to `bool` |
15
- | `string` | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | |
16
- | `null` | ✅ | [syntax-null-undefined.ts](conformance/syntax-null-undefined.ts) | |
17
- | `undefined` | ✅ | [syntax-null-undefined.ts](conformance/syntax-null-undefined.ts) | |
18
- | `any` / `unknown` | ✅ | [syntax-selfhost-context.ts](conformance/syntax-selfhost-context.ts) | Dynamic values handled at runtime (JSON-like objects, arrays, primitives) |
19
- | Nullable types (`T \| null`, `T \| undefined`) | ✅ | [syntax-null-undefined.ts](conformance/syntax-null-undefined.ts) | Transpiled to Go pointer types |
20
- | `bigint` | ✅ | [syntax-bigint.ts](conformance/syntax-bigint.ts) | `2n` literals → `*big.Int`; `**` → `.Exp`, comparisons via `.Cmp` |
21
- | `symbol` | ✅ | [syntax-symbols.ts](conformance/syntax-symbols.ts) | `Symbol()` → unique `*TnSymbol` pointers, usable as record keys |
22
- | `object` type | ✅ | [syntax-object-type.ts](conformance/syntax-object-type.ts) | `object` → `interface{}` |
23
- | `void` / `never` | ✅ | [syntax-void-never.ts](conformance/syntax-void-never.ts) | No return value in Go |
23
+ | Feature | Status | Probe | Notes |
24
+ | ----------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
25
+ | `number` | ✅ | [syntax-arithmetic.ts](conformance/syntax-arithmetic.ts) | Transpiled to `float64` |
26
+ | `boolean` | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | Transpiled to `bool` |
27
+ | `string` | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | |
28
+ | `null` | ✅ | [syntax-null-undefined.ts](conformance/syntax-null-undefined.ts) | |
29
+ | `undefined` | ✅ | [syntax-null-undefined.ts](conformance/syntax-null-undefined.ts) | |
30
+ | `any` / `unknown` | ✅ | [syntax-selfhost-context.ts](conformance/syntax-selfhost-context.ts) | Dynamic values handled at runtime (JSON-like objects, arrays, primitives) |
31
+ | A variable declared `any` / `unknown` with a primitive initializer (`const x: any = '6'`) | ✅ | [semantics-any-variables.ts](conformance/semantics-any-variables.ts) | Dynamic: `-` `*` `/` use ToNumber, `==` coerces like JS, reassignment to another type works. `any + number` adds numbers (a string operand isn't concatenated), while `+` on two dynamic values decides at run time like JS ([syntax-callback-destructuring.ts](conformance/syntax-callback-destructuring.ts)); objects keep their inferred type |
32
+ | Nullable types (`T \| null`, `T \| undefined`) | ✅ | [syntax-null-undefined.ts](conformance/syntax-null-undefined.ts) | Transpiled to Go pointer types |
33
+ | `bigint` | ✅ | [syntax-bigint.ts](conformance/syntax-bigint.ts) | `2n` literals → `*big.Int`; `**` → `.Exp`, comparisons via `.Cmp` |
34
+ | `bigint` bitwise / shift operators (`&`, `\|`, `^`, `~`, `<<`, `>>`, compound forms) | ✅ | [syntax-bigint-bitwise.ts](conformance/syntax-bigint-bitwise.ts) | `math/big`'s two's-complement `And` / `Or` / `Xor` / `Not`; shifts round toward -Infinity |
35
+ | `BigInt()`, `BigInt.asIntN` / `asUintN` | ✅ | [lib-builtins-statics.ts](conformance/lib-builtins-statics.ts) | Integers, numeric strings and booleans; a fraction throws a `RangeError`, a bad string a `SyntaxError` |
36
+ | bigint–number loose comparisons (`5n == 5`) | ❌ | — | `false` (no cross-type coercion) |
37
+ | `symbol` | ✅ | [syntax-symbols.ts](conformance/syntax-symbols.ts) | `Symbol()` → unique `*TnSymbol` pointers, usable as record keys |
38
+ | `object` type | ✅ | [syntax-object-type.ts](conformance/syntax-object-type.ts) | `object` → `interface{}` |
39
+ | `void` / `never` | ✅ | [syntax-void-never.ts](conformance/syntax-void-never.ts) | No return value in Go |
24
40
 
25
41
  ## Variables & destructuring
26
42
 
27
- | Feature | Status | Probe | Notes |
28
- | --------------------------------------- | :----: | -------------------------------------------------------------------------------- | --------------------------------------------------- |
29
- | Variable declarations (`let` / `const`) | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | |
30
- | Array destructuring | ✅ | [syntax-destructuring.ts](conformance/syntax-destructuring.ts) | Parenthesized initializers; elision and element/property reads |
31
- | Object destructuring | ✅ | [syntax-destructuring.ts](conformance/syntax-destructuring.ts) | Parenthesized initializers; elision and element/property reads; the initializer is evaluated once ([lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts)) |
32
- | Destructuring with defaults | ✅ | [syntax-destructuring-defaults.ts](conformance/syntax-destructuring-defaults.ts) | Missing elements/properties take defaults (nil- and bounds-checked) |
33
- | Destructured parameters | ✅ | [syntax-destructuring-params.ts](conformance/syntax-destructuring-params.ts) | `function f({ a, b }: T)`, `([x, y]: number[])` |
34
- | Object shorthand | ✅ | [syntax-destructuring.ts](conformance/syntax-destructuring.ts) | Parenthesized initializers; elision and element/property reads |
35
- | Object spread | ✅ | [syntax-object-spread.ts](conformance/syntax-object-spread.ts) | Spread sources copied field-by-field into the new struct |
36
- | Array spread | ✅ | [syntax-array-spread.ts](conformance/syntax-array-spread.ts) | `[...arr]`, `fn(...args)` |
37
- | `delete` operator | ✅ | [syntax-delete.ts](conformance/syntax-delete.ts) | `delete o.key` on records |
38
- | Computed keys | ✅ | [syntax-computed-keys.ts](conformance/syntax-computed-keys.ts) | Computed keys become map entries; `o.name` reads lower to `.Get("name")` |
39
- | Records / dictionaries | ✅ | [syntax-in-operator.ts](conformance/syntax-in-operator.ts) | `Record<K, V>` and objects indexed by key → Go maps; so are literals with keys that aren't identifiers (`{ 'Content-Type': … }`, [lib-node-http-server.ts](conformance/lib-node-http-server.ts)) |
40
- | Tuples | ✅ | [syntax-tuples.ts](conformance/syntax-tuples.ts) | `[string, number]` fixed-length arrays |
41
- | Top-level / module-scope variables | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Functions see main-file top-level variables |
42
- | Numeric separators | ✅ | [syntax-numeric-separators.ts](conformance/syntax-numeric-separators.ts) | `1_000_000` |
43
- | Hex / octal / binary literals | ✅ | [syntax-numeric-literals.ts](conformance/syntax-numeric-literals.ts) | `0xFF`, `0o17`, `0b1010`, `1e3` |
44
- | `var` declarations (hoisting) | ✅ | [syntax-var.ts](conformance/syntax-var.ts) | Function- and module-level `var` |
45
- | `using` / `await using` declarations | ✅ | [syntax-using.ts](conformance/syntax-using.ts) | Disposed in reverse order when the block ends (`defer`); `[Symbol.dispose]` methods |
43
+ | Feature | Status | Probe | Notes |
44
+ | ---------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
45
+ | Variable declarations (`let` / `const`) | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | |
46
+ | Array destructuring | ✅ | [syntax-destructuring.ts](conformance/syntax-destructuring.ts) | Parenthesized initializers; elision and element/property reads |
47
+ | Object destructuring | ✅ | [syntax-destructuring.ts](conformance/syntax-destructuring.ts) | Parenthesized initializers; elision and element/property reads; the initializer is evaluated once ([lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts)) |
48
+ | Destructuring with defaults | ✅ | [syntax-destructuring-defaults.ts](conformance/syntax-destructuring-defaults.ts) | Missing elements/properties take defaults (nil- and bounds-checked) |
49
+ | Array destructuring with a rest element (`const [a, ...rest] = arr`) | ✅ | [syntax-destructuring-rest.ts](conformance/syntax-destructuring-rest.ts) | `rest` is a copy of the remaining elements, empty past the end |
50
+ | Array destructuring past the end without a default (`const [a] = []` gives `undefined`) | ❌ | — | The binding gets the element type's zero value (`''`, `0`) instead; give it a default |
51
+ | Destructured parameters | ✅ | [syntax-destructuring-params.ts](conformance/syntax-destructuring-params.ts) | `function f({ a, b }: T)`, `([x, y]: number[])` |
52
+ | Destructured callback parameters (`([k, v]) => …`, `({ a }) => …`), `[...map]`, `map.entries()`, `{ ...record, k: v }` | ✅ | [syntax-callback-destructuring.ts](conformance/syntax-callback-destructuring.ts) | Without annotations, in `map` / `filter` / `some` & co. over tuples, Map pairs and `Object.entries`; elements of mixed tuples are dynamic |
53
+ | Object shorthand | ✅ | [lib-go-container-heap.ts](conformance/lib-go-container-heap.ts) | `{ name, priority }` takes the fields from same-named variables |
54
+ | Object spread | ✅ | [syntax-object-spread.ts](conformance/syntax-object-spread.ts) | Spread sources copied field-by-field into the new struct |
55
+ | Array spread | ✅ | [syntax-array-spread.ts](conformance/syntax-array-spread.ts) | `[...arr]`, `fn(...args)` |
56
+ | `delete` operator | ✅ | [syntax-delete.ts](conformance/syntax-delete.ts) | `delete o.key` on records |
57
+ | Computed keys | ✅ | [syntax-computed-keys.ts](conformance/syntax-computed-keys.ts) | Computed keys become map entries; `o.name` reads lower to `.Get("name")` |
58
+ | Records / dictionaries | ✅ | [syntax-in-operator.ts](conformance/syntax-in-operator.ts) | `Record<K, V>` and objects indexed by key → Go maps; so are literals with keys that aren't identifiers (`{ 'Content-Type': … }`, [lib-node-http-server.ts](conformance/lib-node-http-server.ts)) |
59
+ | Reading a missing key of a `Record` / `Map` of primitives (`rec[k] === undefined`) | ❌ | — | Gives the value type's zero value (`""`, `0`), so the comparison is `false`; test with `k in rec` / `map.has(k)` |
60
+ | Tuples | ✅ | [syntax-tuples.ts](conformance/syntax-tuples.ts) | `[string, number]` fixed-length arrays |
61
+ | Top-level / module-scope variables | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Functions see main-file top-level variables |
62
+ | Names that are Go keywords, builtins or types (`string`, `len`, `range`) as variables, parameters and members | ✅ | [syntax-go-reserved-names.ts](conformance/syntax-go-reserved-names.ts) | Variables and parameters are renamed; members keep their name (keywords get a trailing `_`) |
63
+ | Numeric separators | ✅ | [syntax-numeric-separators.ts](conformance/syntax-numeric-separators.ts) | `1_000_000` |
64
+ | Hex / octal / binary literals | ✅ | [syntax-numeric-literals.ts](conformance/syntax-numeric-literals.ts) | `0xFF`, `0o17`, `0b1010`, `1e3` |
65
+ | `var` declarations (hoisting) | ✅ | [syntax-var.ts](conformance/syntax-var.ts) | Function- and module-level `var` |
66
+ | `using` / `await using` declarations | ✅ | [syntax-using.ts](conformance/syntax-using.ts) | Disposed in reverse order when the block ends (`defer`); `[Symbol.dispose]` methods |
67
+ | Writing past the end of an array (`arr[arr.length + 2] = x`) | ✅ | [semantics-array-growth.ts](conformance/semantics-array-growth.ts) | The array grows; holes read as the zero value (`0`, `""`), not `undefined` |
68
+ | Sparse-array holes | 🚫 | — | Slices have no holes: a hole would read as the zero value, not `undefined` |
69
+ | `let x;` / `let x = undefined` typed from later assignments | ✅ | [syntax-evolving-let.ts](conformance/syntax-evolving-let.ts) | The variable takes the type of the values assigned to it (in a `try`, a loop, a later statement) |
70
+ | `$` in identifiers (`$EOF`, `obs$`, `$implicit`) | ✅ | [syntax-dollar-identifiers.ts](conformance/syntax-dollar-identifiers.ts) | Go names use `ǂ` for `$`; JSON keys keep `$` |
71
+ | `let x;` assigned on every path before it is read | ✅ | [syntax-let-and-narrowing.ts](conformance/syntax-let-and-narrowing.ts) | Holds its value type, not `any`; `.at()` past either end is `undefined`; unary `+` on a string is `Number()` |
46
72
 
47
73
  ## Operators
48
74
 
49
- | Feature | Status | Probe | Notes |
50
- | ---------------------------- | :----: | ---------------------------------------------------------------------------- | --------------------------------------------------- |
51
- | Arithmetic operators | ✅ | [syntax-arithmetic.ts](conformance/syntax-arithmetic.ts) | `+`, `-`, etc.; `%`/`%=` via `math.Mod` |
52
- | Exponent operator | ✅ | [syntax-exponent.ts](conformance/syntax-exponent.ts) | `2 ** 10` |
53
- | Bitwise operators | ✅ | [syntax-bitwise.ts](conformance/syntax-bitwise.ts) | `&`, `\|`, `^`, `<<`, `>>` |
54
- | Unsigned shift | ✅ | [syntax-unsigned-shift.ts](conformance/syntax-unsigned-shift.ts) | `>>>` |
55
- | Comparison operators | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | `==`, `!=`, `===`, `!==`, etc. |
56
- | Logical operators | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | `&&`, `\|\|` |
57
- | Increment / decrement | ✅ | [syntax-increment-expression.ts](conformance/syntax-increment-expression.ts) | `++`, `--`, incl. as expressions |
58
- | Non-null assertion (`!`) | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Stripped during transpilation |
59
- | Ternary expressions | ✅ | [syntax-ternary.ts](conformance/syntax-ternary.ts) | `condition ? a : b` |
60
- | Nullish coalescing | ✅ | [syntax-nullish.ts](conformance/syntax-nullish.ts) | `??` operator, incl. chains |
61
- | Optional chaining | ✅ | [syntax-optional-chaining.ts](conformance/syntax-optional-chaining.ts) | `obj?.prop`, `arr?.[i]`, chains across calls |
62
- | Nullish / logical assignment | ✅ | [syntax-logical-assignment.ts](conformance/syntax-logical-assignment.ts) | `??=`, `\|\|=`, `&&=` |
63
- | `in` operator | ✅ | [syntax-in-operator.ts](conformance/syntax-in-operator.ts) | `"key" in obj` on records |
64
- | `typeof` | ✅ | [syntax-typeof.ts](conformance/syntax-typeof.ts) | `"key" in obj`, `typeof x === "string"` |
65
- | `instanceof` | ✅ | [syntax-instanceof.ts](conformance/syntax-instanceof.ts) | Class instance checks |
66
- | JS truthiness | ✅ | [syntax-optional-params.ts](conformance/syntax-optional-params.ts) | `if (str)`, `!count`, `a \|\| fallback` on any type |
67
- | Loose equality (`==`) | ✅ | [semantics-loose-equality.ts](conformance/semantics-loose-equality.ts) | `bool`/`number`/`string` mixtures coerce like JS (`TnNumber`/`TnParseFloat`) |
68
- | Optional call (`fn?.()`) | ✅ | [syntax-optional-call.ts](conformance/syntax-optional-call.ts) | Nil check on the function value; result is nullable |
69
- | Comma operator | ✅ | [syntax-comma-operator.ts](conformance/syntax-comma-operator.ts) | In `for` headers (`i = 0, j = 10` / `i++, j--`) |
70
- | `void` operator | ✅ | [syntax-void-operator.ts](conformance/syntax-void-operator.ts) | Evaluates, then `nil` |
71
- | `new.target` | ✅ | [syntax-new-target.ts](conformance/syntax-new-target.ts) | Constructors pass the target class name through `super()` chains |
75
+ | Feature | Status | Probe | Notes |
76
+ | ----------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
+ | Arithmetic operators | ✅ | [syntax-arithmetic.ts](conformance/syntax-arithmetic.ts) | `+`, `-`, etc.; `%`/`%=` via `math.Mod` |
78
+ | Exponent operator | ✅ | [syntax-exponent.ts](conformance/syntax-exponent.ts) | `2 ** 10` |
79
+ | Bitwise operators | ✅ | [syntax-bitwise.ts](conformance/syntax-bitwise.ts) | `&`, `\|`, `^`, `<<`, `>>` |
80
+ | Unsigned shift | ✅ | [syntax-unsigned-shift.ts](conformance/syntax-unsigned-shift.ts) | `>>>` |
81
+ | Comparison operators | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | `==`, `!=`, `===`, `!==`, etc. |
82
+ | Logical operators | ✅ | [syntax-variables.ts](conformance/syntax-variables.ts) | `&&`, `\|\|` |
83
+ | Increment / decrement | ✅ | [syntax-increment-expression.ts](conformance/syntax-increment-expression.ts) | `++`, `--`, incl. as expressions |
84
+ | Non-null assertion (`!`) | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Stripped during transpilation |
85
+ | Ternary expressions | ✅ | [syntax-ternary.ts](conformance/syntax-ternary.ts) | `condition ? a : b` |
86
+ | Nullish coalescing | ✅ | [syntax-nullish.ts](conformance/syntax-nullish.ts) | `??` operator, incl. chains |
87
+ | Optional chaining | ✅ | [syntax-optional-chaining.ts](conformance/syntax-optional-chaining.ts) | `obj?.prop`, `arr?.[i]`, chains across calls |
88
+ | Nullish / logical assignment | ✅ | [syntax-logical-assignment.ts](conformance/syntax-logical-assignment.ts) | `??=`, `\|\|=`, `&&=` |
89
+ | `in` operator | ✅ | [syntax-in-operator.ts](conformance/syntax-in-operator.ts) | `"key" in obj` on records |
90
+ | `typeof` | ✅ | [syntax-typeof.ts](conformance/syntax-typeof.ts) | `typeof x === "string"`; `"function"` for function values |
91
+ | `instanceof` | ✅ | [syntax-instanceof.ts](conformance/syntax-instanceof.ts) | User classes, `Error` classes and Node globals (`URL`, `Uint8Array`, …) |
92
+ | JS truthiness | ✅ | [syntax-optional-params.ts](conformance/syntax-optional-params.ts) | `if (str)`, `!count`, `a \|\| fallback` on any type |
93
+ | Loose equality (`==`) | ✅ | [semantics-loose-equality.ts](conformance/semantics-loose-equality.ts), [semantics-any-variables.ts](conformance/semantics-any-variables.ts) | `bool`/`number`/`string` mixtures coerce like JS (`TnNumber`/`TnParseFloat`), also between `any` values (`TnLooseEqual`) |
94
+ | Optional call (`fn?.()`) | ✅ | [syntax-optional-call.ts](conformance/syntax-optional-call.ts) | Nil check on the function value; result is nullable |
95
+ | Comma operator | ✅ | [syntax-comma-operator.ts](conformance/syntax-comma-operator.ts) | In `for` headers (`i = 0, j = 10` / `i++, j--`) |
96
+ | `void` operator | ✅ | [syntax-void-operator.ts](conformance/syntax-void-operator.ts) | Evaluates, then `nil` |
97
+ | `new.target` | ✅ | [syntax-new-target.ts](conformance/syntax-new-target.ts) | Constructors pass the target class name through `super()` chains |
98
+ | `instanceof Map` / `Set` / `Date` / `Array`, subclass instances | ✅ | [syntax-instanceof-builtins.ts](conformance/syntax-instanceof-builtins.ts) | Maps and Sets made by `new Map()` / `new Set()` are tagged (records are not Maps); arrays exclude Buffers; `instanceof Parent` holds for subclass instances |
99
+ | `#x in obj` (private brand checks) | ✅ | [syntax-instanceof-builtins.ts](conformance/syntax-instanceof-builtins.ts) | An instance of the class declaring `#x`, or of a subclass |
100
+ | Optional calls on `any` values (`o?.m()`, `a?.b.c?.get(k)`) | ✅ | [syntax-optional-call-any.ts](conformance/syntax-optional-call-any.ts) | Nothing is called when the receiver is nullish; the result can initialize a typed variable |
101
+ | `x?.m()` on an `any` value when `m` has a known primitive result (`s?.toUpperCase()`) | ❌ | — | A nullish `x` gives the type's zero value (`''`, `0`) instead of `undefined`, so `?? fallback` does not apply |
102
+ | Assignment as an expression (`while ((m = re.exec(s)))`, `a = b = c`, `x = (o[k] ??= v)`) | ✅ | [syntax-assignment-expressions.ts](conformance/syntax-assignment-expressions.ts) | Assigns, then reads the target back; `??=` on a map element tests for a missing key |
72
103
 
73
104
  ## Control flow
74
105
 
75
- | Feature | Status | Probe | Notes |
76
- | ----------------------------------- | :----: | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
77
- | If / else statements | ✅ | [syntax-if-switch.ts](conformance/syntax-if-switch.ts) | Incl. unbraced bodies and else-if chains |
78
- | Switch statements | ✅ | [syntax-switch.ts](conformance/syntax-switch.ts) | Case and default statements |
79
- | Switch fallthrough | ✅ | [syntax-switch-fallthrough.ts](conformance/syntax-switch-fallthrough.ts) | Explicit fallthrough between cases |
80
- | `for` loops | ✅ | [syntax-loops.ts](conformance/syntax-loops.ts) | Standard `for` loops, incl. unbraced bodies |
81
- | `continue` | ✅ | [syntax-loops.ts](conformance/syntax-loops.ts) | `continue` in all loop kinds |
82
- | `break` | ✅ | [syntax-if-switch.ts](conformance/syntax-if-switch.ts), [syntax-do-while.ts](conformance/syntax-do-while.ts) | In switch cases and loops |
83
- | `for...of` loops | ✅ | [syntax-loops.ts](conformance/syntax-loops.ts), [syntax-for-of-string.ts](conformance/syntax-for-of-string.ts) | Arrays, Maps, Sets, strings, tuples; `Object.entries()` unwrapping |
84
- | `for...in` loops | ✅ | [syntax-for-in.ts](conformance/syntax-for-in.ts) | Key range over records/maps |
85
- | `for await...of` | ✅ | [syntax-for-await.ts](conformance/syntax-for-await.ts) | Ranges over the async generator's channel |
86
- | `while` loops | ✅ | [syntax-loops.ts](conformance/syntax-loops.ts) | Transpiled to Go's `for` loops; assignment in condition |
87
- | `do...while` loops | ✅ | [syntax-do-while.ts](conformance/syntax-do-while.ts) | Implemented with conditional break |
88
- | Labeled loops | ✅ | [syntax-labeled-loops.ts](conformance/syntax-labeled-loops.ts) | `LabeledStatement` → Go labels; labeled `continue`/`break` |
89
- | `try` / `catch` / `finally` | ✅ | [syntax-try-catch-finally.ts](conformance/syntax-try-catch-finally.ts) | `throw` → `panic`; catch/finally via `defer`/`recover` |
90
- | Optional catch binding (`catch {}`) | ✅ | [syntax-try-catch-finally.ts](conformance/syntax-try-catch-finally.ts) | |
91
- | Custom error classes | ✅ | [syntax-custom-errors.ts](conformance/syntax-custom-errors.ts) | `extends Error` → embedded `TnError`; constructors take the message |
92
- | `Error.message` | ✅ | [syntax-error-message.ts](conformance/syntax-error-message.ts) | `throw new Error` panics with a `*TnError`; `.message` on caught values |
93
- | `Error` `cause` (`new Error(message, { cause })`, `err.cause`) | ✅ | [lib-node-fetch-bad-port.ts](conformance/lib-node-fetch-bad-port.ts) | Built-in error classes too |
94
- | Narrowing | ✅ | [syntax-typeof.ts](conformance/syntax-typeof.ts) | `T \| undefined` narrowed after `if (x)`, `x !== undefined`, early returns |
106
+ | Feature | Status | Probe | Notes |
107
+ | -------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
108
+ | If / else statements | ✅ | [syntax-if-switch.ts](conformance/syntax-if-switch.ts) | Incl. unbraced bodies and else-if chains |
109
+ | Switch statements | ✅ | [syntax-switch.ts](conformance/syntax-switch.ts) | Case and default statements |
110
+ | Switch fallthrough | ✅ | [syntax-switch-fallthrough.ts](conformance/syntax-switch-fallthrough.ts) | Explicit fallthrough between cases |
111
+ | `for` loops | ✅ | [syntax-loops.ts](conformance/syntax-loops.ts) | Standard `for` loops, incl. unbraced bodies |
112
+ | `continue` | ✅ | [syntax-loops.ts](conformance/syntax-loops.ts) | `continue` in all loop kinds |
113
+ | `break` | ✅ | [syntax-if-switch.ts](conformance/syntax-if-switch.ts), [syntax-do-while.ts](conformance/syntax-do-while.ts) | In switch cases and loops |
114
+ | `for...of` loops | ✅ | [syntax-loops.ts](conformance/syntax-loops.ts), [syntax-for-of-string.ts](conformance/syntax-for-of-string.ts) | Arrays, Maps, Sets, strings, tuples; `Object.entries()` unwrapping |
115
+ | `for...in` loops | ✅ | [syntax-for-in.ts](conformance/syntax-for-in.ts) | Key range over records/maps |
116
+ | `for await...of` | ✅ | [syntax-for-await.ts](conformance/syntax-for-await.ts) | Ranges over the async generator's channel |
117
+ | `while` loops | ✅ | [syntax-loops.ts](conformance/syntax-loops.ts) | Transpiled to Go's `for` loops; assignment in condition |
118
+ | `do...while` loops | ✅ | [syntax-do-while.ts](conformance/syntax-do-while.ts) | Implemented with conditional break |
119
+ | Labeled loops | ✅ | [syntax-labeled-loops.ts](conformance/syntax-labeled-loops.ts) | `LabeledStatement` → Go labels; labeled `continue`/`break` |
120
+ | `try` / `catch` / `finally` | ✅ | [syntax-try-catch-finally.ts](conformance/syntax-try-catch-finally.ts) | `throw` → `panic`; catch/finally via `defer`/`recover` |
121
+ | Optional catch binding (`catch {}`) | ✅ | [syntax-try-catch-finally.ts](conformance/syntax-try-catch-finally.ts) | |
122
+ | Custom error classes | ✅ | [syntax-custom-errors.ts](conformance/syntax-custom-errors.ts) | `extends Error` → embedded `TnError`; constructors take the message |
123
+ | `Error.message` | ✅ | [syntax-error-message.ts](conformance/syntax-error-message.ts) | `throw new Error` panics with a `*TnError`; `.message` on caught values |
124
+ | `Error` `cause` (`new Error(message, { cause })`, `err.cause`) | ✅ | [lib-node-fetch-bad-port.ts](conformance/lib-node-fetch-bad-port.ts) | Built-in error classes too |
125
+ | Narrowing | ✅ | [syntax-typeof.ts](conformance/syntax-typeof.ts) | `T \| undefined` narrowed after `if (x)`, `x !== undefined`, early returns |
126
+ | Exhaustive `switch` without `default`; statements after a `switch` | ✅ | [syntax-switch-exhaustive.ts](conformance/syntax-switch-exhaustive.ts) | A function that can end without a `return` returns its result type's zero value (JS: `undefined`) |
127
+ | Labeled blocks and statements (`label: { … break label; }`) | ✅ | [syntax-labeled-blocks.ts](conformance/syntax-labeled-blocks.ts) | `break label` jumps past the statement (`goto`) |
128
+ | Throwing non-`Error` values (`throw 'x'`, `throw { code: 1 }`) | ✅ | — | Caught as `interface{}`; properties read dynamically |
129
+ | `debugger` | ✅ | — | Erased |
130
+ | `with` | 🚫 | — | Not allowed in strict mode (modules are strict) |
131
+ | Assignments and compound assignments as values, comma expressions, `for (let x; …)` headers, several updates per iteration | ✅ | [syntax-loop-lowerings.ts](conformance/syntax-loop-lowerings.ts) | `(ch = s[i += 1])` in a condition, `a = b = 7`, `(k++, k * 10)`; Go-only statements are lowered to closures |
132
+ | `continue` in `do…while`; `default` falling through to later cases; labeled `break` out of a `switch` | ✅ | [syntax-loop-lowerings.ts](conformance/syntax-loop-lowerings.ts) | `continue` re-tests the condition |
133
+ | `for…of` whose body never reads its variable (`for (const x of xs) n++`) | ✅ | [lib-string-split-trim.ts](conformance/lib-string-split-trim.ts) | |
95
134
 
96
135
  ## Functions
97
136
 
98
- | Feature | Status | Probe | Notes |
99
- | --------------------------------------------- | :----: | ---------------------------------------------------------------------------- | --------------------------------------------------------------------- |
100
- | Function declarations | ✅ | [syntax-functions.ts](conformance/syntax-functions.ts) | Transpiled to Go functions |
101
- | Arrow functions | ✅ | [syntax-arrow-functions.ts](conformance/syntax-arrow-functions.ts) | Transpiled to anonymous functions |
102
- | IIFEs | ✅ | [syntax-iife.ts](conformance/syntax-iife.ts) | `(() => { ... })()` and `(function name() { ... })()` |
103
- | Closures over mutable state | ✅ | [syntax-closures.ts](conformance/syntax-closures.ts) | Functions capturing and mutating outer variables; per-iteration `let` |
104
- | Function types | ✅ | [syntax-closures.ts](conformance/syntax-closures.ts) | `() => number`, `(x: number) => string` as type annotations |
105
- | Default parameter values | ✅ | [syntax-default-params.ts](conformance/syntax-default-params.ts) | `function(x = defaultValue)`, incl. constructors, methods, arrows |
106
- | Rest parameters | ✅ | [syntax-rest-params.ts](conformance/syntax-rest-params.ts) | `function(...args: T[])` → Go variadic |
107
- | Spread in calls | ✅ | [syntax-spread-call.ts](conformance/syntax-spread-call.ts) | `f(...args)` incl. tuples |
108
- | Optional parameters | ✅ | [syntax-optional-params.ts](conformance/syntax-optional-params.ts) | `function f(x?: string)` |
109
- | Destructured parameters | ✅ | [syntax-destructuring-params.ts](conformance/syntax-destructuring-params.ts) | `function f({ a, b }: T)`, `([x, y]: number[])` |
110
- | Contextual object-literal arguments | ✅ | [syntax-contextual-arguments.ts](conformance/syntax-contextual-arguments.ts) | Struct type inferred from parameter / return type |
111
- | Recursion | ✅ | [syntax-recursion.ts](conformance/syntax-recursion.ts) | Direct self-recursion |
112
- | Recursive arrow functions | ✅ | [syntax-recursive-arrow.ts](conformance/syntax-recursive-arrow.ts) | `const f = () => … f() …` → declared, then assigned |
113
- | Generators (`function*` / `yield` / `yield*`) | ✅ | [syntax-generators.ts](conformance/syntax-generators.ts) | `function*` runs in a goroutine sending yields over a channel; `for...of` ranges it |
114
- | Async generators (`async function*`) | ✅ | [syntax-async-generators.ts](conformance/syntax-async-generators.ts) | Goroutine + channel, consumed with `for await` |
115
- | Custom iterators (`Symbol.iterator`) | ✅ | [syntax-custom-iterators.ts](conformance/syntax-custom-iterators.ts) | `*[Symbol.iterator]()` → a `Symbol_iterator()` channel method |
116
- | `as const` assertions | ✅ | [syntax-as-const.ts](conformance/syntax-as-const.ts) | Erased during transpilation |
117
- | Function overloads | ✅ | [syntax-function-overloads.ts](conformance/syntax-function-overloads.ts) | Signatures are erased; the implementation is emitted |
118
- | `this` parameter (`function f(this: T)`) | ✅ | [syntax-this-parameter.ts](conformance/syntax-this-parameter.ts) | Erased |
119
- | `arguments` object | ✅ | [syntax-arguments.ts](conformance/syntax-arguments.ts) | Functions reading it take extra arguments variadically (`[]interface{}`) |
137
+ | Feature | Status | Probe | Notes |
138
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
139
+ | Function declarations | ✅ | [syntax-functions.ts](conformance/syntax-functions.ts) | Transpiled to Go functions |
140
+ | Arrow functions | ✅ | [syntax-arrow-functions.ts](conformance/syntax-arrow-functions.ts) | Transpiled to anonymous functions |
141
+ | IIFEs | ✅ | [syntax-iife.ts](conformance/syntax-iife.ts) | `(() => { ... })()` and `(function name() { ... })()` |
142
+ | Closures over mutable state | ✅ | [syntax-closures.ts](conformance/syntax-closures.ts) | Functions capturing and mutating outer variables; per-iteration `let` |
143
+ | Function types | ✅ | [syntax-closures.ts](conformance/syntax-closures.ts) | `() => number`, `(x: number) => string` as type annotations |
144
+ | Default parameter values | ✅ | [syntax-default-params.ts](conformance/syntax-default-params.ts) | `function(x = defaultValue)`, incl. constructors, methods, arrows |
145
+ | Rest parameters | ✅ | [syntax-rest-params.ts](conformance/syntax-rest-params.ts) | `function(...args: T[])` → Go variadic |
146
+ | Spread in calls | ✅ | [syntax-spread-call.ts](conformance/syntax-spread-call.ts) | `f(...args)` incl. tuples |
147
+ | Optional parameters | ✅ | [syntax-optional-params.ts](conformance/syntax-optional-params.ts) | `function f(x?: string)` |
148
+ | Destructured parameters | ✅ | [syntax-destructuring-params.ts](conformance/syntax-destructuring-params.ts) | `function f({ a, b }: T)`, `([x, y]: number[])` |
149
+ | Contextual object-literal arguments | ✅ | [syntax-contextual-arguments.ts](conformance/syntax-contextual-arguments.ts) | Struct type inferred from parameter / return type |
150
+ | Recursion | ✅ | [syntax-recursion.ts](conformance/syntax-recursion.ts) | Direct self-recursion |
151
+ | Recursive arrow functions | ✅ | [syntax-recursive-arrow.ts](conformance/syntax-recursive-arrow.ts) | `const f = () => … f() …` → declared, then assigned |
152
+ | Generators (`function*` / `yield` / `yield*`) | ✅ | [syntax-generators.ts](conformance/syntax-generators.ts) | `function*` runs in a goroutine sending yields over a channel; `for...of` ranges it |
153
+ | Async generators (`async function*`) | ✅ | [syntax-async-generators.ts](conformance/syntax-async-generators.ts) | Goroutine + channel, consumed with `for await` |
154
+ | Custom iterators (`Symbol.iterator`) | ✅ | [syntax-custom-iterators.ts](conformance/syntax-custom-iterators.ts) | `*[Symbol.iterator]()` → a `Symbol_iterator()` channel method |
155
+ | `as const` assertions | ✅ | [syntax-as-const.ts](conformance/syntax-as-const.ts) | Erased during transpilation |
156
+ | Function overloads | ✅ | [syntax-function-overloads.ts](conformance/syntax-function-overloads.ts) | Signatures are erased; the implementation is emitted |
157
+ | `this` parameter (`function f(this: T)`) | ✅ | [syntax-this-parameter.ts](conformance/syntax-this-parameter.ts) | Erased |
158
+ | `arguments` object | ✅ | [syntax-arguments.ts](conformance/syntax-arguments.ts) | Functions reading it take extra arguments variadically (`[]interface{}`) |
159
+ | Top-level `await` | ✅ | — | In modules (files with an `import` / `export`) |
160
+ | Generator `next()` | ✅ | [lib-iterator-helpers.ts](conformance/lib-iterator-helpers.ts) | `{ value, done }` |
161
+ | Generator `next(value)` (sending a value in) / `return()` / `throw()` | ❌ | — | Generators are goroutines feeding a channel: values only flow out |
162
+ | `fn.call` / `fn.apply` / `fn.bind` | ✅ | [syntax-function-values.ts](conformance/syntax-function-values.ts) | Function declarations and function values; `apply` spreads the array over the parameters; `thisArg` is ignored (methods taken from an object are already bound in Go) |
163
+ | `fn.name` / `fn.length` | ✅ | [syntax-function-values.ts](conformance/syntax-function-values.ts) | Known at compile time for declared functions, classes and function variables |
164
+ | `eval` / `new Function(…)` | 🚫 | — | Compile and run JavaScript at runtime: needs a JavaScript engine |
165
+ | Properties on functions (`fn.prop = v`), call-signature types with properties | ✅ | [syntax-function-properties.ts](conformance/syntax-function-properties.ts) | Each property is a package variable `fn__prop`; reassigning it works |
166
+ | `arguments` with optional parameters left out | ✅ | [syntax-arguments-object.ts](conformance/syntax-arguments-object.ts) | Omitted trailing optionals are not counted; `arguments[i]` is the value (not a pointer) |
167
+ | An optional array parameter passed on to a defaulted parameter (a call or `super(…)`) | ✅ | [syntax-optional-array-params.ts](conformance/syntax-optional-array-params.ts) | Left out, the callee gets its default; `xs ?? []` on an absent array gives the fallback |
168
+ | Function declarations inside functions and blocks | ✅ | [syntax-nested-functions.ts](conformance/syntax-nested-functions.ts) | Hoisted (callable before the declaration, mutually recursive), `async` and generator ones included |
169
+ | Function values: a static method in a variable, static and instance methods of one name, a variadic function expression where fixed parameters are expected, a `.catch` handler, an async IIFE, method identity | ✅ | [syntax-function-values-more.ts](conformance/syntax-function-values-more.ts) | `a.m === A.prototype.m` compares the methods |
170
+ | `f.apply(thisArg, args)` / `f.call` on a function held as `any` or under another name (`const f: any = fn`) | ✅ | [syntax-nullable-primitive-fields.ts](conformance/syntax-nullable-primitive-fields.ts) | `thisArg` is dropped |
171
+ | Functions with array parameters stored where a function type is expected (`Record<string, (xs: any[]) => R>`): declared functions, arrows, function expressions | ✅ | [syntax-function-values-more.ts](conformance/syntax-function-values-more.ts) | A function type's arrays are plain slices: a declared function is adapted |
172
+ | An array passed through a function-typed value (a callback slot) is shared with the callee | ❌ | — | The callee gets a copy: its `push` doesn't reach the caller's array (a direct call shares it) |
173
+ | A string method on an `any` value whose name an object literal's function also has (`spec.startsWith('.')`) | ✅ | [syntax-function-values-more.ts](conformance/syntax-function-values-more.ts) | A string runs the string method, any other value its own function |
120
174
 
121
175
  ## Classes & interfaces
122
176
 
123
- | Feature | Status | Probe | Notes |
124
- | ---------------------------------------------------------------- | :----: | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
125
- | Classes | ✅ | [syntax-class.ts](conformance/syntax-class.ts) | Transpiled to Go structs with constructor and receiver methods |
126
- | Constructor parameter properties | ✅ | [syntax-class-parameter-properties.ts](conformance/syntax-class-parameter-properties.ts) | `constructor(private x: number)` |
127
- | Class inheritance | ✅ | [syntax-class-inheritance.ts](conformance/syntax-class-inheritance.ts) | `super.method()` → `self.Parent.method()`; inherited methods copied for `this` dispatch |
128
- | `implements` clauses | ✅ | [syntax-class-implements.ts](conformance/syntax-class-implements.ts) | `class C implements I` |
129
- | Interface `extends` | ✅ | [syntax-interface-extends.ts](conformance/syntax-interface-extends.ts) | Inherited properties flattened into the derived struct |
130
- | Static members | ✅ | [syntax-class-static.ts](conformance/syntax-class-static.ts) | Static members → package-level `Class_member` vars/functions |
131
- | Getters / setters (classes) | ✅ | [syntax-class-getters.ts](conformance/syntax-class-getters.ts) | `c.v` reads/writes rewrite to `Get_v()`/`Set_v()` accessor calls |
132
- | Getters (object literals) | ✅ | [syntax-object-getters.ts](conformance/syntax-object-getters.ts) | Getter closures stored as function fields; reads invoke them |
133
- | Object-literal methods | ✅ | [syntax-object-methods.ts](conformance/syntax-object-methods.ts) | Method closures stored as function fields capturing the instance (`this` → the object) |
134
- | Private `#` fields | ✅ | [syntax-class-private-fields.ts](conformance/syntax-class-private-fields.ts) | `#secret` → a plain (name-mangled) struct field |
135
- | Access modifiers (`private` / `protected` / `public` on members) | ✅ | [syntax-access-modifiers.ts](conformance/syntax-access-modifiers.ts) | `private` / `protected` / `public` are erased |
136
- | Abstract classes | ✅ | [syntax-class-abstract.ts](conformance/syntax-class-abstract.ts) | Abstract members skipped; concrete methods copied onto subclasses |
137
- | Static initialization blocks (`static {}`) | ✅ | [syntax-static-blocks.ts](conformance/syntax-static-blocks.ts) | Go `func init()` |
138
- | Class expressions (`const C = class {}`) | ✅ | [syntax-class-expressions.ts](conformance/syntax-class-expressions.ts) | `const C = class {…}` becomes a class named after the variable |
139
- | Interfaces | ✅ | [syntax-class-implements.ts](conformance/syntax-class-implements.ts) | Transpiled to Go interfaces |
140
- | Optional properties | ✅ | [syntax-optional-chaining.ts](conformance/syntax-optional-chaining.ts) | `prop?: Type` in interfaces/types |
141
- | Type-aware method dispatch | ✅ | [semantics-method-dispatch.ts](conformance/semantics-method-dispatch.ts) | Class `.push()` / `.length` not confused with array builtins |
142
- | Index signatures (`[key: string]: T`) | ✅ | [syntax-index-signatures.ts](conformance/syntax-index-signatures.ts) | `{ [k: K]: V }` is `Record<K, V>` (an ordered Go map) |
177
+ | Feature | Status | Probe | Notes |
178
+ | ---------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
179
+ | Classes | ✅ | [syntax-class.ts](conformance/syntax-class.ts) | Transpiled to Go structs with constructor and receiver methods |
180
+ | Constructor parameter properties | ✅ | [syntax-class-parameter-properties.ts](conformance/syntax-class-parameter-properties.ts) | `constructor(private x: number)` |
181
+ | Class inheritance | ✅ | [syntax-class-inheritance.ts](conformance/syntax-class-inheritance.ts) | `super.method()` → `self.Parent.method()`; inherited methods copied for `this` dispatch |
182
+ | `implements` clauses | ✅ | [syntax-class-implements.ts](conformance/syntax-class-implements.ts) | `class C implements I` |
183
+ | Interface `extends` | ✅ | [syntax-interface-extends.ts](conformance/syntax-interface-extends.ts) | Inherited properties flattened into the derived struct |
184
+ | Static members | ✅ | [syntax-class-static.ts](conformance/syntax-class-static.ts) | Static members → package-level `Class_member` vars/functions |
185
+ | Getters / setters (classes) | ✅ | [syntax-class-getters.ts](conformance/syntax-class-getters.ts) | `c.v` reads/writes rewrite to `Get_v()`/`Set_v()` accessor calls |
186
+ | Getters (object literals) | ✅ | [syntax-object-getters.ts](conformance/syntax-object-getters.ts) | Getter closures stored as function fields; reads invoke them |
187
+ | Object-literal methods | ✅ | [syntax-object-methods.ts](conformance/syntax-object-methods.ts) | Method closures stored as function fields capturing the instance (`this` → the object) |
188
+ | Private `#` fields | ✅ | [syntax-class-private-fields.ts](conformance/syntax-class-private-fields.ts) | `#secret` → a `__secret` struct field, left out of `JSON.stringify` and `console.log` |
189
+ | Access modifiers (`private` / `protected` / `public` on members) | ✅ | [syntax-access-modifiers.ts](conformance/syntax-access-modifiers.ts) | `private` / `protected` / `public` are erased |
190
+ | Abstract classes | ✅ | [syntax-class-abstract.ts](conformance/syntax-class-abstract.ts) | Abstract members skipped; concrete methods copied onto subclasses |
191
+ | Static initialization blocks (`static {}`) | ✅ | [syntax-static-blocks.ts](conformance/syntax-static-blocks.ts) | Go `func init()` |
192
+ | Class expressions (`const C = class {}`) | ✅ | [syntax-class-expressions.ts](conformance/syntax-class-expressions.ts) | `const C = class {…}` becomes a class named after the variable |
193
+ | Interfaces | ✅ | [syntax-class-implements.ts](conformance/syntax-class-implements.ts) | Transpiled to Go interfaces |
194
+ | Optional properties | ✅ | [syntax-optional-chaining.ts](conformance/syntax-optional-chaining.ts) | `prop?: Type` in interfaces/types |
195
+ | Type-aware method dispatch | ✅ | [semantics-method-dispatch.ts](conformance/semantics-method-dispatch.ts) | Class `.push()` / `.length` not confused with array builtins |
196
+ | Index signatures (`[key: string]: T`) | ✅ | [syntax-index-signatures.ts](conformance/syntax-index-signatures.ts) | `{ [k: K]: V }` is `Record<K, V>` (an ordered Go map) |
197
+ | Methods without a return-type annotation | ✅ | [syntax-method-return-inference.ts](conformance/syntax-method-return-inference.ts) | Inferred from the returns, as for functions (also returns nested in `if` / loops / `switch` / `try`); an inherited `return this` returns the subclass |
198
+ | Field initializers reading parameter properties or parent fields | ✅ | [syntax-class-field-order.ts](conformance/syntax-class-field-order.ts) | `super()`, then parameter properties, then field initializers, then the constructor body (TS's ES2020 order) |
199
+ | Arrow-function fields (`h = () => this.x`), fields reading earlier fields | ✅ | — | Run in the constructor; `this` is the instance |
200
+ | Private methods (`#m()`) | ✅ | [syntax-method-return-inference.ts](conformance/syntax-method-return-inference.ts) | |
201
+ | A private and a public member with the same name (`#x` and `x`) | ✅ | [syntax-private-public-names.ts](conformance/syntax-private-public-names.ts) | `#x` is the Go field `__x` |
202
+ | Private accessors (`get #x()`) / static private fields (`static #x`) | ✅ | [syntax-class-accessor-inheritance.ts](conformance/syntax-class-accessor-inheritance.ts), [syntax-class-static-inheritance.ts](conformance/syntax-class-static-inheritance.ts) | |
203
+ | `accessor` fields | ✅ | — | Plain fields (decorating them is not supported) |
204
+ | Static inheritance (`Child.staticOfParent()`) | ✅ | [syntax-class-static-inheritance.ts](conformance/syntax-class-static-inheritance.ts) | Resolved to the declaring class's `Parent_member` at compile time |
205
+ | Inherited getters / setters, `super.x` on accessors | ✅ | [syntax-class-accessor-inheritance.ts](conformance/syntax-class-accessor-inheritance.ts) | Accessors are copied onto subclasses like methods |
206
+ | Object-literal setters (`set x(v) {}`) | ✅ | [syntax-object-setters.ts](conformance/syntax-object-setters.ts) | A `Set_x` closure field: `o.x = v` calls it |
207
+ | Mixins (class factories, `return class extends Base {}`, `class extends f()`) | ❌ | — | `Unsupported syntax: ClassExpression` outside `const C = class {}` |
208
+ | Polymorphic `this` return types (fluent chains) | ✅ | [syntax-polymorphic-this.ts](conformance/syntax-polymorphic-this.ts) | `this` is the class; methods inherited by a subclass return the subclass |
209
+ | Dynamic keys on class instances and typed objects (`inst[key]`) | ✅ | [syntax-instance-keys.ts](conformance/syntax-instance-keys.ts) | A `switch` over the declared fields and getters (reads and writes); through `any`, reflection |
210
+ | Declaration merging (interface + interface, enum + enum, class + interface) | ✅ | [syntax-declaration-merging.ts](conformance/syntax-declaration-merging.ts) | Merged within one scope; an interface adds its properties to a same-named class as fields; namespace + function merging works too |
211
+ | Prototype mutation (`C.prototype.m = …`, `Object.setPrototypeOf`, `util.inherits`) | 🚫 | — | Classes are static Go structs with fixed method sets |
212
+ | Overrides dispatched on the runtime class (through a base-class type, `any` values, a base method calling an override) | ✅ | [syntax-class-polymorphism.ts](conformance/syntax-class-polymorphism.ts) | Polymorphic classes are held as `interface{}`; calls go through a per-method dispatch |
213
+ | `class C extends Array` | ✅ | [syntax-array-subclass.ts](conformance/syntax-array-subclass.ts) | The elements live in an embedded `TnArray`: indexing, `length`, `push`, iteration, spread, `Array.isArray` |
214
+ | Classes as values (chosen at run time, passed as `new (…) => T`, stored in records), `x.constructor` | ✅ | [syntax-class-values.ts](conformance/syntax-class-values.ts) | `new ctor(…)` works on class values and constructor functions alike |
215
+ | Interfaces mixing data fields and methods, implemented by object literals | ✅ | [syntax-interface-method-fields.ts](conformance/syntax-interface-method-fields.ts) | Method shorthand and arrow properties are contextually typed; optional function fields may be absent |
216
+ | `class E extends Error` setting `this.name` | ✅ | [lib-error-subclass-inspect.ts](conformance/lib-error-subclass-inspect.ts) | The subclass gets a `name` field; `util.inspect` prints `E: message` then its own properties |
217
+ | `Object.setPrototypeOf(this, new.target.prototype)` in an `Error` subclass | ✅ | [syntax-error-subclass-idiom.ts](conformance/syntax-error-subclass-idiom.ts) | The ES5-era idiom is dropped (classes are already their own type); other `setPrototypeOf` calls are errors |
143
218
 
144
219
  ## Generics
145
220
 
146
- | Feature | Status | Probe | Notes |
147
- | ------------------------------------------------------------- | :----: | ---------------------------------------------------------------------- | ---------------------------------- |
148
- | Generic functions | ✅ | [syntax-generic-functions.ts](conformance/syntax-generic-functions.ts) | Type parameters → Go generics; call sites infer from arguments |
149
- | Generic classes | ✅ | [syntax-generic-classes.ts](conformance/syntax-generic-classes.ts) | Type parameters via Go generics |
150
- | Generic constraints (`<T extends U>`) | ✅ | [syntax-generic-constraints.ts](conformance/syntax-generic-constraints.ts) | Object-type bounds become `any`; properties of `T` values read dynamically |
151
- | Default type parameters (`<T = D>`) | ✅ | [syntax-generic-defaults.ts](conformance/syntax-generic-defaults.ts) | Defaults are erased; Go infers from arguments |
152
- | Generic interfaces / type aliases | ✅ | [syntax-generic-interfaces.ts](conformance/syntax-generic-interfaces.ts) | Go generic structs; literals instantiate them (`Box[float64]{…}`) |
153
- | `const` type parameters / variance annotations (`in` / `out`) | ✅ | [syntax-const-type-parameters.ts](conformance/syntax-const-type-parameters.ts) | Erased; object literals of method interfaces use an adapter struct |
221
+ | Feature | Status | Probe | Notes |
222
+ | ------------------------------------------------------------------------------------------ | :----: | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
223
+ | Generic functions | ✅ | [syntax-generic-functions.ts](conformance/syntax-generic-functions.ts) | Type parameters → Go generics; call sites infer from arguments |
224
+ | Generic classes | ✅ | [syntax-generic-classes.ts](conformance/syntax-generic-classes.ts) | Type parameters via Go generics |
225
+ | Generic constraints (`<T extends U>`) | ✅ | [syntax-generic-constraints.ts](conformance/syntax-generic-constraints.ts) | Object-type bounds become `any`; properties of `T` values read dynamically |
226
+ | Default type parameters (`<T = D>`) | ✅ | [syntax-generic-defaults.ts](conformance/syntax-generic-defaults.ts) | Defaults are erased; Go infers from arguments |
227
+ | Generic interfaces / type aliases | ✅ | [syntax-generic-interfaces.ts](conformance/syntax-generic-interfaces.ts) | Go generic structs; literals instantiate them (`Box[float64]{…}`) |
228
+ | `const` type parameters / variance annotations (`in` / `out`) | ✅ | [syntax-const-type-parameters.ts](conformance/syntax-const-type-parameters.ts) | Erased; object literals of method interfaces use an adapter struct |
229
+ | Instantiation expressions (`const f = g<number>`), explicit type arguments in call results | ✅ | [syntax-instantiation-expressions.ts](conformance/syntax-instantiation-expressions.ts) | `g<number>` is the Go instantiation `g[float64]` |
230
+ | Generic type aliases (`type WithId<T> = T & { id: number }`) | ✅ | [syntax-intersection-generic.ts](conformance/syntax-intersection-generic.ts) | The alias is instantiated with its type arguments |
154
231
 
155
232
  ## Enums
156
233
 
157
- | Feature | Status | Probe | Notes |
158
- | ------------------------------------- | :----: | ------------------------------------------------------------ | -------------------------------------------- |
159
- | Numeric enums | ✅ | [syntax-enum-numeric.ts](conformance/syntax-enum-numeric.ts) | Numeric members are `float64` constants; string enums keep a named type |
160
- | String enums | ✅ | [syntax-enum-string.ts](conformance/syntax-enum-string.ts) | `enum` declarations and member access |
161
- | `const enum` | ✅ | [syntax-const-enum.ts](conformance/syntax-const-enum.ts) | Compiled like a regular enum |
162
- | Computed / heterogeneous enum members | ✅ | [syntax-enum-computed.ts](conformance/syntax-enum-computed.ts) | Computed members assigned in source order; mixed enums keep each member's type |
234
+ | Feature | Status | Probe | Notes |
235
+ | ---------------------------------------------- | :----: | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
236
+ | Numeric enums | ✅ | [syntax-enum-numeric.ts](conformance/syntax-enum-numeric.ts) | Numeric members are `float64` constants; string enums keep a named type |
237
+ | String enums | ✅ | [syntax-enum-string.ts](conformance/syntax-enum-string.ts) | `enum` declarations and member access |
238
+ | `const enum` | ✅ | [syntax-const-enum.ts](conformance/syntax-const-enum.ts) | Compiled like a regular enum |
239
+ | Computed / heterogeneous enum members | ✅ | [syntax-enum-computed.ts](conformance/syntax-enum-computed.ts) | Computed members assigned in source order; mixed enums keep each member's type |
240
+ | Reverse mapping (`Color[0]`), `Enum['Member']` | ✅ | [syntax-enum-reverse.ts](conformance/syntax-enum-reverse.ts) | A generated `Color__name` function: the last member with the value wins; an unknown value gives `""` (JS: `undefined`). String enum members concatenate and print as strings |
163
241
 
164
242
  ## Type-system features
165
243
 
166
- | Feature | Status | Probe | Notes |
167
- | --------------------------------------------------------- | :----: | -------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
168
- | Type aliases | ✅ | [syntax-type-aliases.ts](conformance/syntax-type-aliases.ts) | `type P = { x: number }` → Go struct; alias-of-alias |
169
- | Union types | ✅ | [syntax-union-types.ts](conformance/syntax-union-types.ts) | Narrowed via `typeof` checks |
170
- | Type guards (`is`) | ✅ | [syntax-type-guards.ts](conformance/syntax-type-guards.ts) | `p is T` → Go `bool`; `in` checks struct fields at runtime |
171
- | `as` assertions | ✅ | [syntax-type-aliases.ts](conformance/syntax-type-aliases.ts) | `x as T`, incl. angle-bracket syntax |
172
- | Self-host contextual typing | ✅ | [syntax-selfhost-context.ts](conformance/syntax-selfhost-context.ts) | Object/array literals typed from context, `Record` literals, `in`, `any` params |
173
- | Decorators (`@`) | ✅ | [syntax-decorators.ts](conformance/syntax-decorators.ts) | Standard method & class decorators, applied in source order; `this` is the receiver |
174
- | Namespaces / `module` blocks | ✅ | [syntax-namespaces.ts](conformance/syntax-namespaces.ts) | Flattened to prefixed declarations (`N.f` → `N_f`), nested and in types |
175
- | `override` modifier | ✅ | [syntax-override.ts](conformance/syntax-override.ts) | Erased |
176
- | `readonly` modifier (properties, `readonly T[]`) | ✅ | [syntax-readonly.ts](conformance/syntax-readonly.ts) | Erased (`readonly T[]` → `[]T`) |
177
- | `satisfies` operator | ✅ | [syntax-satisfies.ts](conformance/syntax-satisfies.ts) | Checked by tsc, erased; the type guides literals |
178
- | `keyof` / mapped types | ✅ | [syntax-keyof-mapped-types.ts](conformance/syntax-keyof-mapped-types.ts) | `keyof` → `string`; mapped types → structs (literal keys) or maps |
179
- | Conditional types | ✅ | [syntax-conditional-types.ts](conformance/syntax-conditional-types.ts) | Resolved to their branch's Go type |
180
- | `infer` types | ✅ | [syntax-infer-types.ts](conformance/syntax-infer-types.ts) | Resolved to their branch's Go type |
181
- | `import type` / `export type` | ✅ | [syntax-import-type.ts](conformance/syntax-import-type.ts) | Type-only imports are erased |
182
- | Intersection types (`A & B`) | ✅ | [syntax-intersection-types.ts](conformance/syntax-intersection-types.ts) | Object types merge into one struct |
183
- | Literal types (`'a' \| 'b'`) | ✅ | [syntax-literal-types.ts](conformance/syntax-literal-types.ts) | Erased; string/number/boolean literals map to their base Go types |
184
- | Tuple optional / rest / labeled elements | ✅ | [syntax-tuple-elements.ts](conformance/syntax-tuple-elements.ts) | Tuples are slices |
185
- | Indexed access types (`T['k']`) | ✅ | [syntax-indexed-access-types.ts](conformance/syntax-indexed-access-types.ts) | `T['k']` resolves to the member type |
186
- | Type-level `typeof` (`typeof obj`) | ✅ | [syntax-type-typeof.ts](conformance/syntax-type-typeof.ts) | The variable's Go type |
187
- | Template literal types | ✅ | [syntax-template-literal-types.ts](conformance/syntax-template-literal-types.ts) | Template literal types → `string` |
188
- | Utility types (`Partial`, `Pick`, `Omit`, …) | ✅ | [syntax-utility-types.ts](conformance/syntax-utility-types.ts) | `Partial` / `Required` / `Readonly` / `Pick` / `Omit` / `NonNullable` → the base type |
189
- | Assertion functions (`asserts x is T`) | ✅ | [syntax-assertion-functions.ts](conformance/syntax-assertion-functions.ts) | No return value |
190
- | Callable / construct signatures (`type F = { (): void }`) | ✅ | [syntax-callable-signatures.ts](conformance/syntax-callable-signatures.ts) | Function types; a class passed as a value is its constructor |
191
- | JSX / `.tsx` syntax | ✅ | [syntax-jsx.tsx](conformance/syntax-jsx.tsx) | Renders to HTML strings (text escaped); components are calls with props |
192
- | Ambient declarations (`declare`, `.d.ts`, `x!: T`) | ✅ | [syntax-ambient-declarations.ts](conformance/syntax-ambient-declarations.ts) | `declare` only types code; `declare const` is an unset variable |
193
- | `export =` / `import x = require()` | ✅ | [syntax-export-equals.ts](conformance/syntax-export-equals.ts) | `import x = require()` is a namespace import |
244
+ | Feature | Status | Probe | Notes |
245
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
246
+ | Type aliases | ✅ | [syntax-type-aliases.ts](conformance/syntax-type-aliases.ts) | `type P = { x: number }` → Go struct; alias-of-alias |
247
+ | Union types | ✅ | [syntax-union-types.ts](conformance/syntax-union-types.ts) | Narrowed via `typeof` checks |
248
+ | Type guards (`is`) | ✅ | [syntax-type-guards.ts](conformance/syntax-type-guards.ts) | `p is T` → Go `bool`; `in` checks struct fields at runtime |
249
+ | `as` assertions | ✅ | [syntax-type-aliases.ts](conformance/syntax-type-aliases.ts) | `x as T`, incl. angle-bracket syntax (`<T>x`); `any` values convert to `T` |
250
+ | Self-host contextual typing | ✅ | [syntax-selfhost-context.ts](conformance/syntax-selfhost-context.ts) | Object/array literals typed from context, `Record` literals, `in`, `any` params |
251
+ | Decorators (`@`) | ✅ | [syntax-decorators.ts](conformance/syntax-decorators.ts) | Standard method & class decorators, applied in source order; `this` is the receiver |
252
+ | Field / accessor / parameter decorators, `context.addInitializer`, `Symbol.metadata` | ❌ | — | Only method and class decorators: field and accessor decorators fail the type check (`ClassFieldDecoratorContext` / `ClassAccessorDecoratorContext` are not declared) |
253
+ | Namespaces / `module` blocks | ✅ | [syntax-namespaces.ts](conformance/syntax-namespaces.ts) | Flattened to prefixed declarations (`N.f` → `N_f`), nested and in types |
254
+ | `override` modifier | ✅ | [syntax-override.ts](conformance/syntax-override.ts) | Erased |
255
+ | `readonly` modifier (properties, `readonly T[]`) | ✅ | [syntax-readonly.ts](conformance/syntax-readonly.ts) | Erased (`readonly T[]` → `[]T`) |
256
+ | `satisfies` operator | ✅ | [syntax-satisfies.ts](conformance/syntax-satisfies.ts) | Checked by tsc, erased; the type guides literals |
257
+ | `keyof` / mapped types | ✅ | [syntax-keyof-mapped-types.ts](conformance/syntax-keyof-mapped-types.ts) | `keyof` → `string`; mapped types → structs (literal keys) or maps |
258
+ | Conditional types | ✅ | [syntax-conditional-types.ts](conformance/syntax-conditional-types.ts) | Resolved to their branch's Go type |
259
+ | `infer` types | ✅ | [syntax-infer-types.ts](conformance/syntax-infer-types.ts) | Resolved to their branch's Go type |
260
+ | `import type` / `export type` | ✅ | [syntax-import-type.ts](conformance/syntax-import-type.ts) | Type-only imports are erased |
261
+ | Intersection types (`A & B`) | ✅ | [syntax-intersection-types.ts](conformance/syntax-intersection-types.ts) | Object types merge into one struct |
262
+ | Literal types (`'a' \| 'b'`) | ✅ | [syntax-literal-types.ts](conformance/syntax-literal-types.ts) | Erased; string/number/boolean literals map to their base Go types |
263
+ | Tuple optional / rest / labeled elements | ✅ | [syntax-tuple-elements.ts](conformance/syntax-tuple-elements.ts) | Tuples are slices |
264
+ | Indexed access types (`T['k']`) | ✅ | [syntax-indexed-access-types.ts](conformance/syntax-indexed-access-types.ts) | `T['k']` resolves to the member type |
265
+ | Type-level `typeof` (`typeof obj`) | ✅ | [syntax-type-typeof.ts](conformance/syntax-type-typeof.ts) | The variable's Go type |
266
+ | Template literal types | ✅ | [syntax-template-literal-types.ts](conformance/syntax-template-literal-types.ts) | Template literal types → `string` |
267
+ | Utility types (`Partial`, `Pick`, `Omit`, …) | ✅ | [syntax-utility-types.ts](conformance/syntax-utility-types.ts) | `Partial` / `Required` / `Readonly` / `Pick` / `Omit` / `NonNullable` → the base type |
268
+ | Assertion functions (`asserts x is T`) | ✅ | [syntax-assertion-functions.ts](conformance/syntax-assertion-functions.ts) | No return value |
269
+ | Callable / construct signatures (`type F = { (): void }`) | ✅ | [syntax-callable-signatures.ts](conformance/syntax-callable-signatures.ts) | Function types; a class passed as a value is its constructor |
270
+ | JSX / `.tsx` syntax | ✅ | [syntax-jsx.tsx](conformance/syntax-jsx.tsx) | Renders to HTML strings (text escaped); components are calls with props |
271
+ | Ambient declarations (`declare`, `.d.ts`, `x!: T`) | ✅ | [syntax-ambient-declarations.ts](conformance/syntax-ambient-declarations.ts) | `declare` only types code; `declare const` is an unset variable |
272
+ | `export =` / `import x = require()` | ✅ | [syntax-export-equals.ts](conformance/syntax-export-equals.ts) | `import x = require()` is a namespace import |
273
+ | Recursive types (`type Tree = { children: Tree[] }`) | ✅ | — | Self-referencing structs |
274
+ | `typeof` / `instanceof` narrowing of `unknown` values (`string`, `number`, `boolean`, `Date`, arrays, functions, objects) | ✅ | [syntax-typeof-narrowing.ts](conformance/syntax-typeof-narrowing.ts) | Inside the branch the value has the narrowed Go type and its methods |
275
+ | Forced casts (`x as unknown as T[]`) where the value is not a `T[]` | ✅ | [syntax-forced-cast.ts](conformance/syntax-forced-cast.ts) | The value stays what it is; a method returning one returns any value |
276
+ | `typeof f` of a declared function as a type | ✅ | [syntax-typeof-function-type.ts](conformance/syntax-typeof-function-type.ts) | Its Go func type: values of it (record fields, destructured parameters) are called directly |
277
+ | User-defined type guards (`(t): t is string`, declared or a local arrow) narrowing an optional argument | ✅ | [syntax-type-guard-narrowing.ts](conformance/syntax-type-guard-narrowing.ts) | Where the call is true, the argument is its non-nullable type |
278
+ | Generic interfaces used without type arguments; interfaces extending `Omit<>` / `Pick<>` / `Partial<>`; open object types (`{ [k: string]: any; … }`); call signatures declared in a function; array types with properties (`T[] & { links: L }`) | ✅ | [syntax-object-type-forms.ts](conformance/syntax-object-type-forms.ts) | Unused type parameters are erased; an array type with properties is an `Array` subclass |
279
+ | A `string \| null` (number, boolean) field holding the value, `null` or `undefined` | ✅ | [syntax-nullable-primitive-fields.ts](conformance/syntax-nullable-primitive-fields.ts) | An any field: `x \|\| null`, `x ?? null` and a conditional's `null` branch store `null`, which `JSON.stringify` writes; an absent value is left out |
194
280
 
195
281
  ## Modules & imports
196
282
 
197
- | Feature | Status | Probe | Notes |
198
- | -------------------------------------------------- | :----: | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
199
- | Named imports | ✅ | [syntax-import-go.ts](conformance/syntax-import-go.ts) | `import { x } from './file'` |
200
- | Import renaming (`import { x as y }`) | ✅ | [syntax-import-renaming.ts](conformance/syntax-import-renaming.ts) | Local file imports |
201
- | Named exports (`export const` / `export function`) | ✅ | [syntax-import-local.ts](conformance/syntax-import-local.ts) | Helper [import-local-helper.ts](conformance/import-local-helper.ts) exports `multiply` |
202
- | Default imports | ✅ | [syntax-import-go.ts](conformance/syntax-import-go.ts) | `import x from 'pkg'` — namespace stripped in output |
203
- | Namespace imports | ✅ | [syntax-import-go.ts](conformance/syntax-import-go.ts) | `import * as x from 'pkg'` |
204
- | Local file imports | ✅ | [syntax-import-local.ts](conformance/syntax-import-local.ts) | Relative paths transpiled to a separate Go file (helper: [import-local-helper.ts](conformance/import-local-helper.ts)) |
205
- | Default export | ✅ | [syntax-default-export.ts](conformance/syntax-default-export.ts) | `export default function` |
206
- | Node.js built-in imports | ✅ | [lib-node-path.ts](conformance/lib-node-path.ts) | `node:x` or bare (`'fs'`), named / default / namespace imports, subpaths (`fs/promises`) (see [Node builtins](#node-builtins-node)) |
207
- | Go package imports | ✅ | [syntax-import-go.ts](conformance/syntax-import-go.ts) | `import { x } from 'go:pkg'` |
208
- | npm package imports | ✅ | [syntax-import-npm.ts](conformance/syntax-import-npm.ts) | `import { x } from 'pkg'` mapped to Go module imports |
209
- | Re-exports (`export { x } from`, `export *`) | ✅ | [syntax-re-exports.ts](conformance/syntax-re-exports.ts) | Re-exported files are included (one Go package) |
210
- | Dynamic `import()` | ✅ | [syntax-dynamic-import.ts](conformance/syntax-dynamic-import.ts) | `const m = await import('./x')` is a namespace import |
211
- | Side-effect imports (`import './mod'`) | ✅ | [syntax-side-effect-import.ts](conformance/syntax-side-effect-import.ts) | Module top-level statements run in Go's `init()` |
212
- | `import.meta.url` | ✅ | [syntax-import-meta.ts](conformance/syntax-import-meta.ts) | The `file://` URL of the running program (`os.Executable` → `pathToFileURL`) |
283
+ | Feature | Status | Probe | Notes |
284
+ | ---------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
285
+ | Named imports | ✅ | [syntax-import-go.ts](conformance/syntax-import-go.ts) | `import { x } from './file'` |
286
+ | Import renaming (`import { x as y }`) | ✅ | [syntax-import-renaming.ts](conformance/syntax-import-renaming.ts) | Local file imports |
287
+ | Named exports (`export const` / `export function`) | ✅ | [syntax-import-local.ts](conformance/syntax-import-local.ts) | Helper [import-local-helper.ts](conformance/import-local-helper.ts) exports `multiply` |
288
+ | Default imports | ✅ | [syntax-import-go.ts](conformance/syntax-import-go.ts) | `import x from 'pkg'` — namespace stripped in output |
289
+ | Namespace imports | ✅ | [syntax-import-go.ts](conformance/syntax-import-go.ts) | `import * as x from 'pkg'` |
290
+ | Local file imports | ✅ | [syntax-import-local.ts](conformance/syntax-import-local.ts) | Relative paths transpiled to a separate Go file (helper: [import-local-helper.ts](conformance/import-local-helper.ts)) |
291
+ | Default export | ✅ | [syntax-default-export.ts](conformance/syntax-default-export.ts) | `export default function` |
292
+ | Node.js built-in imports | ✅ | [lib-node-path.ts](conformance/lib-node-path.ts) | `node:x` or bare (`'fs'`), named / default / namespace imports, subpaths (`fs/promises`) (see [Node builtins](#node-builtins-node)) |
293
+ | Go package imports | ✅ | [syntax-import-go.ts](conformance/syntax-import-go.ts) | `import { x } from 'go:pkg'` |
294
+ | npm package imports | ✅ | [syntax-import-npm.ts](conformance/syntax-import-npm.ts) | `import { x } from 'pkg'` mapped to Go module imports |
295
+ | Re-exports (`export { x } from`, `export *`) | ✅ | [syntax-re-exports.ts](conformance/syntax-re-exports.ts) | Re-exported files are included (one Go package) |
296
+ | Dynamic `import()` | ✅ | [syntax-dynamic-import.ts](conformance/syntax-dynamic-import.ts) | `const m = await import('./x')` is a namespace import |
297
+ | Side-effect imports (`import './mod'`) | ✅ | [syntax-side-effect-import.ts](conformance/syntax-side-effect-import.ts) | Module top-level statements run in Go's `init()` |
298
+ | `import.meta.url` | ✅ | [syntax-import-meta.ts](conformance/syntax-import-meta.ts) | The `file://` URL of the running program (`os.Executable` → `pathToFileURL`) |
299
+ | JSON modules (`import data from './x.json' with { type: 'json' }`) | ✅ | [lib-json-modules.ts](conformance/lib-json-modules.ts) | Read at compile time and compiled as an object literal, so fields keep their types (helper [json-module-helper.json](conformance/json-module-helper.json)); needs `resolveJsonModule` and a `module` setting that allows import attributes in a project tsconfig |
300
+ | Per-module top-level scopes (same-named functions, consts, classes in two modules) | ✅ | [syntax-module-scope.ts](conformance/syntax-module-scope.ts) | Module-private names are made unique per module |
301
+ | `Ns.T` of a namespace declared in another module | ✅ | [syntax-namespace-types-import.ts](conformance/syntax-namespace-types-import.ts) | `import type { Ns }` included |
213
302
 
214
303
  ## Async & timing
215
304
 
216
- | Feature | Status | Probe | Notes |
217
- | ---------------------------------------------------- | :----: | ------------------------------------------------------------ | -------------------------------------- |
218
- | `async` / `await` | ✅ | [syntax-async-await.ts](conformance/syntax-async-await.ts) | The body runs synchronously until its first `await`; `await` runs pending event-loop tasks while it waits; the loop drains before exit |
219
- | Async arrow callbacks (`emitter.on('x', async () => { await … })`, `test('t', async () => …)`) | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | Run to completion when called (their awaits keep the event loop running), so the caller sees them finish before it continues |
220
- | `Promise` constructor / `.then` | ✅ | [syntax-promise-then.ts](conformance/syntax-promise-then.ts) | The executor runs synchronously; promises are buffered channels; `.then` callbacks run on the event loop |
221
- | `Promise.all` | ✅ | [syntax-promise-all.ts](conformance/syntax-promise-all.ts) | `TnPromiseAll` drains every promise channel into a slice |
222
- | `Promise.resolve` | ✅ | [lib-promise-resolve.ts](conformance/lib-promise-resolve.ts) | Buffered channel holding the value |
223
- | `Promise.reject` / `.catch` / `.finally` | ✅ | [lib-promise-catch.ts](conformance/lib-promise-catch.ts) | Rejected promises are closed channels with a reason; `await` rethrows |
224
- | `Promise.race` / `allSettled` / `any` | ✅ | [lib-promise-combinators.ts](conformance/lib-promise-combinators.ts) | Goroutine per promise; first settled / all settled / first fulfilled |
225
- | `clearTimeout` | ✅ | [lib-timers.ts](conformance/lib-timers.ts) | `TnClearTimeout` stops the timer |
226
- | `setInterval` / `clearInterval` | ✅ | [lib-set-interval.ts](conformance/lib-set-interval.ts) | `time.Ticker` posting to the event loop; the process lives until cleared |
227
- | `queueMicrotask` | ✅ | [lib-queue-microtask.ts](conformance/lib-queue-microtask.ts) | Runs after the current synchronous code (end of main or of an event-loop task) |
228
- | `setTimeout` | ✅ | [lib-set-timeout.ts](conformance/lib-set-timeout.ts) | `time.AfterFunc` posting the callback to the event loop, which keeps the process alive |
305
+ | Feature | Status | Probe | Notes |
306
+ | -------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
307
+ | `async` / `await` | ✅ | [syntax-async-await.ts](conformance/syntax-async-await.ts) | The body runs synchronously until its first `await`; `await` runs pending event-loop tasks while it waits; the loop drains before exit |
308
+ | Async arrow callbacks (`emitter.on('x', async () => { await … })`, `test('t', async () => …)`) | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | Run to completion when called (their awaits keep the event loop running), so the caller sees them finish before it continues |
309
+ | `Promise` constructor / `.then` | ✅ | [syntax-promise-then.ts](conformance/syntax-promise-then.ts) | The executor runs synchronously; promises are buffered channels; `.then` callbacks run on the event loop |
310
+ | `Promise.all` | ✅ | [syntax-promise-all.ts](conformance/syntax-promise-all.ts) | `TnPromiseAll` drains every promise channel into a slice |
311
+ | `Promise.resolve` | ✅ | [lib-promise-resolve.ts](conformance/lib-promise-resolve.ts) | Buffered channel holding the value |
312
+ | `Promise.reject` / `.catch` / `.finally` | ✅ | [lib-promise-catch.ts](conformance/lib-promise-catch.ts) | Rejected promises are closed channels with a reason; `await` rethrows |
313
+ | `Promise.race` / `allSettled` / `any` | ✅ | [lib-promise-combinators.ts](conformance/lib-promise-combinators.ts) | Goroutine per promise; first settled / all settled / first fulfilled |
314
+ | `clearTimeout` | ✅ | [lib-timers.ts](conformance/lib-timers.ts) | `TnClearTimeout` stops the timer |
315
+ | `setInterval` / `clearInterval` | ✅ | [lib-set-interval.ts](conformance/lib-set-interval.ts) | `time.Ticker` posting to the event loop; the process lives until cleared |
316
+ | `queueMicrotask` | ✅ | [lib-queue-microtask.ts](conformance/lib-queue-microtask.ts) | Runs after the current synchronous code (end of main or of an event-loop task) |
317
+ | `setTimeout` | ✅ | [lib-set-timeout.ts](conformance/lib-set-timeout.ts) | `time.AfterFunc` posting the callback to the event loop, which keeps the process alive |
318
+ | `resolve` / `reject` passed as values | ✅ | [lib-node-async-hooks.ts](conformance/lib-node-async-hooks.ts) | `new Promise((resolve) => setTimeout(resolve, ms))` |
319
+ | Async class methods (instance, static, inherited, unannotated); `return otherPromise()` | ✅ | [syntax-async-methods.ts](conformance/syntax-async-methods.ts) | Lowered like async functions; a returned promise is awaited |
320
+ | `Promise.withResolvers` / `Promise.try` | ✅ | [lib-promise-extras.ts](conformance/lib-promise-extras.ts) | |
321
+ | Async arrows kept as values (`const f = async () => …`) | ✅ | [lib-promise-extras.ts](conformance/lib-promise-extras.ts) | Return a promise like async functions (concise bodies too); async arrows passed straight to a call run inline (see above) |
322
+ | `.then` on a `Promise.resolve(v)` held in a variable | ❌ | — | Go build error (`chan T` has no `then`); `await` it, or build it with `new Promise` |
323
+ | Microtask order: `await` inside an async function nobody awaits; `.then` callbacks before a later `setTimeout(…, 0)` | ❌ | — | The function resumes synchronously and `.then` callbacks may run after the timer; await the call to get JS's order |
229
324
 
230
325
  ## Semantics (JS behaviour preserved)
231
326
 
232
- | Feature | Status | Probe | Notes |
233
- | ----------------------------------------- | :----: | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
234
- | Array reference semantics | ✅ | [semantics-array-reference.ts](conformance/semantics-array-reference.ts) | Array variables hold `*[]T` so aliases share the slice header |
235
- | Object reference semantics | ✅ | [semantics-object-reference.ts](conformance/semantics-object-reference.ts) | Aliased objects share state; [semantics-parameter-mutation.ts](conformance/semantics-parameter-mutation.ts) |
236
- | Object identity | ✅ | [semantics-object-identity.ts](conformance/semantics-object-identity.ts) | Equal literals are different references |
237
- | Object key order | ✅ | [semantics-object-key-order.ts](conformance/semantics-object-key-order.ts) | Insertion order preserved |
238
- | Map insertion order | ✅ | [semantics-map-order.ts](conformance/semantics-map-order.ts) | Iteration follows insertion order |
239
- | Set insertion order | ✅ | [semantics-set-order.ts](conformance/semantics-set-order.ts) | Spread follows insertion order |
240
- | Default sort is lexicographic | ✅ | [semantics-default-sort.ts](conformance/semantics-default-sort.ts) | `[10, 9, 1].sort()` → `1,10,9` |
241
- | Float math | ✅ | [semantics-float-math.ts](conformance/semantics-float-math.ts) | `7 / 2 === 3.5`, `0.1 + 0.2 !== 0.3` |
242
- | Integer precision | ✅ | [semantics-integer-precision.ts](conformance/semantics-integer-precision.ts) | `2 ** 53 + 1 === 2 ** 53` |
243
- | `NaN` semantics | ✅ | [semantics-nan.ts](conformance/semantics-nan.ts) | `NaN !== NaN`, `Number.isNaN(0 / 0)` |
244
- | String-number concatenation order | ✅ | [semantics-string-number-concat.ts](conformance/semantics-string-number-concat.ts) | `'a' + 1 + 2` vs `1 + 2 + 'a'` |
245
- | Array truthiness | ✅ | [semantics-array-truthy.ts](conformance/semantics-array-truthy.ts) | Empty array is truthy |
246
- | Loop closures capture per-iteration `let` | ✅ | [semantics-loop-closures.ts](conformance/semantics-loop-closures.ts) | |
247
- | Functions stored in Records | ✅ | [semantics-record-functions.ts](conformance/semantics-record-functions.ts) | `rec.fn()` → `rec.Get("fn")()`, also for names like `get` / `sort` |
327
+ | Feature | Status | Probe | Notes |
328
+ | --------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
329
+ | Array reference semantics | ✅ | [semantics-array-reference.ts](conformance/semantics-array-reference.ts) | Array variables hold `*[]T` so aliases share the slice header |
330
+ | `any[]` arrays mutated through a parameter (`function f(a: any[]) { a.push(x) }`) | ❌ | — | `any[]` arrays are plain `[]interface{}`, not shared references: a `push` inside the callee is lost to the caller (typed arrays share) |
331
+ | Arrays held in a `Map` / `Record` / array, mutated in place (`m.get(k)!.push(x)`) | ❌ | — | Containers hold `[]T` by value: a `push` on the element doesn't compile, and a `push` through a local read of it (`const a = m.get(k)!`) is lost. Read, modify, then `set` it back |
332
+ | Object reference semantics | ✅ | [semantics-object-reference.ts](conformance/semantics-object-reference.ts) | Aliased objects share state; [semantics-parameter-mutation.ts](conformance/semantics-parameter-mutation.ts) |
333
+ | Object identity | ✅ | [semantics-object-identity.ts](conformance/semantics-object-identity.ts) | Equal literals are different references |
334
+ | Object key order | ✅ | [semantics-object-key-order.ts](conformance/semantics-object-key-order.ts) | Insertion order preserved |
335
+ | Map insertion order | ✅ | [semantics-map-order.ts](conformance/semantics-map-order.ts) | Iteration follows insertion order |
336
+ | Set insertion order | ✅ | [semantics-set-order.ts](conformance/semantics-set-order.ts) | Spread follows insertion order |
337
+ | Default sort is lexicographic | ✅ | [semantics-default-sort.ts](conformance/semantics-default-sort.ts) | `[10, 9, 1].sort()` → `1,10,9` |
338
+ | Float math | ✅ | [semantics-float-math.ts](conformance/semantics-float-math.ts) | `7 / 2 === 3.5`, `0.1 + 0.2 !== 0.3` |
339
+ | Number to string (`String(n)`, templates, `JSON.stringify`) | ✅ | [semantics-number-to-string.ts](conformance/semantics-number-to-string.ts) | Plain notation from `1e-6` up to `1e21`, exponent form (`1e-7`, `1e+21`) outside it |
340
+ | Integer precision | ✅ | [semantics-integer-precision.ts](conformance/semantics-integer-precision.ts) | `2 ** 53 + 1 === 2 ** 53` |
341
+ | `NaN` semantics | ✅ | [semantics-nan.ts](conformance/semantics-nan.ts) | `NaN !== NaN`, `Number.isNaN(0 / 0)` |
342
+ | String-number concatenation order | ✅ | [semantics-string-number-concat.ts](conformance/semantics-string-number-concat.ts) | `'a' + 1 + 2` vs `1 + 2 + 'a'` |
343
+ | Array truthiness | ✅ | [semantics-array-truthy.ts](conformance/semantics-array-truthy.ts) | Empty array is truthy |
344
+ | An object's own `length` field (`{ length: 3 }.length`) | ✅ | [semantics-length-field.ts](conformance/semantics-length-field.ts) | A field read, not an array length |
345
+ | Loop closures capture per-iteration `let` | ✅ | [semantics-loop-closures.ts](conformance/semantics-loop-closures.ts) | |
346
+ | Functions stored in Records | ✅ | [semantics-record-functions.ts](conformance/semantics-record-functions.ts) | `rec.fn()` → `rec.Get("fn")()`, also for names like `get` / `sort` |
347
+ | An array field passed to a function or returned from one is the same array | ✅ | [semantics-shared-arrays.ts](conformance/semantics-shared-arrays.ts) | Callees get a `*[]T` reference to the field; `return n.sep ?? n.items` returns the field itself |
348
+ | A local alias of an array field (`const a = o.items; a.push(x)`) | ❌ | — | The variable holds its own slice: pushes and splices through it do not reach the field |
349
+ | An array read from an `any` object into a variable, then pushed to | ❌ | — | `o.list.push(x)` reaches the object; `const l = o.list; l.push(x)` does not |
350
+ | `null` in program data (`JSON.parse`, arrays and objects of `any`) is not `undefined` | ✅ | [semantics-json-null.ts](conformance/semantics-json-null.ts) | It prints, serializes and stringifies as `null`; `=== undefined` is false. A `null` stored in a typed slot is still Go `nil` |
351
+ | Arrays are shared: an object field, a variable and a parameter holding one array see each other's changes | ✅ | [semantics-array-aliasing.ts](conformance/semantics-array-aliasing.ts) | An object type's array field is a reference (`*[]T`); a method returning its array argument returns that array |
352
+ | Mutating array methods through `any` (`tok.tokens.unshift(…)`) reach the array's other holders | ✅ | [semantics-array-write-back.ts](conformance/semantics-array-write-back.ts) | Also `x?.[i]`, `x ?? []` and `x \|\| []` on an absent array, and a `Source[]` passed as `(Source \| Other)[]` (a converted copy) |
353
+ | Object literals whose methods return the object (fluent builders), chained to any length | ✅ | [semantics-self-referencing-object.ts](conformance/semantics-self-referencing-object.ts) | Type inference is memoized per query, so long chains compile in linear time |
354
+ | Key order of an `any`-typed object literal (`const o: any = { b: 1, a: 2 }`) | ❌ | — | It becomes a Go map, whose keys come out sorted (`a, b`); a typed (or inferred) literal keeps its order |
355
+ | `arr?.length` on an absent array | ❌ | — | Reads `0` instead of `undefined`; test `arr` itself |
248
356
 
249
357
  ## Sample apps
250
358
 
251
359
  End-to-end programs that combine many features the way real code does (they run in the suite like any probe).
252
360
 
253
- | App | Probe | Covers |
254
- | --- | ----- | ------ |
255
- | `wc`-style CLI | [app-cli-wordcount.ts](conformance/app-cli-wordcount.ts) | `util.parseArgs`, `fs`, `path`, `os.EOL`, a class with a `Map` field, tuples sorted with a `\|\|` comparator, `reduce` into an object, `crypto` |
256
- | JSON API on HTTP + SQLite | [app-http-sqlite.ts](conformance/app-http-sqlite.ts) | `http.createServer` routing, `URL`, `node:sqlite` prepared statements, `fetch` (POST / GET / DELETE), JSON bodies, status codes |
257
- | Stream pipeline | [app-stream-pipeline.ts](conformance/app-stream-pipeline.ts) | A generator through `Readable.from`, a CSV-aggregating `Transform`, `Float64Array` series, `stream/promises` `pipeline` to files, gzip and Brotli streams, SHA-256 |
361
+ | App | Probe | Covers |
362
+ | ------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
363
+ | `wc`-style CLI | [app-cli-wordcount.ts](conformance/app-cli-wordcount.ts) | `util.parseArgs`, `fs`, `path`, `os.EOL`, a class with a `Map` field, tuples sorted with a `\|\|` comparator, `reduce` into an object, `crypto` |
364
+ | JSON API on HTTP + SQLite | [app-http-sqlite.ts](conformance/app-http-sqlite.ts) | `http.createServer` routing, `URL`, `node:sqlite` prepared statements, `fetch` (POST / GET / DELETE), JSON bodies, status codes |
365
+ | Stream pipeline | [app-stream-pipeline.ts](conformance/app-stream-pipeline.ts) | A generator through `Readable.from`, a CSV-aggregating `Transform`, `Float64Array` series, `stream/promises` `pipeline` to files, gzip and Brotli streams, SHA-256 |
366
+ | Native window | [app-webview-window.ts](conformance/app-webview-window.ts) | A real `@webviewjs/webview` window whose page calls the program's own `http` server, then closes (runs with `TN_WEBVIEW_SMOKE=1`) |
367
+
368
+ ## Examples
369
+
370
+ The programs in [examples/](examples/) show where a native binary beats Node.js, each with a benchmark. They
371
+ take arguments or keep running, so the suite type-checks and builds them as `example-<name>` without running
372
+ them (`node scripts/conformance.mjs example`).
373
+
374
+ | Example | Source | Covers |
375
+ | ------------------------------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
376
+ | [hello-world](examples/hello-world/) | [main.ts](examples/hello-world/main.ts) | `process.argv`, template literals: process startup |
377
+ | [fibonacci](examples/fibonacci/) | [main.ts](examples/fibonacci/main.ts) | Recursion, `perf_hooks`: CPU-bound compute |
378
+ | [json-server](examples/json-server/) | [main.ts](examples/json-server/main.ts) | `node:http` GET / POST JSON routes, `URL`: HTTP throughput |
379
+ | [todo-cli](examples/todo-cli/) | [main.ts](examples/todo-cli/main.ts) | `process.argv` destructuring with default and rest, `fs` atomic writes (`renameSync`), `os.homedir()`, `process.env`: per-command latency |
380
+ | [dupe-finder](examples/dupe-finder/) | [main.ts](examples/dupe-finder/main.ts) | Recursive `readdirSync` with `withFileTypes`, `statSync`, SHA-256 `createHash`, `Map` grouping, JSON report to disk: disk scan + hashing |
381
+ | [mandelbrot-png](examples/mandelbrot-png/) | [main.ts](examples/mandelbrot-png/main.ts) | Float loop, tuple returns, `Uint8Array` / `DataView`, a PNG encoder on `zlib.deflateSync` + `zlib.crc32`: image rendering with no deps |
382
+ | [desktop-notes](examples/desktop-notes/) | [main.ts](examples/desktop-notes/main.ts), [ui.ts](examples/desktop-notes/ui.ts) | `node:http` REST routes, `fs` note files, UI compiled in from a `.ts` module, `@webviewjs/webview` window (own process under Node.js): launch time + memory |
258
383
 
259
384
  ## Standard library
260
385
 
@@ -264,186 +389,236 @@ Every standard-library API TypeNative ports, split by module. Per
264
389
 
265
390
  ### `console`
266
391
 
267
- | API | Status | Probe | Notes |
268
- | ---------------------------------- | :----: | ------------------------------------------------------ | ------------------------------------------------------ |
269
- | `console.log` | ✅ | [lib-console-log.ts](conformance/lib-console-log.ts) | `fmt.Println`; non-string arguments print like Node (`util.inspect`), format strings like `util.format` |
270
- | `console.error` | ✅ | [lib-console-error.ts](conformance/lib-console-error.ts) | `fmt.Fprintln(os.Stderr, ...)` |
271
- | `console.warn` | ✅ | [lib-console-error.ts](conformance/lib-console-error.ts) | Mapped to stderr like `console.error` |
272
- | `console.time` / `console.timeEnd` / `console.timeLog` | ✅ | [lib-console-time.ts](conformance/lib-console-time.ts) | Node's format: `label: 1.234ms` |
273
- | `console.info` / `debug` / `dir` / `count` / `countReset` / `group` / `groupEnd` / `assert` / `trace` | ✅ | [lib-console-more.ts](conformance/lib-console-more.ts) | `group` indents every later console line; `assert` prints `Assertion failed` |
274
- | `console.table` (arrays, objects, `Map`, `Set`, a `properties` filter) | ✅ | [lib-node-console-table.ts](conformance/lib-node-console-table.ts) | Node's box-drawn layout (left-aligned cells); other values are logged as is |
392
+ | API | Status | Probe | Notes |
393
+ | ----------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
394
+ | `console.log` | ✅ | [lib-console-log.ts](conformance/lib-console-log.ts) | `fmt.Println`; non-string arguments print like Node (`util.inspect`), format strings like `util.format` |
395
+ | `console.error` | ✅ | [lib-console-error.ts](conformance/lib-console-error.ts) | `fmt.Fprintln(os.Stderr, ...)` |
396
+ | `console.warn` | ✅ | [lib-console-error.ts](conformance/lib-console-error.ts) | Mapped to stderr like `console.error` |
397
+ | `console.time` / `console.timeEnd` / `console.timeLog` | ✅ | [lib-console-time.ts](conformance/lib-console-time.ts) | Node's format: `label: 1.234ms` |
398
+ | `console.info` / `debug` / `dir` / `count` / `countReset` / `group` / `groupEnd` / `assert` / `trace` | ✅ | [lib-console-more.ts](conformance/lib-console-more.ts) | `group` indents every later console line; `assert` prints `Assertion failed` |
399
+ | `console.table` (arrays, objects, `Map`, `Set`, a `properties` filter) | ✅ | [lib-node-console-table.ts](conformance/lib-node-console-table.ts) | Node's box-drawn layout (left-aligned cells); other values are logged as is |
275
400
 
276
401
  ### `Math`
277
402
 
278
- | API | Status | Probe | Notes |
279
- | ------------------------------------------------------------------ | :----: | ------------------------------------------------------ | --------------------------------------------------------------- |
280
- | `Math.floor` / `ceil` / `round` | ✅ | [lib-math.ts](conformance/lib-math.ts) | Mapped to `math.Floor`, `math.Ceil`, `math.Round` |
281
- | `Math.abs` / `sqrt` / `pow` | ✅ | [lib-math.ts](conformance/lib-math.ts) | Mapped to corresponding `math` functions |
282
- | `Math.min` / `Math.max` | ✅ | [lib-math-min-max.ts](conformance/lib-math-min-max.ts) | Go builtins `min` / `max` |
283
- | `Math.max(...arr)` / spread & variadic | ✅ | [lib-math-min-max.ts](conformance/lib-math-min-max.ts) | Spread and any number of arguments via `slices.Max` / `max` |
284
- | `Math.random` | ✅ | [lib-math-random.ts](conformance/lib-math-random.ts) | Mapped to `rand.Float64()` |
285
- | `Math.log` / `log2` / `log10` | ✅ | [lib-math-functions.ts](conformance/lib-math-functions.ts) | `math.Log` / `math.Log2` / `math.Log10` |
286
- | `Math.sin` / `cos` / `tan` | ✅ | [lib-math-functions.ts](conformance/lib-math-functions.ts) | `math.Sin` / `math.Cos` / `math.Tan` |
287
- | `Math.trunc` / `sign` | ✅ | [lib-math-functions.ts](conformance/lib-math-functions.ts) | `math.Trunc` / inline sign check |
288
- | Constants (`Math.PI`, `Math.E`, …) | ✅ | [lib-math-constants.ts](conformance/lib-math-constants.ts) | `math.Pi`, `math.E`, `math.Sqrt2`, … |
289
- | `Math.asin` / `acos` / `atan` / `atan2` / `hypot` / `cbrt` / `exp` | ✅ | [lib-math-more.ts](conformance/lib-math-more.ts) | Corresponding `math` functions |
403
+ | API | Status | Probe | Notes |
404
+ | ----------------------------------------------------------------------------- | :----: | -------------------------------------------------------------- | ----------------------------------------------------------- |
405
+ | `Math.floor` / `ceil` / `round` | ✅ | [lib-math.ts](conformance/lib-math.ts) | Mapped to `math.Floor`, `math.Ceil`, `math.Round` |
406
+ | `Math.abs` / `sqrt` / `pow` | ✅ | [lib-math.ts](conformance/lib-math.ts) | Mapped to corresponding `math` functions |
407
+ | `Math.min` / `Math.max` | ✅ | [lib-math-min-max.ts](conformance/lib-math-min-max.ts) | Go builtins `min` / `max` |
408
+ | `Math.max(...arr)` / spread & variadic | ✅ | [lib-math-min-max.ts](conformance/lib-math-min-max.ts) | Spread and any number of arguments via `slices.Max` / `max` |
409
+ | `Math.random` | ✅ | [lib-math-random.ts](conformance/lib-math-random.ts) | Mapped to `rand.Float64()` |
410
+ | `Math.log` / `log2` / `log10` | ✅ | [lib-math-functions.ts](conformance/lib-math-functions.ts) | `math.Log` / `math.Log2` / `math.Log10` |
411
+ | `Math.sin` / `cos` / `tan` | ✅ | [lib-math-functions.ts](conformance/lib-math-functions.ts) | `math.Sin` / `math.Cos` / `math.Tan` |
412
+ | `Math.trunc` / `sign` | ✅ | [lib-math-functions.ts](conformance/lib-math-functions.ts) | `math.Trunc` / inline sign check |
413
+ | Constants (`Math.PI`, `Math.E`, …) | ✅ | [lib-math-constants.ts](conformance/lib-math-constants.ts) | `math.Pi`, `math.E`, `math.Sqrt2`, … |
414
+ | `Math.asin` / `acos` / `atan` / `atan2` / `hypot` / `cbrt` / `exp` | ✅ | [lib-math-more.ts](conformance/lib-math-more.ts) | Corresponding `math` functions |
415
+ | `Math.sinh` / `cosh` / `tanh` / `expm1` / `log1p` | ✅ | — | Corresponding `math` functions |
416
+ | `Math.fround` / `imul` / `clz32` / `asinh` / `acosh` / `atanh` / `sumPrecise` | ✅ | [lib-builtins-statics.ts](conformance/lib-builtins-statics.ts) | `sumPrecise` is a compensated (Neumaier) sum |
417
+ | `Math.f16round` | ❌ | — | Not declared |
290
418
 
291
419
  ### `JSON`
292
420
 
293
- | API | Status | Probe | Notes |
294
- | ---------------- | :----: | ---------------------------------------------------------- | ------------------------------------- |
295
- | `JSON.parse` | ✅ | [lib-json-parse.ts](conformance/lib-json-parse.ts) | Mapped to `encoding/json` `Unmarshal`; assigned to an interface type, the result converts into its struct |
296
- | `JSON.stringify` | ✅ | [lib-json-stringify.ts](conformance/lib-json-stringify.ts) | Reflection serializer includes unexported struct fields |
421
+ | API | Status | Probe | Notes |
422
+ | ----------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
423
+ | `JSON.parse` | ✅ | [lib-json-parse.ts](conformance/lib-json-parse.ts) | Mapped to `encoding/json` `Unmarshal`; assigned to an interface type, the result converts into its struct |
424
+ | `JSON.stringify` | ✅ | [lib-json-stringify.ts](conformance/lib-json-stringify.ts) | Reflection serializer includes unexported struct fields and inherited ones |
425
+ | `JSON.stringify` `space`, replacer (function or key list), `toJSON()`; circular structures; `JSON.parse` reviver and `SyntaxError`s | ✅ | [lib-json-options.ts](conformance/lib-json-options.ts) | Node's layout; Dates serialize as ISO strings, `Map` / `Set` as `{}`, bigints throw. A replacer or reviver returning `undefined` gives `null` (it doesn't drop the key) |
426
+ | Key order of `JSON.parse` objects | ✅ | [lib-object-keys-typed.ts](conformance/lib-object-keys-typed.ts) | Parsed objects are ordered records (a duplicate key keeps its first position and last value); `delete`, `in`, `for...in` and spreads keep the order |
297
427
 
298
428
  ### `Object`
299
429
 
300
- | API | Status | Probe | Notes |
301
- | ---------------------------------------------------------- | :----: | ---------------------------------------------------------- | ------------------------------------------------------------------- |
302
- | `Object.keys` / `values` / `entries` | ✅ | [lib-object-helpers.ts](conformance/lib-object-helpers.ts) | Map key/value iteration helpers; typed results for maps and records |
303
- | `Object.assign` | ✅ | [lib-object-assign.ts](conformance/lib-object-assign.ts) | Sources (structs, maps, dynamic objects) copied into an ordered map |
304
- | `Object.freeze` / `seal` / `isFrozen` | ✅ | [lib-object-freeze.ts](conformance/lib-object-freeze.ts) | Integrity level tracked by identity; writes rejected by `Readonly<T>` types |
305
- | `Object.fromEntries` | ✅ | [lib-object-from-entries.ts](conformance/lib-object-from-entries.ts) | `TnFromEntries` → dynamic object |
306
- | `Object.hasOwn` / `defineProperty` / `getOwnPropertyNames` | ✅ | [lib-object-own.ts](conformance/lib-object-own.ts) | Maps, dynamic objects and typed objects (literal keys); `{ value }` descriptors |
430
+ | API | Status | Probe | Notes |
431
+ | ------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
432
+ | `Object.keys` / `values` / `entries` | ✅ | [lib-object-helpers.ts](conformance/lib-object-helpers.ts) | Map key/value iteration helpers; typed results for maps and records |
433
+ | `Object.keys` / `values` / `entries`, `for...in` on typed objects (interfaces, object literals, class instances) | ✅ | [lib-object-keys-typed.ts](conformance/lib-object-keys-typed.ts) | Own data fields in declaration order, a parent class's first; no `#private` fields or accessors (they are on the prototype); unset optional properties are absent |
434
+ | `Object.assign` | ✅ | [lib-object-assign.ts](conformance/lib-object-assign.ts) | Sources (structs, maps, dynamic objects) copied into an ordered map |
435
+ | `Object.freeze` / `seal` / `preventExtensions` / `isFrozen` / `isSealed` / `isExtensible` | ✅ | [lib-object-freeze.ts](conformance/lib-object-freeze.ts) | Integrity level tracked by identity; writes rejected by `Readonly<T>` types (`preventExtensions` / `isSealed` / `isExtensible` not probed) |
436
+ | `Object.fromEntries` | ✅ | [lib-object-from-entries.ts](conformance/lib-object-from-entries.ts) | `TnFromEntries` → dynamic object |
437
+ | `Object.hasOwn` / `defineProperty` / `getOwnPropertyNames` | ✅ | [lib-object-own.ts](conformance/lib-object-own.ts) | Maps, dynamic objects and typed objects (literal keys); `{ value }` descriptors |
438
+ | `Object.hasOwn` / `defineProperty` with a non-literal key on a typed object | ✅ | [lib-object-own-computed.ts](conformance/lib-object-own-computed.ts) | A `switch` over the declared fields (an unset optional field is not own) |
439
+ | `Object.is` | ✅ | [lib-builtins-statics.ts](conformance/lib-builtins-statics.ts) | SameValue; two empty object literals may share an address in Go, so `Object.is({}, {})` can be `true` |
440
+ | `Object.groupBy` / `Map.groupBy` | ✅ | [lib-group-by.ts](conformance/lib-group-by.ts) | Groups in first-seen key order |
441
+ | `Object.create(null)` | ✅ | [lib-object-create-null.ts](conformance/lib-object-create-null.ts) | An empty dynamic object (the prototype-less dictionary idiom) |
442
+ | `Object.create(C.prototype)` / `getPrototypeOf` / `getOwnPropertyDescriptors` / `defineProperties` | ✅ | [lib-object-create-proto.ts](conformance/lib-object-create-proto.ts) | Class values stand in for prototypes: an instance without its constructor run (unset fields are zero values); `getPrototypeOf` gives the class |
443
+ | `Object.assign` keeps types: a typed target updated in place, `Object.assign({}, typed, { overrides })` a copy of the same type | ✅ | [syntax-object-assign-typed.ts](conformance/syntax-object-assign-typed.ts) | Function fields and methods are copied; an explicit `undefined` override clears the field |
444
+ | Integer-like keys of plain objects listed first, ascending | ✅ | [lib-object-key-order.ts](conformance/lib-object-key-order.ts) | `Object.keys`, `JSON.stringify` and `for…in`; Maps keep plain insertion order |
445
+ | `Object.defineProperty(this, k, { value, writable })` in a constructor | ✅ | [lib-object-define-property.ts](conformance/lib-object-define-property.ts) | Sets the field (or the record entry) |
446
+ | A `Record` built from an object's spread; an object stored where a `Record` is expected and read back | ✅ | [lib-record-spread-objects.ts](conformance/lib-record-spread-objects.ts) | A parameter may shadow a Node import of the same name |
307
447
 
308
448
  ### `String`
309
449
 
310
- | API | Status | Probe | Notes |
311
- | --------------------------------------------------------- | :----: | ---------------------------------------------------------------------- | ----------------------------------------------------------- |
312
- | Template literals | ✅ | [syntax-template-literals.ts](conformance/syntax-template-literals.ts) | Backtick strings with `${expr}` interpolation |
313
- | Tagged templates | ✅ | [syntax-tagged-templates.ts](conformance/syntax-tagged-templates.ts) | Desugared to `tag([...strings], ...values)` |
314
- | `toUpperCase` / `toLowerCase` | ✅ | [lib-string-basics.ts](conformance/lib-string-basics.ts) | Via `strings` package |
315
- | `trim` / `trimStart` / `trimEnd` | ✅ | [lib-string-basics.ts](conformance/lib-string-basics.ts) | Via `strings` package |
316
- | `split` / `join` | ✅ | [lib-string-split-join.ts](conformance/lib-string-split-join.ts) | Via `strings` package |
317
- | `includes` / `startsWith` / `endsWith` / `indexOf` (with `fromIndex`) | ✅ | [lib-string-search.ts](conformance/lib-string-search.ts) | Via `strings` package |
318
- | `replace` / `replaceAll` (string pattern) | ✅ | [lib-string-replace.ts](conformance/lib-string-replace.ts) | Via `strings` package |
319
- | `replace` / `replaceAll` (RegExp, `$1`/`$&`, fn replacer) | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | `/g` vs first match, `$1`/`$&` patterns, function replacers |
320
- | `charAt` / `substring` / `slice` | ✅ | [lib-string-slice.ts](conformance/lib-string-slice.ts) | Direct Go string indexing/slicing |
321
- | `charCodeAt` / `String.fromCharCode` | ✅ | [lib-string-char-codes.ts](conformance/lib-string-char-codes.ts) | `charCodeAt` reads the byte; `String.fromCharCode` → `string(rune(n))` |
322
- | `concat` / `repeat` | ✅ | [lib-string-pad-repeat.ts](conformance/lib-string-pad-repeat.ts) | Concatenation and `strings.Repeat` |
323
- | `padStart` / `padEnd` | ✅ | [lib-string-pad-repeat.ts](conformance/lib-string-pad-repeat.ts) | Via `strings.Repeat` |
324
- | `localeCompare` | ✅ | [lib-string-compare.ts](conformance/lib-string-compare.ts) | `strings.Compare` → -1/0/1 |
325
- | `match` / `matchAll` / `search` | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Via `regexp` package (`String.match` with groups) |
326
- | `at` (negative indices) | ✅ | [lib-array-at.ts](conformance/lib-array-at.ts) | Supports negative indices |
327
- | Unicode length / iteration | ✅ | [lib-string-unicode.ts](conformance/lib-string-unicode.ts) | `.length` counts runes; `[...str]` spreads runes |
328
- | `String.raw` | ✅ | [lib-string-raw.ts](conformance/lib-string-raw.ts) | Raw template text with values interpolated |
329
- | `normalize` | ✅ | [lib-string-normalize.ts](conformance/lib-string-normalize.ts) | `golang.org/x/text/unicode/norm`, copied from GOROOT's vendor tree (offline) |
450
+ | API | Status | Probe | Notes |
451
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
452
+ | Template literals | ✅ | [syntax-template-literals.ts](conformance/syntax-template-literals.ts) | Backtick strings with `${expr}` interpolation |
453
+ | Tagged templates | ✅ | [syntax-tagged-templates.ts](conformance/syntax-tagged-templates.ts) | Desugared to `tag([...strings], ...values)` |
454
+ | `toUpperCase` / `toLowerCase` | ✅ | [lib-string-basics.ts](conformance/lib-string-basics.ts) | Via `strings` package |
455
+ | `trim` / `trimStart` / `trimEnd` | ✅ | [lib-string-basics.ts](conformance/lib-string-basics.ts) | Via `strings` package |
456
+ | `split` / `join` | ✅ | [lib-string-split-join.ts](conformance/lib-string-split-join.ts) | Via `strings` package |
457
+ | `includes` / `startsWith` / `endsWith` / `indexOf` (with `fromIndex`) | ✅ | [lib-string-search.ts](conformance/lib-string-search.ts) | Via `strings` package |
458
+ | `replace` / `replaceAll` (string pattern) | ✅ | [lib-string-replace.ts](conformance/lib-string-replace.ts) | Via `strings` package |
459
+ | `replace` / `replaceAll` (RegExp, `$1`/`$&`, fn replacer) | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | `/g` vs first match, `$1`/`$&` patterns, function replacers |
460
+ | `charAt` / `substring` / `slice` | ✅ | [lib-string-slice.ts](conformance/lib-string-slice.ts) | Direct Go string indexing/slicing |
461
+ | `charCodeAt` / `String.fromCharCode` | ✅ | [lib-string-char-codes.ts](conformance/lib-string-char-codes.ts) | `charCodeAt` reads the byte; `String.fromCharCode` → `string(rune(n))` |
462
+ | `concat` / `repeat` | ✅ | [lib-string-pad-repeat.ts](conformance/lib-string-pad-repeat.ts) | Concatenation and `strings.Repeat` |
463
+ | `padStart` / `padEnd` | ✅ | [lib-string-pad-repeat.ts](conformance/lib-string-pad-repeat.ts) | Via `strings.Repeat` |
464
+ | `localeCompare` | ✅ | [lib-string-compare.ts](conformance/lib-string-compare.ts) | `strings.Compare` → -1/0/1: code-unit order, not locale-aware |
465
+ | `match` / `matchAll` / `search` | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Via `regexp` package (`String.match` with groups) |
466
+ | `at` (negative indices) | ✅ | [lib-array-at.ts](conformance/lib-array-at.ts) | Supports negative indices |
467
+ | Unicode length / iteration | ✅ | [lib-string-unicode.ts](conformance/lib-string-unicode.ts) | `.length` counts runes; `[...str]` spreads runes |
468
+ | `String.raw` | ✅ | [lib-string-raw.ts](conformance/lib-string-raw.ts) | Raw template text with values interpolated |
469
+ | `normalize` | ✅ | [lib-string-normalize.ts](conformance/lib-string-normalize.ts) | `golang.org/x/text/unicode/norm`, copied from GOROOT's vendor tree (offline) |
470
+ | `split(sep, limit)` / `lastIndexOf(s, fromIndex)` | ✅ | [lib-builtins-statics.ts](conformance/lib-builtins-statics.ts) | |
471
+ | `localeCompare(s, locales, options)` | ❌ | — | Locales / options are not declared; the comparison is by code unit |
472
+ | `codePointAt` / `String.fromCodePoint` / `substr` / `trimLeft` / `trimRight` / `isWellFormed` / `toWellFormed` / `toLocaleUpperCase` / `toLocaleLowerCase` | ✅ | [lib-builtins-statics.ts](conformance/lib-builtins-statics.ts) | `codePointAt` past the end is `NaN` (JS: `undefined`); the locale variants ignore the locale |
473
+ | Positions in non-ASCII text (length, indexing, `indexOf`, `slice`, regex `index` / `lastIndex`) | ✅ | [lib-string-code-points.ts](conformance/lib-string-code-points.ts) | Every API counts the same units: one per character in the BMP (code points beyond it count once, not as two UTF-16 units) |
474
+ | `replace` with a `string \| RegExp` pattern, a function value as the replacer, `undefined` groups, an offset parameter | ✅ | [lib-string-replace-forms.ts](conformance/lib-string-replace-forms.ts) | |
475
+ | `toUpperCase` / `toLowerCase` as JS maps case | ✅ | [lib-string-case-mapping.ts](conformance/lib-string-case-mapping.ts) | `ß` → `SS`, `fi` → `FI`, `İ` → `i̇`, `ẞ` → `ß`, final `ς` |
476
+ | `split(sep, limit)` (string and RegExp separators); `trim` / `trimStart` / `trimEnd`; strings built with `+=` in a loop | ✅ | [lib-string-split-trim.ts](conformance/lib-string-split-trim.ts) | Trims JS whitespace (U+0085 and U+200B are not); loop accumulators are `strings.Builder`s, so building a long string is linear |
330
477
 
331
478
  ### `Array`
332
479
 
333
- | API | Status | Probe | Notes |
334
- | --------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------------- | ----------------------------------- |
335
- | `push` / `pop` | ✅ | [lib-array-push-pop.ts](conformance/lib-array-push-pop.ts) | Basic stack operations |
336
- | `shift` / `unshift` | ✅ | [lib-array-shift-unshift.ts](conformance/lib-array-shift-unshift.ts) | Queue operations |
337
- | `join` / `reverse` | ✅ | [lib-array-reverse-join.ts](conformance/lib-array-reverse-join.ts) | `join()` defaults to `","`; `reverse` reverses in place and returns the array |
338
- | `slice` | ✅ | [lib-array-slice.ts](conformance/lib-array-slice.ts) | Negative indices count from the end |
339
- | `splice` | ✅ | [lib-array-splice.ts](conformance/lib-array-splice.ts) | Removes and returns elements in place, inserting extra arguments |
340
- | `sort` (default, lexicographic) | ✅ | [semantics-default-sort.ts](conformance/semantics-default-sort.ts) | String sort by default |
341
- | `sort` (comparator) | ✅ | [lib-array-sort-comparator.ts](conformance/lib-array-sort-comparator.ts) | Comparator lowered into `sort.SliceStable` |
342
- | `flat` / `flatMap` | ✅ | [lib-array-flat-flatmap.ts](conformance/lib-array-flat-flatmap.ts) | One-level `flat`; `flatMap` appends callback results |
343
- | `at` | ✅ | [lib-array-at.ts](conformance/lib-array-at.ts) | Supports negative indices |
344
- | `fill` | ✅ | [lib-array-fill.ts](conformance/lib-array-fill.ts) | `new Array<T>(n)` → `make([]T, n)`; `fill` assigns in place |
345
- | `Array.from` | ✅ | [lib-array-from.ts](conformance/lib-array-from.ts) | Array-likes read `length`; the callback gets the index |
346
- | `Array.isArray` | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Type check on values |
347
- | `map` / `filter` / `reduce` | ✅ | [lib-array-map-filter-reduce.ts](conformance/lib-array-map-filter-reduce.ts) | Incl. chaining and object arrays |
348
- | `some` / `every` | ✅ | [lib-array-some-every.ts](conformance/lib-array-some-every.ts) | Predicate quantifiers |
349
- | `find` / `findIndex` / `findLast` / `findLastIndex` | ✅ | [lib-array-find.ts](conformance/lib-array-find.ts) | `findLast`/`findLastIndex` search from the end |
350
- | `forEach` | ✅ | [lib-map-iteration.ts](conformance/lib-map-iteration.ts) | Block-body callbacks; `Map.forEach` |
351
- | `includes` / `indexOf` / `lastIndexOf` | ✅ | [lib-array-search.ts](conformance/lib-array-search.ts) | `lastIndexOf` searches from the end |
352
- | `entries` / `keys` / `values` | ✅ | [lib-array-entries.ts](conformance/lib-array-entries.ts) | `[index, value]` pairs destructured in `for...of` |
353
- | `length` truncation (`arr.length = 0`) | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Clear via length assignment |
354
- | `filter(Boolean)` | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Constructor as predicate |
355
- | `concat` | ✅ | [lib-array-concat.ts](conformance/lib-array-concat.ts) | Arrays flattened one level, values appended |
356
- | `reduceRight` | ✅ | [lib-array-reduce-right.ts](conformance/lib-array-reduce-right.ts) | `reduce` over a reversed copy |
357
- | `copyWithin` | ✅ | [lib-array-copy-within.ts](conformance/lib-array-copy-within.ts) | Go `copy` (overlap-safe) |
358
- | Change-preserving copies (`toSorted` / `toReversed` / `with`) | ✅ | [lib-array-copies.ts](conformance/lib-array-copies.ts) | Clone, then sort / reverse / set |
359
- | `toSpliced` | ✅ | [lib-array-to-spliced.ts](conformance/lib-array-to-spliced.ts) | `slices.Concat` of the kept parts |
480
+ | API | Status | Probe | Notes |
481
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
482
+ | `push` / `pop` | ✅ | [lib-array-push-pop.ts](conformance/lib-array-push-pop.ts) | Basic stack operations |
483
+ | `shift` / `unshift` | ✅ | [lib-array-shift-unshift.ts](conformance/lib-array-shift-unshift.ts) | Queue operations |
484
+ | `join` / `reverse` | ✅ | [lib-array-reverse-join.ts](conformance/lib-array-reverse-join.ts) | `join()` defaults to `","`; `reverse` reverses in place and returns the array |
485
+ | `toString()` / `String(arr)` / `` `${arr}` `` | ✅ | [syntax-array-to-string.ts](conformance/syntax-array-to-string.ts) | Elements joined with `,` (nested arrays flatten) |
486
+ | `slice` | ✅ | [lib-array-slice.ts](conformance/lib-array-slice.ts) | Negative indices count from the end |
487
+ | `splice` | ✅ | [lib-array-splice.ts](conformance/lib-array-splice.ts) | Removes and returns elements in place, inserting extra arguments |
488
+ | `sort` (default, lexicographic) | ✅ | [semantics-default-sort.ts](conformance/semantics-default-sort.ts) | String sort by default |
489
+ | `sort` (comparator) | ✅ | [lib-array-sort-comparator.ts](conformance/lib-array-sort-comparator.ts) | Comparator lowered into `sort.SliceStable` |
490
+ | `flat` / `flatMap` | ✅ | [lib-array-flat-flatmap.ts](conformance/lib-array-flat-flatmap.ts) | One-level `flat`; `flatMap` appends callback results |
491
+ | `at` | ✅ | [lib-array-at.ts](conformance/lib-array-at.ts) | Supports negative indices |
492
+ | `fill` | ✅ | [lib-array-fill.ts](conformance/lib-array-fill.ts) | `new Array<T>(n)` → `make([]T, n)`; `fill` assigns in place |
493
+ | `Array.from` | ✅ | [lib-array-from.ts](conformance/lib-array-from.ts) | Array-likes read `length`; the callback gets the index |
494
+ | `Array.isArray` | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Type check on values |
495
+ | `map` / `filter` / `reduce` | ✅ | [lib-array-map-filter-reduce.ts](conformance/lib-array-map-filter-reduce.ts) | Incl. chaining and object arrays |
496
+ | `some` / `every` | ✅ | [lib-array-some-every.ts](conformance/lib-array-some-every.ts) | Predicate quantifiers |
497
+ | `find` / `findIndex` / `findLast` / `findLastIndex` | ✅ | [lib-array-find.ts](conformance/lib-array-find.ts) | `findLast`/`findLastIndex` search from the end |
498
+ | `forEach` | ✅ | [lib-map-iteration.ts](conformance/lib-map-iteration.ts) | Block-body callbacks; `Map.forEach` |
499
+ | `includes` / `indexOf` / `lastIndexOf` | ✅ | [lib-array-search.ts](conformance/lib-array-search.ts) | `lastIndexOf` searches from the end |
500
+ | `entries` / `keys` / `values` | ✅ | [lib-array-entries.ts](conformance/lib-array-entries.ts) | `[index, value]` pairs destructured in `for...of` |
501
+ | `length` truncation (`arr.length = 0`) | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Clear via length assignment |
502
+ | `filter(Boolean)` | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Constructor as predicate |
503
+ | `concat` | ✅ | [lib-array-concat.ts](conformance/lib-array-concat.ts) | Arrays flattened one level, values appended |
504
+ | `reduceRight` | ✅ | [lib-array-reduce-right.ts](conformance/lib-array-reduce-right.ts) | `reduce` over a reversed copy |
505
+ | `copyWithin` | ✅ | [lib-array-copy-within.ts](conformance/lib-array-copy-within.ts) | Go `copy` (overlap-safe) |
506
+ | Change-preserving copies (`toSorted` / `toReversed` / `with`) | ✅ | [lib-array-copies.ts](conformance/lib-array-copies.ts) | Clone, then sort / reverse / set |
507
+ | `toSpliced` | ✅ | [lib-array-to-spliced.ts](conformance/lib-array-to-spliced.ts) | `slices.Concat` of the kept parts |
508
+ | `Array.of` | ✅ | [lib-builtins-statics.ts](conformance/lib-builtins-statics.ts) | |
509
+ | Iterator helpers on generators (`map` / `filter` / `flatMap` / `take` / `drop` / `toArray` / `forEach` / `some` / `every` / `find` / `reduce`), `Iterator.from(array)` | ✅ | [lib-iterator-helpers.ts](conformance/lib-iterator-helpers.ts) | Lazy (works on infinite generators): one goroutine per stage |
510
+ | `Array.fromAsync` | ❌ | — | Not declared |
511
+ | `[...map.keys()]` / `[...map.values()]` | ✅ | [lib-group-by.ts](conformance/lib-group-by.ts) | |
512
+ | `anyArray.concat([…])` with an array of another element type (`xs.concat(['x'])` on `any[]`) | ❌ | — | Go build error; spread instead (`[...xs, 'x']`) |
360
513
 
361
514
  ### `Map` / `Set`
362
515
 
363
- | API | Status | Probe | Notes |
364
- | -------------------------------------------------------- | :----: | ------------------------------------------------------------------ | ------------------------------------------------------- |
365
- | `Map` (`set` / `get` / `has` / `delete` / `size`) | ✅ | [lib-map.ts](conformance/lib-map.ts) | `Map<K, V>` → Go `map[K]V`; constructor with entries |
366
- | `Map` iteration (`for...of`, destructuring) | ✅ | [lib-map-iteration.ts](conformance/lib-map-iteration.ts) | Key/value iteration, `Object.entries()` unwrapping |
367
- | `Set` (`add` / `has` / `delete` / `size`) | ✅ | [lib-set.ts](conformance/lib-set.ts) | `Set<T>` → Go `map[T]struct{}`; constructor with values |
368
- | `Set` iteration / spread | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | `for...of`, `[...set]` |
369
- | `Map.clear` / `Set.clear` | ✅ | [lib-map-clear.ts](conformance/lib-map-clear.ts) | `TnMap.Clear()` |
370
- | `WeakMap` / `WeakSet` | ✅ | [lib-weak-collections.ts](conformance/lib-weak-collections.ts) | Same as `Map` / `Set` (weakness is not observable) |
371
- | Set operations (`union` / `intersection` / `difference`) | ✅ | [lib-set-operations.ts](conformance/lib-set-operations.ts) | Plus `symmetricDifference` / `isSubsetOf` / `isSupersetOf` / `isDisjointFrom` |
516
+ | API | Status | Probe | Notes |
517
+ | ------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
518
+ | `Map` (`set` / `get` / `has` / `delete` / `size`) | ✅ | [lib-map.ts](conformance/lib-map.ts) | `Map<K, V>` → Go `map[K]V`; constructor with entries |
519
+ | `Map` iteration (`for...of`, destructuring) | ✅ | [lib-map-iteration.ts](conformance/lib-map-iteration.ts) | Key/value iteration, `Object.entries()` unwrapping |
520
+ | `Set` (`add` / `has` / `delete` / `size`) | ✅ | [lib-set.ts](conformance/lib-set.ts) | `Set<T>` → Go `map[T]struct{}`; constructor with values |
521
+ | `Set` iteration / spread | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | `for...of`, `[...set]` |
522
+ | `Map.clear` / `Set.clear` | ✅ | [lib-map-clear.ts](conformance/lib-map-clear.ts) | `TnMap.Clear()` |
523
+ | `WeakMap` / `WeakSet` | ✅ | [lib-weak-collections.ts](conformance/lib-weak-collections.ts) | Same as `Map` / `Set` (weakness is not observable) |
524
+ | Set operations (`union` / `intersection` / `difference`) | ✅ | [lib-set-operations.ts](conformance/lib-set-operations.ts) | Plus `symmetricDifference` / `isSubsetOf` / `isSupersetOf` / `isDisjointFrom` |
525
+ | `new Map(iterable)` / `new Set(iterable)` from Maps, iterators, generators, `Object.entries`, strings, `null` | ✅ | [lib-collection-constructors.ts](conformance/lib-collection-constructors.ts) | A Map copy keeps the source's key and value types; plain objects and arrays as keys / members are compared by identity |
372
526
 
373
527
  ### `Number`
374
528
 
375
- | API | Status | Probe | Notes |
376
- | ------------------------------------------------- | :----: | -------------------------------------------------------- | -------------------------------------------------------- |
377
- | `toString` (incl. radix) | ✅ | [lib-number-format.ts](conformance/lib-number-format.ts) | Universal `toString()` via `fmt.Sprintf` for any type |
378
- | `toFixed` | ✅ | [lib-number-format.ts](conformance/lib-number-format.ts) | `n.toFixed(2)` via `strconv.FormatFloat` |
379
- | `parseInt` / `parseFloat` / `Number()` | ✅ | [lib-number-parse.ts](conformance/lib-number-parse.ts) | Mapped to Go's `strconv` package |
380
- | `Number.isInteger` / `isNaN` / `MAX_SAFE_INTEGER` | ✅ | [lib-number-checks.ts](conformance/lib-number-checks.ts) | Number predicates and constants |
381
- | `Number.EPSILON` / `isFinite` / `toPrecision` | ✅ | [lib-number-misc.ts](conformance/lib-number-misc.ts) | `toPrecision` → `strconv.FormatFloat(x, 'g', n, 64)` |
382
- | `String()` / `Boolean()` conversions | ✅ | [lib-conversions.ts](conformance/lib-conversions.ts) | JS formatting / truthiness |
529
+ | API | Status | Probe | Notes |
530
+ | -------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------- | ------------------------------------------------------------------- |
531
+ | `toString` (incl. radix) | ✅ | [lib-number-format.ts](conformance/lib-number-format.ts) | Universal `toString()` via `fmt.Sprintf` for any type |
532
+ | `toFixed` | ✅ | [lib-number-format.ts](conformance/lib-number-format.ts) | `n.toFixed(2)` via `strconv.FormatFloat` |
533
+ | `parseInt` / `parseFloat` / `Number()` | ✅ | [lib-number-parse.ts](conformance/lib-number-parse.ts) | Mapped to Go's `strconv` package |
534
+ | `Number.isInteger` / `isNaN` / `MAX_SAFE_INTEGER` | ✅ | [lib-number-checks.ts](conformance/lib-number-checks.ts) | Number predicates and constants |
535
+ | `Number.MIN_SAFE_INTEGER` / `MAX_VALUE` | ✅ | — | |
536
+ | `Number.EPSILON` / `isFinite` / `toPrecision` | ✅ | [lib-number-misc.ts](conformance/lib-number-misc.ts) | `toPrecision` → `strconv.FormatFloat(x, 'g', n, 64)` |
537
+ | `String()` / `Boolean()` conversions | ✅ | [lib-conversions.ts](conformance/lib-conversions.ts) | JS formatting / truthiness |
538
+ | `toExponential` / `Number.isSafeInteger` / `parseInt` / `parseFloat` / `MIN_VALUE` / `NEGATIVE_INFINITY` | ✅ | [lib-builtins-statics.ts](conformance/lib-builtins-statics.ts) | |
539
+ | Number `toLocaleString` | ❌ | — | Needs `Intl` |
540
+ | `toFixed` rounding ties away from zero, ≥ 1e21, on `any` values and in callbacks | ✅ | [lib-number-to-fixed.ts](conformance/lib-number-to-fixed.ts) | `(1.25).toFixed(1)` is `"1.3"` (Go's formatter rounds ties to even) |
383
541
 
384
542
  ### `Date`
385
543
 
386
- | API | Status | Probe | Notes |
387
- | ------------------------------------------------ | :----: | ---------------------------------------------- | ----------------------------- |
388
- | `new Date()` / `getTime` / `toISOString` | ✅ | [lib-date.ts](conformance/lib-date.ts) | `new Date(ms)` → `time.UnixMilli`; `getTime`/`toISOString` mapped to `time.Time` |
389
- | `Date.now()` | ✅ | [lib-date-now.ts](conformance/lib-date-now.ts) | `time.Now().UnixMilli()` |
390
- | Component getters (`getFullYear`, `getMonth`, …) | ✅ | [lib-date-getters.ts](conformance/lib-date-getters.ts) | Local and `getUTC*` getters, `Date.UTC` |
544
+ | API | Status | Probe | Notes |
545
+ | ----------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
546
+ | `new Date()` / `getTime` / `toISOString` | ✅ | [lib-date.ts](conformance/lib-date.ts) | `new Date(ms)` → `time.UnixMilli`; `getTime`/`toISOString` mapped to `time.Time` |
547
+ | `Date.now()` | ✅ | [lib-date-now.ts](conformance/lib-date-now.ts) | `time.Now().UnixMilli()` |
548
+ | Component getters (`getFullYear`, `getMonth`, …) | ✅ | [lib-date-getters.ts](conformance/lib-date-getters.ts) | Local and `getUTC*` getters, `Date.UTC` |
549
+ | `toJSON` / `valueOf`; Invalid Dates (`getTime()` is `NaN`, `toISOString` throws a `RangeError`) | ✅ | [lib-date-parse-set.ts](conformance/lib-date-parse-set.ts) | |
550
+ | `toString` / `toDateString` / `toTimeString` / `toUTCString`, `String(date)`, `` `${date}` `` | ✅ | [lib-date-parse-set.ts](conformance/lib-date-parse-set.ts) | Node's formats in the local zone; long zone names for common zones (`Coordinated Universal Time`, `Central European Standard Time`, …), `GMT±hh:mm` otherwise |
551
+ | `new Date(string)` / `new Date(y, m, d, …)` / `new Date(date)` / `Date.parse` | ✅ | [lib-date-parse-set.ts](conformance/lib-date-parse-set.ts) | ISO strings (date-only UTC, date-times local unless offset) and the formats `toString` / `toUTCString` / common `Month D, YYYY` and `YYYY/MM/DD` forms produce; an unparsable string is an Invalid Date |
552
+ | Setters (`setFullYear`, `setDate`, `setHours`, … and `setUTC*`), `setTime`, `getTimezoneOffset` | ✅ | [lib-date-parse-set.ts](conformance/lib-date-parse-set.ts) | Fields overflow like JS. Dates are values: a setter updates the variable or field it is called on, not other references to the same Date |
553
+ | `toLocaleDateString` / `toLocaleTimeString` / `toLocaleString` | ✅ | [lib-date-parse-set.ts](conformance/lib-date-parse-set.ts) | `en-US` format; locales and options are ignored |
554
+ | Date arithmetic and ordering (`b - a`, `+d`, `a < b`) | ✅ | [semantics-date-arithmetic.ts](conformance/semantics-date-arithmetic.ts) | The time value in milliseconds; `any` operands of `-` `*` `/` `%` convert with ToNumber |
391
555
 
392
556
  ### `RegExp`
393
557
 
394
- | API | Status | Probe | Notes |
395
- | ------------------------------------------------------ | :----: | -------------------------------------------------------------------- | --------------------------------------------------- |
396
- | Regex literals | ✅ | [lib-regex-test.ts](conformance/lib-regex-test.ts) | `/pattern/flags` transpiled to `regexp.MustCompile` |
397
- | `new RegExp()` | ✅ | [lib-regex-test.ts](conformance/lib-regex-test.ts) | Constructor with optional flags |
398
- | `test()` | ✅ | [lib-regex-test.ts](conformance/lib-regex-test.ts) | Mapped to `regexp.MatchString` |
399
- | `exec()` (groups) | ✅ | [lib-regex-groups.ts](conformance/lib-regex-groups.ts) | Mapped to `regexp.FindStringSubmatch` |
400
- | Flags (`i`, `m`) | ✅ | [lib-regex-flags.ts](conformance/lib-regex-flags.ts) | Case-insensitive, multiline |
401
- | Backreferences | ✅ | [lib-regex-backreference.ts](conformance/lib-regex-backreference.ts) | Backreference patterns run on a small backtracking engine |
402
- | Named groups | ✅ | [lib-regex-named-groups.ts](conformance/lib-regex-named-groups.ts) | `(?<name>` → `(?P<name>`; `exec` returns a match with `.groups` |
403
- | Global `exec` loop (`/g` + `lastIndex`) | ✅ | [lib-regex-global-exec.ts](conformance/lib-regex-global-exec.ts) | /g regexes carry `lastIndex` state in the `TnRegex` wrapper |
404
- | Lookbehind | ✅ | [lib-regex-lookbehind.ts](conformance/lib-regex-lookbehind.ts) | Lookaround patterns run on the backtracking engine |
405
- | Remaining flags (`s` / `u` / `y`) & `source` / `flags` | ✅ | [lib-regex-more-flags.ts](conformance/lib-regex-more-flags.ts) | Sticky matching, `\u{…}` escapes, `lastIndex` / `source` / `flags` / flag getters |
406
- | `split` with RegExp | ✅ | [lib-regex-split.ts](conformance/lib-regex-split.ts) | `re.Split(s, -1)` |
558
+ | API | Status | Probe | Notes |
559
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
560
+ | Regex literals | ✅ | [lib-regex-test.ts](conformance/lib-regex-test.ts) | `/pattern/flags` transpiled to `regexp.MustCompile` |
561
+ | `new RegExp()` | ✅ | [lib-regex-test.ts](conformance/lib-regex-test.ts) | Constructor with optional flags |
562
+ | `test()` | ✅ | [lib-regex-test.ts](conformance/lib-regex-test.ts) | Mapped to `regexp.MatchString` |
563
+ | `exec()` (groups) | ✅ | [lib-regex-groups.ts](conformance/lib-regex-groups.ts) | Mapped to `regexp.FindStringSubmatch` |
564
+ | Flags (`i`, `m`) | ✅ | [lib-regex-flags.ts](conformance/lib-regex-flags.ts) | Case-insensitive, multiline |
565
+ | Backreferences | ✅ | [lib-regex-backreference.ts](conformance/lib-regex-backreference.ts) | Backreference patterns run on a small backtracking engine |
566
+ | Named groups | ✅ | [lib-regex-named-groups.ts](conformance/lib-regex-named-groups.ts) | `(?<name>` → `(?P<name>`; `exec` returns a match with `.groups` |
567
+ | Global `exec` loop (`/g` + `lastIndex`) | ✅ | [lib-regex-global-exec.ts](conformance/lib-regex-global-exec.ts) | /g regexes carry `lastIndex` state in the `TnRegex` wrapper |
568
+ | Lookbehind | ✅ | [lib-regex-lookbehind.ts](conformance/lib-regex-lookbehind.ts) | Lookaround patterns run on the backtracking engine |
569
+ | Remaining flags (`s` / `u` / `y`) & `source` / `flags` | ✅ | [lib-regex-more-flags.ts](conformance/lib-regex-more-flags.ts) | Sticky matching, `\u{…}` escapes, `lastIndex` / `source` / `flags` / flag getters |
570
+ | `split` with RegExp | ✅ | [lib-regex-split.ts](conformance/lib-regex-split.ts) | JS semantics: captures are included, `limit` counts items |
571
+ | Match `.index` (`exec` / `match` / `matchAll`), `match` with `/g` | ✅ | [lib-regex-index-split.ts](conformance/lib-regex-index-split.ts) | Character index kept in a hidden slot of the match array; `search` counts characters |
572
+ | Unicode property escapes (`\p{L}`) with `u` | ✅ | — | Go's `regexp` |
573
+ | `d` flag (`indices`); `v` flag; `RegExp.escape` | ❌ | — | |
574
+ | Unmatched groups are `undefined`; sticky (`y`) regexes; lookaround captures; `$&` / `` $` `` / `$'` / `$<name>` / `$$` replacements; replacer offsets | ✅ | [lib-regex-groups-replace.ts](conformance/lib-regex-groups-replace.ts) | `new RegExp(src, 'g')` keeps its flags. An unmatched group still reads as `''` in string comparisons other than `=== undefined` |
575
+ | JS escapes in every pattern, also those the backtracking engine runs (backreferences, lookaround): `\xHH`, `\uHHHH`, `\u{…}`, `\cJ`, `\p{…}` / `\P{…}`, `\k<name>`; `\s` as JS's Unicode whitespace | ✅ | [lib-regex-escapes.ts](conformance/lib-regex-escapes.ts) | Group numbers count opening parentheses, as in JS |
576
+ | RegExp values: in objects, passed around, built at run time (`new RegExp(src, 'g')`), called through `any`; an object cast to `RegExp` | ✅ | [lib-regex-values.ts](conformance/lib-regex-values.ts) | `Object.prototype.toString.call(re)` |
577
+ | Unmatched groups stay `undefined` through a `const`, a conditional and a `string` field (left out of JSON); `xs[i]` past the end into `any` | ✅ | [lib-regex-unmatched-groups.ts](conformance/lib-regex-unmatched-groups.ts) | Such a field is an any field |
407
578
 
408
579
  ### `Promise` / timers
409
580
 
410
- | API | Status | Probe | Notes |
411
- | ---------------------------------------------------- | :----: | ------------------------------------------------------------ | ------------------------------------------------------------------- |
412
- | `Promise` constructor / `.then` | ✅ | [syntax-promise-then.ts](conformance/syntax-promise-then.ts) | Channel lowering works (see [Async & timing](#async--timing)) |
413
- | `resolve` / `reject` passed as values | ✅ | [lib-node-async-hooks.ts](conformance/lib-node-async-hooks.ts) | `new Promise((resolve) => setTimeout(resolve, ms))` |
414
- | `Promise.all` | ✅ | [syntax-promise-all.ts](conformance/syntax-promise-all.ts) | Channel lowering works (see [Async & timing](#async--timing)) |
415
- | `Promise.resolve` | ✅ | [lib-promise-resolve.ts](conformance/lib-promise-resolve.ts) | Buffered channel holding the value |
416
- | `Promise.reject` / `.catch` / `.finally` | ✅ | [lib-promise-catch.ts](conformance/lib-promise-catch.ts) | Rejected promises are closed channels with a reason; `await` rethrows |
417
- | `Promise.race` / `allSettled` / `any` | ✅ | [lib-promise-combinators.ts](conformance/lib-promise-combinators.ts) | Goroutine per promise; first settled / all settled / first fulfilled |
418
- | `clearTimeout` | ✅ | [lib-timers.ts](conformance/lib-timers.ts) | `TnClearTimeout` stops the timer |
419
- | `setInterval` / `clearInterval` | ✅ | [lib-set-interval.ts](conformance/lib-set-interval.ts) | `time.Ticker`; the process lives until cleared |
420
- | `queueMicrotask` | ✅ | [lib-queue-microtask.ts](conformance/lib-queue-microtask.ts) | Runs after the current synchronous code (end of main or a timer callback) |
421
- | `setTimeout` | ✅ | [lib-set-timeout.ts](conformance/lib-set-timeout.ts) | Lowered to `time.AfterFunc` (see [Async & timing](#async--timing)) |
581
+ See [Async & timing](#async--timing): `Promise` (constructor, `.then` / `.catch` / `.finally`,
582
+ `resolve` / `reject` / `all` / `race` / `allSettled` / `any`), `setTimeout`, `setInterval`,
583
+ `queueMicrotask` and their `clear*` functions, plus the gaps.
422
584
 
423
585
  ### Misc globals
424
586
 
425
- | API | Status | Probe | Notes |
426
- | ------------------------------------------- | :----: | ------------------------------------------------------------------ | ---------------------------------------- |
427
- | `assert` | ✅ | [lib-console-log.ts](conformance/lib-console-log.ts) | Transpiled to `panic` on failure |
428
- | `process.argv` / `process.platform` | ✅ | [lib-process.ts](conformance/lib-process.ts) | Node's shapes (`[execPath, script, ...args]`, `win32`); the rest of `process` is in [node:process](#nodeprocess) |
429
- | `process.env` | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Environment variable access |
430
- | `process.exit` | ✅ | [lib-process-exit.ts](conformance/lib-process-exit.ts) | `os.Exit`, after `process.on('exit')` listeners |
431
- | `process.cwd()` | ✅ | [lib-process-cwd.ts](conformance/lib-process-cwd.ts) | `os.Getwd()` |
432
- | `Buffer` / `Uint8Array` / `TextEncoder` / `TextDecoder` / `atob` / `btoa` | ✅ | [lib-node-buffer-encodings.ts](conformance/lib-node-buffer-encodings.ts) | See [node:buffer](#nodebuffer) |
433
- | `URL` / `URLSearchParams` | ✅ | [lib-node-url-class.ts](conformance/lib-node-url-class.ts) | See [node:url](#nodeurl) |
434
- | `EventTarget` / `Event` / `AbortController` / `AbortSignal` | ✅ | [lib-node-abort.ts](conformance/lib-node-abort.ts) | See [node:events](#nodeevents) |
435
- | `performance` / `setImmediate` / `crypto` | ✅ | [lib-node-perf-hooks.ts](conformance/lib-node-perf-hooks.ts) | See [perf_hooks](#nodeperf_hooks), [timers](#nodetimers), [crypto](#nodecrypto) |
436
- | `TypeError` / `RangeError` / `SyntaxError` & co. | ✅ | [lib-node-assert.ts](conformance/lib-node-assert.ts) | `TnError`s carrying their `name`; `instanceof` checks the name |
437
- | `Infinity` | ✅ | [lib-globals.ts](conformance/lib-globals.ts) | `math.Inf(1)` |
438
- | Global `isNaN` / `isFinite` | ✅ | [lib-globals.ts](conformance/lib-globals.ts) | `math.IsNaN` / `math.IsInf` |
439
- | `encodeURIComponent` / `decodeURIComponent` | ✅ | [lib-uri.ts](conformance/lib-uri.ts) | `TnEncodeURIComponent` / `url.PathUnescape` |
440
- | `structuredClone` | ✅ | [lib-structured-clone.ts](conformance/lib-structured-clone.ts) | Reflection deep copy |
441
- | `fetch` / `Headers` / `Request` / `Response` | ✅ | [lib-node-fetch.ts](conformance/lib-node-fetch.ts) | See [fetch](#fetch) |
442
- | `ReadableStream` / `WritableStream` / `TransformStream` & co., `TextEncoderStream` / `TextDecoderStream`, `CompressionStream` / `DecompressionStream` | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | See [stream/web](#nodestreamweb) |
443
- | `Blob` / `File` / `FormData` | ✅ | [lib-node-blob.ts](conformance/lib-node-blob.ts) | See [buffer](#nodebuffer) and [fetch](#fetch) |
444
- | `MessageChannel` / `MessagePort` / `BroadcastChannel` | ✅ | [lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts) | See [worker_threads](#nodeworker_threads) |
445
- | `__filename` / `__dirname` | ✅ | — | The running executable (a native binary has no script file) |
446
- | `globalThis` | ✅ | [lib-global-this.ts](conformance/lib-global-this.ts) | `globalThis.x` is the global `x`; `(globalThis as any)` is a dynamic object |
587
+ | API | Status | Probe | Notes |
588
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
589
+ | `assert` | ✅ | [lib-console-log.ts](conformance/lib-console-log.ts) | Transpiled to `panic` on failure |
590
+ | `process.argv` / `process.platform` | ✅ | [lib-process.ts](conformance/lib-process.ts) | Node's shapes (`[execPath, script, ...args]`, `win32`); the rest of `process` is in [node:process](#nodeprocess) |
591
+ | `process.env` | ✅ | [syntax-top-level-scope.ts](conformance/syntax-top-level-scope.ts) | Environment variable access |
592
+ | `process.exit` | ✅ | [lib-process-exit.ts](conformance/lib-process-exit.ts) | `os.Exit`, after `process.on('exit')` listeners |
593
+ | `process.cwd()` | ✅ | [lib-process-cwd.ts](conformance/lib-process-cwd.ts) | `os.Getwd()` |
594
+ | `Buffer` / `Uint8Array` / `TextEncoder` / `TextDecoder` / `atob` / `btoa` | ✅ | [lib-node-buffer-encodings.ts](conformance/lib-node-buffer-encodings.ts) | See [node:buffer](#nodebuffer) |
595
+ | `URL` / `URLSearchParams` | ✅ | [lib-node-url-class.ts](conformance/lib-node-url-class.ts) | See [node:url](#nodeurl) |
596
+ | `EventTarget` / `Event` / `AbortController` / `AbortSignal` | ✅ | [lib-node-abort.ts](conformance/lib-node-abort.ts) | See [node:events](#nodeevents) |
597
+ | `performance` / `setImmediate` / `crypto` | ✅ | [lib-node-perf-hooks.ts](conformance/lib-node-perf-hooks.ts) | See [perf_hooks](#nodeperf_hooks), [timers](#nodetimers), [crypto](#nodecrypto) |
598
+ | `TypeError` / `RangeError` / `SyntaxError` & co. | ✅ | [lib-node-assert.ts](conformance/lib-node-assert.ts) | `TnError`s carrying their `name`; `instanceof` checks the name |
599
+ | `Infinity` | ✅ | [lib-globals.ts](conformance/lib-globals.ts) | `math.Inf(1)` |
600
+ | Global `isNaN` / `isFinite` | ✅ | [lib-globals.ts](conformance/lib-globals.ts) | `math.IsNaN` / `math.IsInf` |
601
+ | `encodeURIComponent` / `decodeURIComponent` | ✅ | [lib-uri.ts](conformance/lib-uri.ts) | `TnEncodeURIComponent` / `url.PathUnescape` |
602
+ | `structuredClone` | ✅ | [lib-structured-clone.ts](conformance/lib-structured-clone.ts) | Reflection deep copy |
603
+ | `fetch` / `Headers` / `Request` / `Response` | ✅ | [lib-node-fetch.ts](conformance/lib-node-fetch.ts) | See [fetch](#fetch) |
604
+ | `ReadableStream` / `WritableStream` / `TransformStream` & co., `TextEncoderStream` / `TextDecoderStream`, `CompressionStream` / `DecompressionStream` | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | See [stream/web](#nodestreamweb) |
605
+ | `Blob` / `File` / `FormData` | ✅ | [lib-node-blob.ts](conformance/lib-node-blob.ts) | See [buffer](#nodebuffer) and [fetch](#fetch) |
606
+ | `MessageChannel` / `MessagePort` / `BroadcastChannel` | ✅ | [lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts) | See [worker_threads](#nodeworker_threads) |
607
+ | `__filename` / `__dirname` | ✅ | — | The running executable (a native binary has no script file) |
608
+ | `globalThis` | ✅ | [lib-global-this.ts](conformance/lib-global-this.ts) | `globalThis.x` is the global `x`; `(globalThis as any)` is a dynamic object |
609
+ | `err.stack` | ✅ | [lib-error-stack.ts](conformance/lib-error-stack.ts) | `Name: message` and an `at fn (file.ts:line)` line per TS frame (no columns), from `runtime.Callers` and the `//line` directives |
610
+ | `AggregateError` (`errors`) | ✅ | [lib-error-stack.ts](conformance/lib-error-stack.ts) | |
611
+ | `Error.captureStackTrace` / `Error.isError` / `DOMException` | ❌ | — | Not declared |
612
+ | `Symbol.for` / `Symbol.keyFor` / `description` | ✅ | [lib-builtins-statics.ts](conformance/lib-builtins-statics.ts) | A global registry by key |
613
+ | `[Symbol.asyncIterator]()` methods; `Symbol.toPrimitive` / `hasInstance` / `toStringTag` | ❌ | — | Only `Symbol()`, `Symbol.iterator` and `Symbol.dispose` are lowered |
614
+ | `WeakRef` / `FinalizationRegistry` | ✅ | [lib-weak-refs.ts](conformance/lib-weak-refs.ts) | Go's `weak` package and `runtime.AddCleanup`; cleanup callbacks run on the event loop. Targets must be objects (pointers) |
615
+ | `Reflect` (`ownKeys` / `has` / `get` / `set` / …) | ❌ | — | Feasible over the existing dynamic property access |
616
+ | `Proxy` | 🚫 | — | Intercepting every property access on static Go structs; a `Proxy` limited to dynamic (`any`) objects would be feasible |
617
+ | `Intl` (`NumberFormat`, `DateTimeFormat`, `Collator`, `PluralRules`, `ListFormat`, `RelativeTimeFormat`, `Segmenter`), `toLocaleString` | ❌ | — | Needs locale data (vendored `golang.org/x/text`, or hand-written `en-US` first) |
618
+ | `Temporal` | ❌ | — | Feasible on Go's `time` and tzdata |
619
+ | `WebSocket` / `navigator` / `CustomEvent` / `URLPattern` / `EventSource` / `reportError` | ❌ | — | Not declared |
620
+ | `WebAssembly` | ❌ | — | Needs a Wasm runtime: vendoring wazero (pure Go, no cgo) would provide one (see [wasi](#nodewasi)) |
621
+ | `Function` as a value (`const Type = Function`), `x instanceof Function` | ✅ | [syntax-error-subclass-idiom.ts](conformance/syntax-error-subclass-idiom.ts) | An opaque sentinel; `instanceof Function` checks for a function value |
447
622
 
448
623
  ### Node builtins (`node:*`)
449
624
 
@@ -454,392 +629,415 @@ named, default or namespace imports; subpaths (`fs/promises`, `path/posix`,
454
629
  completions and events run on one event loop, one at a time, as in Node; an
455
630
  async function runs synchronously until its first `await`.
456
631
 
457
- | Module | Status | Section |
458
- | ------------------------------------------- | :----: | ---------------------------------------------------------- |
459
- | `node:assert` / `node:assert/strict` | ✅ | [assert](#nodeassert) |
460
- | `node:async_hooks` | ✅ | [async_hooks](#nodeasync_hooks) |
461
- | `node:buffer` (+ globals `Buffer`, `Uint8Array`, `atob`, `btoa`, `Blob`, `File`) | ✅ | [buffer](#nodebuffer) |
462
- | `node:child_process` | ✅ | [child_process](#nodechild_process) |
463
- | `node:cluster` | ✅ | [cluster](#nodecluster) |
464
- | `node:console` | ✅ | [console](#nodeconsole) |
465
- | `node:constants` | ✅ | [constants](#nodeconstants--nodesys) |
466
- | `node:crypto` (+ global `crypto`) | ✅ | [crypto](#nodecrypto) |
467
- | `node:dgram` | ✅ | [dgram](#nodedgram) |
468
- | `node:diagnostics_channel` | ✅ | [diagnostics_channel](#nodediagnostics_channel) |
469
- | `node:dns` / `node:dns/promises` | ✅ | [dns](#nodedns) |
470
- | `node:domain` | ❌ | [domain](#nodedomain) |
471
- | `node:events` (+ `EventTarget`, `AbortController`) | ✅ | [events](#nodeevents) |
472
- | `node:fs` / `node:fs/promises` | ✅ | [fs](#nodefs) |
473
- | `node:http` / `node:https` | ✅ | [http / https](#nodehttp--nodehttps) |
474
- | `node:http2` | ✅ | [http2](#nodehttp2) |
475
- | `node:inspector` | ❌ | [inspector](#nodeinspector) |
476
- | `node:module` | ❌ | [module](#nodemodule) |
477
- | `node:net` | ✅ | [net](#nodenet) |
478
- | `node:os` | ✅ | [os](#nodeos) |
479
- | `node:path` / `path/posix` / `path/win32` | ✅ | [path](#nodepath) |
480
- | `node:perf_hooks` (+ global `performance`) | ✅ | [perf_hooks](#nodeperf_hooks) |
481
- | `node:process` (+ global `process`) | ✅ | [process](#nodeprocess) |
482
- | `node:punycode` | ✅ | [punycode](#nodepunycode) |
483
- | `node:querystring` | ✅ | [querystring](#nodequerystring) |
484
- | `node:readline` / `node:readline/promises` | ✅ | [readline](#nodereadline) |
485
- | `node:repl` | ❌ | [repl](#noderepl) |
486
- | `node:sea` | ❌ | [sea](#nodesea) |
487
- | `node:sqlite` | ✅ | [sqlite](#nodesqlite) |
488
- | `node:stream` / `stream/promises` / `stream/consumers` | ✅ | [stream](#nodestream) |
489
- | `node:stream/web` (+ globals `ReadableStream`, `WritableStream`, `TransformStream`, …) | ✅ | [stream/web](#nodestreamweb) |
490
- | `node:string_decoder` | ✅ | [string_decoder](#nodestring_decoder) |
491
- | `node:sys` | ✅ | [constants / sys](#nodeconstants--nodesys) |
492
- | `node:test` | ✅ | [test](#nodetest) |
493
- | `node:test/reporters` | ❌ | [test/reporters](#nodetestreporters) |
494
- | `node:timers` / `node:timers/promises` | ✅ | [timers](#nodetimers) |
495
- | `node:tls` | ✅ | [tls](#nodetls) |
496
- | `node:trace_events` | ❌ | [trace_events](#nodetrace_events) |
497
- | `node:tty` | ✅ | [tty](#nodetty) |
498
- | `node:url` (+ globals `URL`, `URLSearchParams`) | ✅ | [url](#nodeurl) |
499
- | `node:util` / `node:util/types` | ✅ | [util](#nodeutil) |
500
- | `node:v8` | ❌ | [v8](#nodev8) |
501
- | `node:vm` | ❌ | [vm](#nodevm) |
502
- | `node:wasi` | ❌ | [wasi](#nodewasi) |
503
- | `node:worker_threads` (+ globals `MessageChannel`, `MessagePort`, `BroadcastChannel`) | ✅ | [worker_threads](#nodeworker_threads) |
504
- | `node:zlib` | ✅ | [zlib](#nodezlib) |
505
- | Global `fetch` (+ `Headers`, `Request`, `Response`, `FormData`) | ✅ | [fetch](#fetch) |
632
+ | Module | Status | Section |
633
+ | -------------------------------------------------------------------------------------- | :----: | ----------------------------------------------- |
634
+ | `node:assert` / `node:assert/strict` | ✅ | [assert](#nodeassert) |
635
+ | `node:async_hooks` | ✅ | [async_hooks](#nodeasync_hooks) |
636
+ | `node:buffer` (+ globals `Buffer`, `Uint8Array`, `atob`, `btoa`, `Blob`, `File`) | ✅ | [buffer](#nodebuffer) |
637
+ | `node:child_process` | ✅ | [child_process](#nodechild_process) |
638
+ | `node:cluster` | ✅ | [cluster](#nodecluster) |
639
+ | `node:console` | ✅ | [console](#nodeconsole) |
640
+ | `node:constants` | ✅ | [constants](#nodeconstants--nodesys) |
641
+ | `node:crypto` (+ global `crypto`) | ✅ | [crypto](#nodecrypto) |
642
+ | `node:dgram` | ✅ | [dgram](#nodedgram) |
643
+ | `node:diagnostics_channel` | ✅ | [diagnostics_channel](#nodediagnostics_channel) |
644
+ | `node:dns` / `node:dns/promises` | ✅ | [dns](#nodedns) |
645
+ | `node:domain` | 🚫 | [domain](#nodedomain) |
646
+ | `node:events` (+ `EventTarget`, `AbortController`) | ✅ | [events](#nodeevents) |
647
+ | `node:fs` / `node:fs/promises` | ✅ | [fs](#nodefs) |
648
+ | `node:http` / `node:https` | ✅ | [http / https](#nodehttp--nodehttps) |
649
+ | `node:http2` | ✅ | [http2](#nodehttp2) |
650
+ | `node:inspector` | 🚫 | [inspector](#nodeinspector) |
651
+ | `node:module` | ✅ | [module](#nodemodule) |
652
+ | `node:net` | ✅ | [net](#nodenet) |
653
+ | `node:os` | ✅ | [os](#nodeos) |
654
+ | `node:path` / `path/posix` / `path/win32` | ✅ | [path](#nodepath) |
655
+ | `node:perf_hooks` (+ global `performance`) | ✅ | [perf_hooks](#nodeperf_hooks) |
656
+ | `node:process` (+ global `process`) | ✅ | [process](#nodeprocess) |
657
+ | `node:punycode` | ✅ | [punycode](#nodepunycode) |
658
+ | `node:querystring` | ✅ | [querystring](#nodequerystring) |
659
+ | `node:readline` / `node:readline/promises` | ✅ | [readline](#nodereadline) |
660
+ | `node:repl` | 🚫 | [repl](#noderepl) |
661
+ | `node:sea` | ✅ | [sea](#nodesea) |
662
+ | `node:sqlite` | ✅ | [sqlite](#nodesqlite) |
663
+ | `node:stream` / `stream/promises` / `stream/consumers` | ✅ | [stream](#nodestream) |
664
+ | `node:stream/web` (+ globals `ReadableStream`, `WritableStream`, `TransformStream`, …) | ✅ | [stream/web](#nodestreamweb) |
665
+ | `node:string_decoder` | ✅ | [string_decoder](#nodestring_decoder) |
666
+ | `node:sys` | ✅ | [constants / sys](#nodeconstants--nodesys) |
667
+ | `node:test` | ✅ | [test](#nodetest) |
668
+ | `node:test/reporters` | ✅ | [test/reporters](#nodetestreporters) |
669
+ | `node:timers` / `node:timers/promises` | ✅ | [timers](#nodetimers) |
670
+ | `node:tls` | ✅ | [tls](#nodetls) |
671
+ | `node:trace_events` | 🚫 | [trace_events](#nodetrace_events) |
672
+ | `node:tty` | ✅ | [tty](#nodetty) |
673
+ | `node:url` (+ globals `URL`, `URLSearchParams`) | ✅ | [url](#nodeurl) |
674
+ | `node:util` / `node:util/types` | ✅ | [util](#nodeutil) |
675
+ | `node:v8` | ✅ | [v8](#nodev8) |
676
+ | `node:vm` | 🚫 | [vm](#nodevm) |
677
+ | `node:wasi` | ❌ | [wasi](#nodewasi) |
678
+ | `node:worker_threads` (+ globals `MessageChannel`, `MessagePort`, `BroadcastChannel`) | ✅ | [worker_threads](#nodeworker_threads) |
679
+ | `node:zlib` | ✅ | [zlib](#nodezlib) |
680
+ | Global `fetch` (+ `Headers`, `Request`, `Response`, `FormData`) | ✅ | [fetch](#fetch) |
506
681
 
507
682
  #### `node:path`
508
683
 
509
- | API | Status | Probe | Notes |
510
- | ------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------ | --------------------------------------------------------------------- |
511
- | `join` / `dirname` / `basename` / `extname` / `resolve` | ✅ | [lib-node-path.ts](conformance/lib-node-path.ts) | Ports of Node's algorithms (not Go's `filepath`): same results as Node |
512
- | `normalize` / `relative` / `isAbsolute` / `parse` / `format` / `sep` / `delimiter` | ✅ | [lib-node-path-more.ts](conformance/lib-node-path-more.ts) | Trailing separators, `.bashrc`-style extensions, `''` for same paths |
513
- | `path.posix` / `path.win32` / `node:path/posix` / `toNamespacedPath` | ✅ | [lib-node-path-posix-win32.ts](conformance/lib-node-path-posix-win32.ts) | Both flavours on every OS (drive letters, UNC roots); `path` is the platform's |
514
- | `matchesGlob` (`*`, `**`, `?`, `[...]`, `{a,b}`; no leading-dot matches) | ✅ | [lib-node-path-glob.ts](conformance/lib-node-path-glob.ts) | minimatch-style patterns compiled to regular expressions |
684
+ | API | Status | Probe | Notes |
685
+ | ---------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
686
+ | `join` / `dirname` / `basename` / `extname` / `resolve` | ✅ | [lib-node-path.ts](conformance/lib-node-path.ts) | Ports of Node's algorithms (not Go's `filepath`): same results as Node |
687
+ | `normalize` / `relative` / `isAbsolute` / `parse` / `format` / `sep` / `delimiter` | ✅ | [lib-node-path-more.ts](conformance/lib-node-path-more.ts) | Trailing separators, `.bashrc`-style extensions, `''` for same paths |
688
+ | `path.posix` / `path.win32` / `node:path/posix` / `toNamespacedPath` | ✅ | [lib-node-path-posix-win32.ts](conformance/lib-node-path-posix-win32.ts) | Both flavours on every OS (drive letters, UNC roots); `path` is the platform's |
689
+ | `matchesGlob` (`*`, `**`, `?`, `[...]`, `{a,b}`; no leading-dot matches) | ✅ | [lib-node-path-glob.ts](conformance/lib-node-path-glob.ts) | minimatch-style patterns compiled to regular expressions |
515
690
 
516
691
  #### `node:buffer`
517
692
 
518
- | API | Status | Probe | Notes |
519
- | --------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
520
- | `Buffer.from` / `alloc` / `concat` / `byteLength` / `isBuffer` / `compare`; `buf[i]`, `length` | ✅ | [lib-node-buffer.ts](conformance/lib-node-buffer.ts) | Buffers are Go `[]byte`; `subarray` / `slice` share memory; writes wrap modulo 256 |
521
- | `toString` / `equals` / `indexOf` / `includes` / `fill` / `write` / `copy` | ✅ | [lib-node-buffer.ts](conformance/lib-node-buffer.ts) | `` `${buf}` `` decodes UTF-8; `console.log(buf)` prints `<Buffer 68 69>` |
522
- | Encodings (utf8, hex, base64, base64url, latin1, ascii, utf16le); `atob` / `btoa` | ✅ | [lib-node-buffer-encodings.ts](conformance/lib-node-buffer-encodings.ts) | Invalid UTF-8 bytes decode to U+FFFD, as in Node |
523
- | `TextEncoder` / `TextDecoder` (`decode(bytes, { stream: true })`), minimal `Uint8Array` | ✅ | [lib-node-buffer-encodings.ts](conformance/lib-node-buffer-encodings.ts) | `Uint8Array` is `[]byte` too: `length`, indexing, `subarray`, `slice`, `set` |
524
- | `read*` / `write*` (U)Int8/16/32 LE/BE, Float, Double | ✅ | [lib-node-buffer-binary.ts](conformance/lib-node-buffer-binary.ts) | Out-of-range offsets throw `ERR_OUT_OF_RANGE` |
525
- | `Blob` / `File` (`size`, `type`, `name`, `lastModified`, `text()` / `bytes()` / `arrayBuffer()`, `slice`, `stream()`); parts of strings, Buffers and Blobs | ✅ | [lib-node-blob.ts](conformance/lib-node-blob.ts) | Also globals; bytes held in memory |
526
- | `read/writeBigInt64LE/BE`, `read/writeBigUInt64LE/BE`, `swap16/32/64`; `isUtf8` / `isAscii` / `transcode` / `kMaxLength` | ✅ | [lib-node-buffer-bigint.ts](conformance/lib-node-buffer-bigint.ts) | bigints are `*big.Int` |
527
- | Typed arrays (`Int8Array`, `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array`, `Float64Array`): indexing, `length` / `byteLength` / `buffer`, `from` / `of`, `fill` / `set` / `subarray` / `slice` / `copyWithin`, `map` / `filter` / `reduce` / `forEach` & co., `sort` / `toSorted`, `join`, `for…of`, spread; `ArrayBuffer` (`slice`, `isView`); `DataView` (all getters / setters incl. BigInt64) | ✅ | [lib-typed-arrays.ts](conformance/lib-typed-arrays.ts) | One Go slice per element type; views on an `ArrayBuffer` share its memory. Writes convert like JS (wrapping, clamping). A view's `.buffer` is its own bytes (`byteOffset` 0). Out-of-range reads give `0`, not `undefined`. `BigInt64Array` / `BigUint64Array` are not implemented |
693
+ | API | Status | Probe | Notes |
694
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----: | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
695
+ | `Buffer.from` / `alloc` / `concat` / `byteLength` / `isBuffer` / `compare`; `buf[i]`, `length` | ✅ | [lib-node-buffer.ts](conformance/lib-node-buffer.ts) | Buffers are Go `[]byte`; `subarray` / `slice` share memory; writes wrap modulo 256 |
696
+ | `toString` / `equals` / `indexOf` / `includes` / `fill` / `write` / `copy` | ✅ | [lib-node-buffer.ts](conformance/lib-node-buffer.ts) | `` `${buf}` `` decodes UTF-8; `console.log(buf)` prints `<Buffer 68 69>` |
697
+ | Encodings (utf8, hex, base64, base64url, latin1, ascii, utf16le); `atob` / `btoa` | ✅ | [lib-node-buffer-encodings.ts](conformance/lib-node-buffer-encodings.ts) | Invalid UTF-8 bytes decode to U+FFFD, as in Node |
698
+ | `TextEncoder` / `TextDecoder` (`decode(bytes, { stream: true })`), minimal `Uint8Array` | ✅ | [lib-node-buffer-encodings.ts](conformance/lib-node-buffer-encodings.ts) | `Uint8Array` is `[]byte` too: `length`, indexing, `subarray`, `slice`, `set` |
699
+ | `read*` / `write*` (U)Int8/16/32 LE/BE, Float, Double | ✅ | [lib-node-buffer-binary.ts](conformance/lib-node-buffer-binary.ts) | Out-of-range offsets throw `ERR_OUT_OF_RANGE` |
700
+ | `Blob` / `File` (`size`, `type`, `name`, `lastModified`, `text()` / `bytes()` / `arrayBuffer()`, `slice`, `stream()`); parts of strings, Buffers and Blobs | ✅ | [lib-node-blob.ts](conformance/lib-node-blob.ts) | Also globals; bytes held in memory |
701
+ | `read/writeBigInt64LE/BE`, `read/writeBigUInt64LE/BE`, `swap16/32/64`; `isUtf8` / `isAscii` / `transcode` / `kMaxLength` | ✅ | [lib-node-buffer-bigint.ts](conformance/lib-node-buffer-bigint.ts) | bigints are `*big.Int` |
702
+ | Typed arrays (`Int8Array`, `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array`, `Float64Array`): indexing, `length` / `byteLength` / `buffer`, `from` / `of`, `fill` / `set` / `subarray` / `slice` / `copyWithin`, `map` / `filter` / `reduce` / `forEach` & co., `sort` / `toSorted`, `join`, `for…of`, spread; `ArrayBuffer` (`slice`, `isView`); `DataView` (all getters / setters incl. BigInt64) | ✅ | [lib-typed-arrays.ts](conformance/lib-typed-arrays.ts) | One Go slice per element type; views on an `ArrayBuffer` share its memory. Writes convert like JS (wrapping, clamping). A view's `.buffer` is its own bytes (`byteOffset` 0). Out-of-range reads give `0`, not `undefined`. |
703
+ | `BigInt64Array` / `BigUint64Array` | ❌ | — | `DataView` already has the BigInt64 accessors |
704
+ | `Float16Array`, resizable `ArrayBuffer` (`resize`, `transfer`), `Uint8Array` `toBase64` / `fromBase64` / `toHex` / `fromHex` | ❌ | — | Not declared |
705
+ | `JSON.stringify(buffer)`, `buf.toJSON()` | ✅ | [lib-buffer-json.ts](conformance/lib-buffer-json.ts) | `{"type":"Buffer","data":[…]}`, keys in that order |
528
706
 
529
707
  #### `node:fs`
530
708
 
531
- | API | Status | Probe | Notes |
532
- | --------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
533
- | `readFileSync` / `writeFileSync` / `appendFileSync` / `existsSync` / `rmSync` | ✅ | [lib-node-fs.ts](conformance/lib-node-fs.ts) | `readFileSync` returns a Buffer without an encoding, a string with one; `flag` option |
534
- | `statSync` / `lstatSync` (`Stats`) / `renameSync` / `copyFileSync` / `truncateSync` / `realpathSync` / `accessSync` / `unlinkSync` | ✅ | [lib-node-fs-stat.ts](conformance/lib-node-fs-stat.ts) | `throwIfNoEntry: false`; Go exposes only the modification time portably, so `atime` / `ctime` / `birthtime` report it too |
535
- | `mkdirSync` / `mkdtempSync` / `readdirSync` (`withFileTypes`, `recursive`) / `rmdirSync` / `cpSync` | ✅ | [lib-node-fs-dirs.ts](conformance/lib-node-fs-dirs.ts) | `Dirent` with `isFile()` / `isDirectory()` / `parentPath` |
536
- | Node system errors (`err.code` / `syscall` / `path` / `errno`) | ✅ | [lib-node-fs-errors.ts](conformance/lib-node-fs-errors.ts) | `ENOENT: no such file or directory, open 'x'`; `EEXIST`, `ENOTEMPTY`, `ERR_FS_EISDIR`, `COPYFILE_EXCL` |
537
- | File descriptors: `openSync` / `readSync` / `writeSync` / `fstatSync` / `closeSync` | ✅ | [lib-node-fs-fd.ts](conformance/lib-node-fs-fd.ts) | Flags `r`, `w`, `a`, `+`, `x`; positional reads and writes |
538
- | Callback API (`readFile(path, enc, (err, data) => …)` & co.) | ✅ | [lib-node-fs-callbacks.ts](conformance/lib-node-fs-callbacks.ts) | Work runs on a goroutine; callbacks run on the event loop |
539
- | `fs/promises` / `fs.promises` (incl. `FileHandle` from `open`) | ✅ | [lib-node-fs-promises.ts](conformance/lib-node-fs-promises.ts) | Rejections carry the error code |
540
- | `createReadStream` / `createWriteStream` | ✅ | [lib-node-fs-streams.ts](conformance/lib-node-fs-streams.ts) | `encoding`, `start` / `end`, `highWaterMark`, `flags` |
541
- | `chmodSync` / `utimesSync` / `symlinkSync` / `readlinkSync` / `linkSync` | ✅ | — | Implemented, not probed (symlinks need privileges on Windows) |
542
- | `watch` (`recursive`, `persistent`, `signal`, `ref` / `unref`, `'change'` / `'error'` / `'close'`) / `watchFile` / `unwatchFile`; `fs/promises` `watch` | ✅ | [lib-node-fs-watch.ts](conformance/lib-node-fs-watch.ts) | `watch` uses the OS's notifications through the vendored `fsnotify` (only linked into programs that call it); recursive watches add subdirectories as they appear. `watchFile` polls `stat()` |
709
+ | API | Status | Probe | Notes |
710
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
711
+ | `readFileSync` / `writeFileSync` / `appendFileSync` / `existsSync` / `rmSync` | ✅ | [lib-node-fs.ts](conformance/lib-node-fs.ts) | `readFileSync` returns a Buffer without an encoding, a string with one; `flag` option |
712
+ | `statSync` / `lstatSync` (`Stats`) / `renameSync` / `copyFileSync` / `truncateSync` / `realpathSync` / `accessSync` / `unlinkSync` | ✅ | [lib-node-fs-stat.ts](conformance/lib-node-fs-stat.ts) | `throwIfNoEntry: false`; Go exposes only the modification time portably, so `atime` / `ctime` / `birthtime` report it too |
713
+ | `mkdirSync` / `mkdtempSync` / `readdirSync` (`withFileTypes`, `recursive`) / `rmdirSync` / `cpSync` | ✅ | [lib-node-fs-dirs.ts](conformance/lib-node-fs-dirs.ts) | `Dirent` with `isFile()` / `isDirectory()` / `parentPath` |
714
+ | Node system errors (`err.code` / `syscall` / `path` / `errno`) | ✅ | [lib-node-fs-errors.ts](conformance/lib-node-fs-errors.ts) | `ENOENT: no such file or directory, open 'x'`; `EEXIST`, `ENOTEMPTY`, `ERR_FS_EISDIR`, `COPYFILE_EXCL` |
715
+ | File descriptors: `openSync` / `readSync` / `writeSync` / `fstatSync` / `closeSync` | ✅ | [lib-node-fs-fd.ts](conformance/lib-node-fs-fd.ts) | Flags `r`, `w`, `a`, `+`, `x`; positional reads and writes |
716
+ | Callback API (`readFile(path, enc, (err, data) => …)` & co.) | ✅ | [lib-node-fs-callbacks.ts](conformance/lib-node-fs-callbacks.ts) | Work runs on a goroutine; callbacks run on the event loop |
717
+ | `fs/promises` / `fs.promises` (incl. `FileHandle` from `open`) | ✅ | [lib-node-fs-promises.ts](conformance/lib-node-fs-promises.ts) | Rejections carry the error code |
718
+ | `createReadStream` / `createWriteStream` | ✅ | [lib-node-fs-streams.ts](conformance/lib-node-fs-streams.ts) | `encoding`, `start` / `end`, `highWaterMark`, `flags` |
719
+ | `chmodSync` / `utimesSync` / `symlinkSync` / `readlinkSync` / `linkSync` | ✅ | — | Implemented, not probed (symlinks need privileges on Windows) |
720
+ | `watch` (`recursive`, `persistent`, `signal`, `ref` / `unref`, `'change'` / `'error'` / `'close'`) / `watchFile` / `unwatchFile`; `fs/promises` `watch` | ✅ | [lib-node-fs-watch.ts](conformance/lib-node-fs-watch.ts) | `watch` uses the OS's notifications through the vendored `fsnotify` (only linked into programs that call it); recursive watches add subdirectories as they appear. `watchFile` polls `stat()` |
543
721
 
544
722
  #### `node:os`
545
723
 
546
- | API | Status | Probe | Notes |
547
- | -------------------------------------------------------------------------------------------- | :----: | -------------------------------------------- | ----------------------------------------------------------------------- |
548
- | `platform` / `arch` / `type` / `machine` / `EOL` / `devNull` / `endianness` | ✅ | [lib-node-os.ts](conformance/lib-node-os.ts) | Node's names (`win32`, `x64`, `Windows_NT`, `x86_64`) |
549
- | `hostname` / `homedir` / `tmpdir` / `userInfo` / `cpus` / `availableParallelism` / `networkInterfaces` / `constants.signals` | ✅ | [lib-node-os.ts](conformance/lib-node-os.ts) | `cpus()` has one entry per logical CPU (model / speed / times are zero) |
550
- | `totalmem` / `freemem` / `uptime` / `loadavg` / `release` / `version` | ✅ | [lib-node-os-mem.ts](conformance/lib-node-os-mem.ts) | `/proc` on Linux, `sysctl` on macOS / BSD, `GlobalMemoryStatusEx` / `GetTickCount64` on Windows (`loadavg` is zeros there, as in Node) |
724
+ | API | Status | Probe | Notes |
725
+ | ---------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
726
+ | `platform` / `arch` / `type` / `machine` / `EOL` / `devNull` / `endianness` | ✅ | [lib-node-os.ts](conformance/lib-node-os.ts) | Node's names (`win32`, `x64`, `Windows_NT`, `x86_64`) |
727
+ | `hostname` / `homedir` / `tmpdir` / `userInfo` / `cpus` / `availableParallelism` / `networkInterfaces` / `constants.signals` | ✅ | [lib-node-os.ts](conformance/lib-node-os.ts) | `cpus()` has one entry per logical CPU (model / speed / times are zero) |
728
+ | `totalmem` / `freemem` / `uptime` / `loadavg` / `release` / `version` | ✅ | [lib-node-os-mem.ts](conformance/lib-node-os-mem.ts) | `/proc` on Linux, `sysctl` on macOS / BSD, `GlobalMemoryStatusEx` / `GetTickCount64` on Windows (`loadavg` is zeros there, as in Node) |
551
729
 
552
730
  #### `node:process`
553
731
 
554
- | API | Status | Probe | Notes |
555
- | ---------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------- | --------------------------------------------------------------------------- |
556
- | `argv` / `argv0` / `execPath` / `execArgv` / `pid` / `ppid` / `arch` / `version` / `versions` | ✅ | [lib-node-process.ts](conformance/lib-node-process.ts) | `argv` has Node's shape: `[execPath, script, ...args]`; `version` is `v24.0.0`; `versions.go` is Go's |
557
- | `hrtime` / `hrtime.bigint` / `uptime` / `memoryUsage` / `chdir` / `cwd` / `stdout.write` / `nextTick` / `exitCode` | ✅ | [lib-node-process.ts](conformance/lib-node-process.ts) | `exitCode` is applied when the event loop drains |
558
- | `process.env` reads, writes, `delete`, `in`, `Object.keys(process.env)`; `import { env } from 'node:process'` | ✅ | [lib-node-process-env.ts](conformance/lib-node-process-env.ts) | `os.Setenv` / `os.Unsetenv`; missing variables read as `""` |
559
- | `process.on('exit' \| 'SIGINT' \| 'SIGTERM' \| 'SIGHUP')` / `once` / `off` / `emit` | ✅ | [lib-node-process-events.ts](conformance/lib-node-process-events.ts) | `'exit'` runs after the event loop with the exit code; signals arrive on the loop |
560
- | `process.stdin` / `stdout` / `stderr` as streams | ✅ | [lib-node-child-process-async.ts](conformance/lib-node-child-process-async.ts) | `stdin` keeps the process alive only while flowing |
561
- | `kill` / `emitWarning` / `getuid` / `getgid` | ✅ | — | Implemented, not probed |
562
- | `on('uncaughtException')` / `'uncaughtExceptionMonitor'` / `'unhandledRejection'` / `'beforeExit'` (per drain, can schedule more work); `cpuUsage` / `resourceUsage` / `availableMemory` / `loadEnvFile` | ✅ | [lib-node-process-uncaught.ts](conformance/lib-node-process-uncaught.ts), [lib-node-os-mem.ts](conformance/lib-node-os-mem.ts) | Throws in the top-level code, loop callbacks and detached async calls reach the handlers; CPU times from `/proc` (Linux) or Go's runtime metrics |
563
- | `umask` / `stdout.columns` / `setRawMode` | ❌ | — | Need OS-specific syscalls a single portable binary can't contain |
732
+ | API | Status | Probe | Notes |
733
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
734
+ | `argv` / `argv0` / `execPath` / `execArgv` / `pid` / `ppid` / `arch` / `version` / `versions` | ✅ | [lib-node-process.ts](conformance/lib-node-process.ts) | `argv` has Node's shape: `[execPath, script, ...args]`; `version` is `v24.0.0`; `versions.go` is Go's |
735
+ | `hrtime` / `hrtime.bigint` / `uptime` / `memoryUsage` / `chdir` / `cwd` / `stdout.write` / `nextTick` / `exitCode` | ✅ | [lib-node-process.ts](conformance/lib-node-process.ts) | `exitCode` is applied when the event loop drains |
736
+ | `process.env` reads, writes, `delete`, `in`, `Object.keys(process.env)`; `import { env } from 'node:process'` | ✅ | [lib-node-process-env.ts](conformance/lib-node-process-env.ts) | `os.Setenv` / `os.Unsetenv`; missing variables read as `""` |
737
+ | `process.on('exit' \| 'SIGINT' \| 'SIGTERM' \| 'SIGHUP')` / `once` / `off` / `emit` | ✅ | [lib-node-process-events.ts](conformance/lib-node-process-events.ts) | `'exit'` runs after the event loop with the exit code; signals arrive on the loop |
738
+ | `process.stdin` / `stdout` / `stderr` as streams | ✅ | [lib-node-child-process-async.ts](conformance/lib-node-child-process-async.ts) | `stdin` keeps the process alive only while flowing |
739
+ | `stdout.write(data, callback)` / `stderr.write(data, callback)` | ✅ | [lib-process-write-callback.ts](conformance/lib-process-write-callback.ts) | The callback runs after the current code once the data is written; output is flushed before exit |
740
+ | `kill` / `emitWarning` / `getuid` / `getgid` | ✅ | — | Implemented, not probed |
741
+ | `on('uncaughtException')` / `'uncaughtExceptionMonitor'` / `'unhandledRejection'` / `'beforeExit'` (per drain, can schedule more work); `cpuUsage` / `resourceUsage` / `availableMemory` / `loadEnvFile` | ✅ | [lib-node-process-uncaught.ts](conformance/lib-node-process-uncaught.ts), [lib-node-os-mem.ts](conformance/lib-node-os-mem.ts) | Throws in the top-level code, loop callbacks and detached async calls reach the handlers; CPU times from `/proc` (Linux) or Go's runtime metrics |
742
+ | `stdout.columns` / `rows` / `getWindowSize()` (and `stderr`), `stdin.setRawMode` / `isRaw`, `umask` | ✅ | [lib-node-process-tty.ts](conformance/lib-node-process-tty.ts) | A per-OS helper: `TIOCGWINSZ` and termios ioctls (Linux, macOS, FreeBSD), the console API (Windows). `columns` / `rows` are `0`, not `undefined`, when not a terminal (`columns \|\| 80` still works); raw mode is libuv's and is undone at exit; `setRawMode` throws when stdin isn't a terminal. No raw mode on Linux PowerPC / MIPS, no `umask` on Windows (`0`, as in Node); no `'resize'` event |
743
+ | `emitWarning(warning, type)` | ✅ | [lib-process-emit-warning.ts](conformance/lib-process-emit-warning.ts) | `(node:PID) <type>: <message>` on stderr, and Node's `--trace-warnings` hint after the first one |
564
744
 
565
745
  #### `node:console`
566
746
 
567
- | API | Status | Probe | Notes |
568
- | ----------------------------------------------------------- | :----: | ---------------------------------------------------------- | ------------------------------------------------------- |
569
- | Module re-export (`import { log } from 'node:console'`) | ✅ | [lib-node-console-class.ts](conformance/lib-node-console-class.ts) | Same as the global `console` |
570
- | `new Console(stdout, stderr)` / `new Console({ stdout, stderr })` | ✅ | [lib-node-console-class.ts](conformance/lib-node-console-class.ts) | `log` / `info` / `debug` / `error` / `warn` / `dir` |
747
+ | API | Status | Probe | Notes |
748
+ | ----------------------------------------------------------------- | :----: | ------------------------------------------------------------------ | --------------------------------------------------- |
749
+ | Module re-export (`import { log } from 'node:console'`) | ✅ | [lib-node-console-class.ts](conformance/lib-node-console-class.ts) | Same as the global `console` |
750
+ | `new Console(stdout, stderr)` / `new Console({ stdout, stderr })` | ✅ | [lib-node-console-class.ts](conformance/lib-node-console-class.ts) | `log` / `info` / `debug` / `error` / `warn` / `dir` |
571
751
 
572
752
  #### `node:util`
573
753
 
574
- | API | Status | Probe | Notes |
575
- | ------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
576
- | `format` / `formatWithOptions` (`%s %d %i %f %j %o %O %c %%`) | ✅ | [lib-node-util-format.ts](conformance/lib-node-util-format.ts) | Extra arguments appended; also used by `console.log` |
577
- | `inspect` (`depth`, `breakLength`, `compact`) | ✅ | [lib-node-util-inspect.ts](conformance/lib-node-util-inspect.ts) | Node's layout rules: single line up to 80 columns, number arrays grouped in columns, `Map(1) {…}`, `ClassName {…}`, `[Circular *1]` |
578
- | `isDeepStrictEqual` / `types.*` (`node:util/types`) / `deprecate` / `stripVTControlCharacters` / `styleText` | ✅ | [lib-node-util-misc.ts](conformance/lib-node-util-misc.ts) | `styleText` colours only TTYs unless `validateStream: false` |
579
- | `promisify` / `callbackify` | ✅ | [lib-node-util-promisify.ts](conformance/lib-node-util-promisify.ts) | Node functions map to their promise versions at compile time (`fs.readFile`, `setTimeout`, `exec`); other functions are wrapped |
580
- | `parseArgs` (short / long / grouped flags, `multiple`, `default`, `strict`, `allowPositionals`, `allowNegative`, `tokens`, Node's errors), `getSystemErrorName` / `getSystemErrorMessage` / `getSystemErrorMap`, `MIMEType` / `MIMEParams`, `parseEnv` (+ `process.loadEnvFile`), `aborted`, `debuglog` (`NODE_DEBUG`), `toUSVString` | ✅ | [lib-node-util-parse-args.ts](conformance/lib-node-util-parse-args.ts) | |
581
- | `inherits` (legacy), `inspect.custom` (symbols), `getCallSites` (V8 stack frames) | ❌ | — | Legacy or engine-specific |
582
- | Node's errno numbers on Windows (libuv's: `ENOENT` is `-4058`) | ❌ | — | errno values are the OS's (Go's `syscall` numbers): the same as Node's on Linux and macOS, but `ENOENT` is `-2` on Windows. `getSystemErrorName(err.errno)` still names any error TypeNative raises |
754
+ | API | Status | Probe | Notes |
755
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
756
+ | `format` / `formatWithOptions` (`%s %d %i %f %j %o %O %c %%`) | ✅ | [lib-node-util-format.ts](conformance/lib-node-util-format.ts) | Extra arguments appended; also used by `console.log` |
757
+ | `inspect` (`depth`, `breakLength`, `compact`) | ✅ | [lib-node-util-inspect.ts](conformance/lib-node-util-inspect.ts) | Node's layout rules: single line up to 80 columns, number arrays grouped in columns, `Map(1) {…}`, `ClassName {…}`, `[Circular *1]` |
758
+ | `isDeepStrictEqual` / `types.*` (`node:util/types`) / `deprecate` / `stripVTControlCharacters` / `styleText` | ✅ | [lib-node-util-misc.ts](conformance/lib-node-util-misc.ts) | `styleText` colours only TTYs unless `validateStream: false` |
759
+ | `promisify` / `callbackify` | ✅ | [lib-node-util-promisify.ts](conformance/lib-node-util-promisify.ts) | Node functions map to their promise versions at compile time (`fs.readFile`, `setTimeout`, `exec`); other functions are wrapped |
760
+ | `parseArgs` (short / long / grouped flags, `multiple`, `default`, `strict`, `allowPositionals`, `allowNegative`, `tokens`, Node's errors), `getSystemErrorName` / `getSystemErrorMessage` / `getSystemErrorMap`, `MIMEType` / `MIMEParams`, `parseEnv` (+ `process.loadEnvFile`), `aborted`, `debuglog` (`NODE_DEBUG`), `toUSVString` | ✅ | [lib-node-util-parse-args.ts](conformance/lib-node-util-parse-args.ts) | |
761
+ | `inspect.custom` methods, `getCallSites` | ❌ | — | `[inspect.custom]()` can lower to a method like `[Symbol.dispose]()`; `getCallSites` can read `runtime.Callers`, which reports `.ts` lines through the `//line` directives |
762
+ | `inherits` (legacy) | 🚫 | — | Rewrites prototypes; classes are static Go structs |
763
+ | Node's errno numbers per OS (`err.errno`, `getSystemErrorMap`) | ✅ | [lib-node-errno.ts](conformance/lib-node-errno.ts) | libuv's table, generated into `src/node/errno_tables.ts`: the OS's errno on Unix (`ECONNREFUSED` is `-111` on Linux, `-61` on macOS) and libuv's fixed numbers on Windows (`ENOENT` is `-4058`). Messages are libuv's; the map matches Node's on Linux entry for entry |
764
+ | `parseArgs` result typed from the `options` config | ✅ | [lib-util-parse-args-typed.ts](conformance/lib-util-parse-args-typed.ts) | `values.json` is a `boolean`, `values.indent` a `string` |
583
765
 
584
766
  #### `node:assert`
585
767
 
586
- | API | Status | Probe | Notes |
587
- | ----------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------- | --------------------------------------------------------------------------- |
588
- | `assert` / `ok` / `equal` / `strictEqual` (+ `not*`) / `match` / `throws` / `doesNotThrow` / `fail` / `ifError`; `node:assert/strict` | ✅ | [lib-node-assert.ts](conformance/lib-node-assert.ts) | Failures throw an `AssertionError` (`code: 'ERR_ASSERTION'`, `actual`, `expected`, `operator`); `throws` validates with a RegExp, class or object |
589
- | `deepEqual` / `deepStrictEqual` (+ `not*`) / `rejects` / `doesNotReject` | ✅ | [lib-node-assert-deep.ts](conformance/lib-node-assert-deep.ts) | Key order is ignored for objects, Maps and Sets; failure messages are simplified (no diff) |
768
+ | API | Status | Probe | Notes |
769
+ | ------------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
770
+ | `assert` / `ok` / `equal` / `strictEqual` (+ `not*`) / `match` / `throws` / `doesNotThrow` / `fail` / `ifError`; `node:assert/strict` | ✅ | [lib-node-assert.ts](conformance/lib-node-assert.ts) | Failures throw an `AssertionError` (`code: 'ERR_ASSERTION'`, `actual`, `expected`, `operator`); `throws` validates with a RegExp, class or object |
771
+ | `deepEqual` / `deepStrictEqual` (+ `not*`) / `rejects` / `doesNotReject` | ✅ | [lib-node-assert-deep.ts](conformance/lib-node-assert-deep.ts) | Key order is ignored for objects, Maps and Sets; failure messages are simplified (no diff) |
590
772
 
591
773
  #### `node:url`
592
774
 
593
- | API | Status | Probe | Notes |
594
- | -------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
595
- | `fileURLToPath` / `pathToFileURL` | ✅ | [lib-node-url.ts](conformance/lib-node-url.ts) | `pathToFileURL` returns a `URL`; Windows drive letters |
596
- | `URL` (WHATWG): parsing, relative resolution, getters / setters, `canParse`, `parse`; `domainToASCII` / `domainToUnicode`; `format` | ✅ | [lib-node-url-class.ts](conformance/lib-node-url-class.ts) | Special schemes, dot segments, default ports, percent-encode sets, IDN hosts (punycode); invalid input throws `ERR_INVALID_URL` |
597
- | `URLSearchParams` (and `url.searchParams`, kept in sync) | ✅ | [lib-node-url-search-params.ts](conformance/lib-node-url-search-params.ts) | `for...of`, `forEach`, `sort`, construction from strings / objects / pairs |
598
- | Legacy `url.parse` / `url.resolve` | ❌ | — | Deprecated upstream; not implemented |
775
+ | API | Status | Probe | Notes |
776
+ | ----------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
777
+ | `fileURLToPath` / `pathToFileURL` | ✅ | [lib-node-url.ts](conformance/lib-node-url.ts) | `pathToFileURL` returns a `URL`; Windows drive letters |
778
+ | `URL` (WHATWG): parsing, relative resolution, getters / setters, `canParse`, `parse`; `domainToASCII` / `domainToUnicode`; `format` | ✅ | [lib-node-url-class.ts](conformance/lib-node-url-class.ts) | Special schemes, dot segments, default ports, percent-encode sets, IDN hosts (punycode); invalid input throws `ERR_INVALID_URL` |
779
+ | `URLSearchParams` (and `url.searchParams`, kept in sync) | ✅ | [lib-node-url-search-params.ts](conformance/lib-node-url-search-params.ts) | `for...of`, `forEach`, `sort`, construction from strings / objects / pairs |
780
+ | Legacy `url.parse` / `url.resolve` | ❌ | — | Deprecated upstream, but a pure port is feasible |
599
781
 
600
782
  #### `node:querystring`
601
783
 
602
- | API | Status | Probe | Notes |
603
- | --------------------------------------------------------------------- | :----: | ------------------------------------------------------------ | ------------------------------------------ |
604
- | `parse` / `stringify` / `escape` / `unescape` / `decode` / `encode` | ✅ | [lib-node-querystring.ts](conformance/lib-node-querystring.ts) | Repeated keys become arrays; custom separators |
784
+ | API | Status | Probe | Notes |
785
+ | ------------------------------------------------------------------- | :----: | -------------------------------------------------------------- | ---------------------------------------------- |
786
+ | `parse` / `stringify` / `escape` / `unescape` / `decode` / `encode` | ✅ | [lib-node-querystring.ts](conformance/lib-node-querystring.ts) | Repeated keys become arrays; custom separators |
605
787
 
606
788
  #### `node:punycode`
607
789
 
608
- | API | Status | Probe | Notes |
609
- | --------------------------------------------- | :----: | -------------------------------------------------------- | ------------------------------- |
610
- | `encode` / `decode` / `toASCII` / `toUnicode` | ✅ | [lib-node-punycode.ts](conformance/lib-node-punycode.ts) | RFC 3492 (deprecated upstream) |
790
+ | API | Status | Probe | Notes |
791
+ | --------------------------------------------- | :----: | -------------------------------------------------------- | ------------------------------ |
792
+ | `encode` / `decode` / `toASCII` / `toUnicode` | ✅ | [lib-node-punycode.ts](conformance/lib-node-punycode.ts) | RFC 3492 (deprecated upstream) |
611
793
 
612
794
  #### `node:string_decoder`
613
795
 
614
- | API | Status | Probe | Notes |
615
- | --------------------------------------- | :----: | ------------------------------------------------------------------ | ----------------------------------------------------------- |
616
- | `StringDecoder` (`write` / `end`) | ✅ | [lib-node-string-decoder.ts](conformance/lib-node-string-decoder.ts) | Holds back split UTF-8 / UTF-16LE characters and base64 groups |
796
+ | API | Status | Probe | Notes |
797
+ | --------------------------------- | :----: | -------------------------------------------------------------------- | -------------------------------------------------------------- |
798
+ | `StringDecoder` (`write` / `end`) | ✅ | [lib-node-string-decoder.ts](conformance/lib-node-string-decoder.ts) | Holds back split UTF-8 / UTF-16LE characters and base64 groups |
617
799
 
618
800
  #### `node:crypto`
619
801
 
620
- | API | Status | Probe | Notes |
621
- | ------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------- | ------------------------------------------------------------------------- |
622
- | `createHash` / `createHmac` / `hash` / `getHashes` (`update` / `digest` / `copy`) | ✅ | [lib-node-crypto-hash.ts](conformance/lib-node-crypto-hash.ts) | md5, sha1, sha224/256/384/512, sha512-224/256, sha3-224/256/384/512 |
623
- | `randomBytes` / `randomUUID` / `randomInt` / `getRandomValues` / `timingSafeEqual`; global `crypto` | ✅ | [lib-node-crypto-random.ts](conformance/lib-node-crypto-random.ts) | `crypto/rand` |
624
- | `pbkdf2Sync` / `hkdfSync` | ✅ | [lib-node-crypto-kdf.ts](conformance/lib-node-crypto-kdf.ts) | `crypto/pbkdf2` / `crypto/hkdf` (Go 1.24+) |
625
- | `createCipheriv` / `createDecipheriv` (aes-128/192/256-cbc/ctr/gcm) | ✅ | [lib-node-crypto-cipher.ts](conformance/lib-node-crypto-cipher.ts) | GCM output arrives from `final()` (authenticated as a whole) |
626
- | `scryptSync` / `scrypt` (`N` / `r` / `p` / `maxmem` and their aliases); callback forms of `pbkdf2`, `hkdf`, `randomBytes`, `randomFill`; `randomFillSync` | ✅ | [lib-node-crypto-scrypt.ts](conformance/lib-node-crypto-scrypt.ts) | scrypt written out over `crypto/pbkdf2` (Salsa20/8, BlockMix, ROMix); callbacks run on the event loop |
627
- | `KeyObject` (`type`, `asymmetricKeyType`, `asymmetricKeyDetails`, `symmetricKeySize`, `export` as PEM / DER / JWK, `equals`, `KeyObject.from`), `createPrivateKey` / `createPublicKey` / `createSecretKey` (PEM, DER, JWK; pkcs1 / pkcs8 / sec1 / spki; certificates) | ✅ | [lib-node-crypto-keys.ts](conformance/lib-node-crypto-keys.ts) | RSA, EC (P-256 / P-384 / P-521), Ed25519, X25519 |
628
- | `generateKeyPair(Sync)` (`rsa`, `ec`, `ed25519`, `x25519`; KeyObjects or `publicKeyEncoding` / `privateKeyEncoding`), `generateKey(Sync)` (`hmac`, `aes`) | ✅ | [lib-node-crypto-keys.ts](conformance/lib-node-crypto-keys.ts) | RSA keys use the public exponent 65537 |
629
- | `sign` / `verify`, `createSign` / `createVerify` (RSA PKCS#1 v1.5 and PSS with `saltLength`, ECDSA in DER or `ieee-p1363`, Ed25519); `publicEncrypt` / `privateDecrypt` (OAEP with `oaepHash` / `oaepLabel`, PKCS#1, none), `privateEncrypt` / `publicDecrypt`; `crypto.constants` | ✅ | [lib-node-crypto-sign.ts](conformance/lib-node-crypto-sign.ts) | |
630
- | `createECDH` (compressed / uncompressed keys), `getCurves`, `diffieHellman` (ec / x25519 KeyObjects), `createDiffieHellman` / `getDiffieHellman` (modp1 – modp18) | ✅ | [lib-node-crypto-sign.ts](conformance/lib-node-crypto-sign.ts) | `createDiffieHellman(bits)` generates a random (not safe) prime |
631
- | `generatePrime(Sync)` (`bigint`, `safe`, `add` / `rem`), `checkPrime(Sync)` | ✅ | [lib-node-crypto-sign.ts](conformance/lib-node-crypto-sign.ts) | `math/big`'s Miller-Rabin |
632
- | `X509Certificate` (`subject`, `issuer`, `subjectAltName`, `validFrom` / `validTo` (+ `Date`s), fingerprints, `serialNumber`, `ca`, `publicKey`, `raw`, `keyUsage`, `checkHost` / `checkIP` / `checkEmail`, `checkIssued`, `verify`, `toString`, `toLegacyObject`) | ✅ | [lib-node-crypto-keys.ts](conformance/lib-node-crypto-keys.ts) | `crypto/x509` |
633
- | `crypto.subtle` / `webcrypto.subtle`: `digest`, `generateKey`, `importKey` / `exportKey` (`raw`, `spki`, `pkcs8`, `jwk`), `sign` / `verify` (HMAC, RSASSA-PKCS1-v1_5, RSA-PSS, ECDSA, Ed25519), `encrypt` / `decrypt` (AES-GCM / CBC / CTR, RSA-OAEP), `deriveBits` / `deriveKey` (PBKDF2, HKDF, ECDH, X25519), `wrapKey` / `unwrapKey` | ✅ | [lib-node-crypto-subtle.ts](conformance/lib-node-crypto-subtle.ts) | Key usages are recorded but not enforced |
634
- | Encrypted private keys (`passphrase` / `cipher`), `rsa-pss` / `dsa` / `dh` / `ed448` / `x448` key types, `secp256k1`, AES-KW, `Certificate` (SPKAC), `hash` streams (`createHash` as a stream) | ❌ | — | No Go standard-library support (encrypted PKCS#8, these algorithms) |
802
+ | API | Status | Probe | Notes |
803
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
804
+ | `createHash` / `createHmac` / `hash` / `getHashes` (`update` / `digest` / `copy`) | ✅ | [lib-node-crypto-hash.ts](conformance/lib-node-crypto-hash.ts) | md5, sha1, sha224/256/384/512, sha512-224/256, sha3-224/256/384/512 |
805
+ | `randomBytes` / `randomUUID` / `randomInt` / `getRandomValues` / `timingSafeEqual`; global `crypto` | ✅ | [lib-node-crypto-random.ts](conformance/lib-node-crypto-random.ts) | `crypto/rand` |
806
+ | `pbkdf2Sync` / `hkdfSync` | ✅ | [lib-node-crypto-kdf.ts](conformance/lib-node-crypto-kdf.ts) | `crypto/pbkdf2` / `crypto/hkdf` (Go 1.24+) |
807
+ | `createCipheriv` / `createDecipheriv` (aes-128/192/256-cbc/ctr/gcm) | ✅ | [lib-node-crypto-cipher.ts](conformance/lib-node-crypto-cipher.ts) | GCM output arrives from `final()` (authenticated as a whole) |
808
+ | `scryptSync` / `scrypt` (`N` / `r` / `p` / `maxmem` and their aliases); callback forms of `pbkdf2`, `hkdf`, `randomBytes`, `randomFill`; `randomFillSync` | ✅ | [lib-node-crypto-scrypt.ts](conformance/lib-node-crypto-scrypt.ts) | scrypt written out over `crypto/pbkdf2` (Salsa20/8, BlockMix, ROMix); callbacks run on the event loop |
809
+ | `KeyObject` (`type`, `asymmetricKeyType`, `asymmetricKeyDetails`, `symmetricKeySize`, `export` as PEM / DER / JWK, `equals`, `KeyObject.from`), `createPrivateKey` / `createPublicKey` / `createSecretKey` (PEM, DER, JWK; pkcs1 / pkcs8 / sec1 / spki; certificates) | ✅ | [lib-node-crypto-keys.ts](conformance/lib-node-crypto-keys.ts) | RSA, EC (P-256 / P-384 / P-521), Ed25519, X25519 |
810
+ | `generateKeyPair(Sync)` (`rsa`, `ec`, `ed25519`, `x25519`; KeyObjects or `publicKeyEncoding` / `privateKeyEncoding`), `generateKey(Sync)` (`hmac`, `aes`) | ✅ | [lib-node-crypto-keys.ts](conformance/lib-node-crypto-keys.ts) | RSA keys use the public exponent 65537 |
811
+ | `sign` / `verify`, `createSign` / `createVerify` (RSA PKCS#1 v1.5 and PSS with `saltLength`, ECDSA in DER or `ieee-p1363`, Ed25519); `publicEncrypt` / `privateDecrypt` (OAEP with `oaepHash` / `oaepLabel`, PKCS#1, none), `privateEncrypt` / `publicDecrypt`; `crypto.constants` | ✅ | [lib-node-crypto-sign.ts](conformance/lib-node-crypto-sign.ts) | |
812
+ | `createECDH` (compressed / uncompressed keys), `getCurves`, `diffieHellman` (ec / x25519 KeyObjects), `createDiffieHellman` / `getDiffieHellman` (modp1 – modp18) | ✅ | [lib-node-crypto-sign.ts](conformance/lib-node-crypto-sign.ts) | `createDiffieHellman(bits)` generates a random (not safe) prime |
813
+ | `generatePrime(Sync)` (`bigint`, `safe`, `add` / `rem`), `checkPrime(Sync)` | ✅ | [lib-node-crypto-sign.ts](conformance/lib-node-crypto-sign.ts) | `math/big`'s Miller-Rabin |
814
+ | `X509Certificate` (`subject`, `issuer`, `subjectAltName`, `validFrom` / `validTo` (+ `Date`s), fingerprints, `serialNumber`, `ca`, `publicKey`, `raw`, `keyUsage`, `checkHost` / `checkIP` / `checkEmail`, `checkIssued`, `verify`, `toString`, `toLegacyObject`) | ✅ | [lib-node-crypto-keys.ts](conformance/lib-node-crypto-keys.ts) | `crypto/x509` |
815
+ | `crypto.subtle` / `webcrypto.subtle`: `digest`, `generateKey`, `importKey` / `exportKey` (`raw`, `spki`, `pkcs8`, `jwk`), `sign` / `verify` (HMAC, RSASSA-PKCS1-v1_5, RSA-PSS, ECDSA, Ed25519), `encrypt` / `decrypt` (AES-GCM / CBC / CTR, RSA-OAEP), `deriveBits` / `deriveKey` (PBKDF2, HKDF, ECDH, X25519), `wrapKey` / `unwrapKey` | ✅ | [lib-node-crypto-subtle.ts](conformance/lib-node-crypto-subtle.ts) | Key usages are recorded but not enforced |
816
+ | `Hash` / `Hmac` as streams (`write` / `end`, `'readable'`, `pipe` into a hash, `pipeline`, `setEncoding`) | ✅ | [lib-node-crypto-hash-stream.ts](conformance/lib-node-crypto-hash-stream.ts) | A transform that pushes the digest at the end, as in Node; afterwards `hash.digest()` throws and `hmac.digest()` is empty. Only programs that use a hash as a stream carry the stream code |
817
+ | AES key wrap: `id-aes128-wrap` … `id-aes256-wrap-pad` (and the `aes128-wrap` aliases) | ✅ | [lib-node-crypto-keywrap.ts](conformance/lib-node-crypto-keywrap.ts) | RFC 3394 and RFC 5649, checked against the RFC vectors; the whole input goes through one `update()`, as with OpenSSL |
818
+ | Encrypted private keys (`passphrase` / `cipher`), `rsa-pss` / `dsa` / `dh` / `ed448` / `x448` key types, `secp256k1`, `Certificate` (SPKAC) | ❌ | — | Not in Go's standard library, but portable: encrypted PKCS#8 is PBES2 over `pbkdf2` + AES-CBC; `rsa-pss` / `dsa` / `dh` keys and SPKAC are ASN.1 on existing primitives; `secp256k1` / `ed448` / `x448` need vendored curve code |
635
819
 
636
820
  #### `node:zlib`
637
821
 
638
- | API | Status | Probe | Notes |
639
- | ---------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------- | -------------------------------------------------------- |
640
- | `gzipSync` / `gunzipSync` / `deflateSync` / `inflateSync` / `deflateRawSync` / `inflateRawSync` / `unzipSync` / `crc32` / `constants` | ✅ | [lib-node-zlib.ts](conformance/lib-node-zlib.ts) | `{ level }`; invalid input throws `Z_DATA_ERROR` |
641
- | `createGzip` / `createGunzip` / `createDeflate` / `createInflate` / `createDeflateRaw` / `createInflateRaw` / `createUnzip` | ✅ | [lib-node-zlib-streams.ts](conformance/lib-node-zlib-streams.ts) | Transforms that (de)compress when the input ends |
642
- | Callback forms `gzip` / `gunzip` / `deflate` / `inflate` / `deflateRaw` / `inflateRaw` / `unzip` (`buf, [options], cb`) and `util.promisify` of them | ✅ | [lib-node-zlib-async.ts](conformance/lib-node-zlib-async.ts) | The codec runs on a goroutine; the callback runs on the event loop |
643
- | Brotli: `brotliCompressSync` / `brotliDecompressSync`, callback and promisified `brotliCompress` / `brotliDecompress`, `createBrotliCompress` / `createBrotliDecompress`, `constants.BROTLI_*` | ✅ | [lib-node-zlib-brotli.ts](conformance/lib-node-zlib-brotli.ts) | The vendored `andybalholm/brotli` (pure Go, only linked into programs that use it); `params` quality / window. Output matches Node's; decoder errors carry Node's codes |
822
+ | API | Status | Probe | Notes |
823
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
824
+ | `gzipSync` / `gunzipSync` / `deflateSync` / `inflateSync` / `deflateRawSync` / `inflateRawSync` / `unzipSync` / `crc32` / `constants` | ✅ | [lib-node-zlib.ts](conformance/lib-node-zlib.ts) | `{ level }`; invalid input throws `Z_DATA_ERROR` |
825
+ | `createGzip` / `createGunzip` / `createDeflate` / `createInflate` / `createDeflateRaw` / `createInflateRaw` / `createUnzip` | ✅ | [lib-node-zlib-streams.ts](conformance/lib-node-zlib-streams.ts) | Transforms that (de)compress when the input ends |
826
+ | Callback forms `gzip` / `gunzip` / `deflate` / `inflate` / `deflateRaw` / `inflateRaw` / `unzip` (`buf, [options], cb`) and `util.promisify` of them | ✅ | [lib-node-zlib-async.ts](conformance/lib-node-zlib-async.ts) | The codec runs on a goroutine; the callback runs on the event loop |
827
+ | Brotli: `brotliCompressSync` / `brotliDecompressSync`, callback and promisified `brotliCompress` / `brotliDecompress`, `createBrotliCompress` / `createBrotliDecompress`, `constants.BROTLI_*` | ✅ | [lib-node-zlib-brotli.ts](conformance/lib-node-zlib-brotli.ts) | The vendored `andybalholm/brotli` (pure Go, only linked into programs that use it); `params` quality / window. Output matches Node's; decoder errors carry Node's codes |
644
828
 
645
829
  #### `node:timers`
646
830
 
647
- | API | Status | Probe | Notes |
648
- | -------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------ | -------------------------------------------------------------------------- |
649
- | `setTimeout` / `setInterval` / `setImmediate` (+ extra arguments) / `clear*`; global `setImmediate` | ✅ | [lib-node-timers.ts](conformance/lib-node-timers.ts) | Callbacks run on the event loop |
650
- | `node:timers/promises` (`setTimeout`, `setImmediate`, `setInterval`, `scheduler`) | ✅ | [lib-node-timers-promises.ts](conformance/lib-node-timers-promises.ts) | `{ signal }` aborts; `setInterval` is an async iterator |
651
- | `Timeout` / `Immediate` handles: `ref` / `unref` / `hasRef` / `refresh` / `close` (also on intervals) | ✅ | [lib-node-timers-ref.ts](conformance/lib-node-timers-ref.ts) | Unref'ed timers don't keep the process alive |
831
+ | API | Status | Probe | Notes |
832
+ | ----------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------- | ------------------------------------------------------- |
833
+ | `setTimeout` / `setInterval` / `setImmediate` (+ extra arguments) / `clear*`; global `setImmediate` | ✅ | [lib-node-timers.ts](conformance/lib-node-timers.ts) | Callbacks run on the event loop |
834
+ | `node:timers/promises` (`setTimeout`, `setImmediate`, `setInterval`, `scheduler`) | ✅ | [lib-node-timers-promises.ts](conformance/lib-node-timers-promises.ts) | `{ signal }` aborts; `setInterval` is an async iterator |
835
+ | `Timeout` / `Immediate` handles: `ref` / `unref` / `hasRef` / `refresh` / `close` (also on intervals) | ✅ | [lib-node-timers-ref.ts](conformance/lib-node-timers-ref.ts) | Unref'ed timers don't keep the process alive |
652
836
 
653
837
  #### `node:perf_hooks`
654
838
 
655
- | API | Status | Probe | Notes |
656
- | -------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------- | ------------------------------------------- |
657
- | `performance.now` / `timeOrigin` / `mark` / `measure` / `getEntries*` / `clearMarks`; global `performance` | ✅ | [lib-node-perf-hooks.ts](conformance/lib-node-perf-hooks.ts) | Monotonic milliseconds since process start |
658
- | `PerformanceObserver` (`entryTypes` / `type` + `buffered`, batched, sorted by `startTime`), `timerify`, `createHistogram`, `monitorEventLoopDelay`, `eventLoopUtilization` | ✅ | [lib-node-perf-observer.ts](conformance/lib-node-perf-observer.ts) | `eventLoopUtilization` is estimated from CPU time |
839
+ | API | Status | Probe | Notes |
840
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------ | ------------------------------------------------- |
841
+ | `performance.now` / `timeOrigin` / `mark` / `measure` / `getEntries*` / `clearMarks`; global `performance` | ✅ | [lib-node-perf-hooks.ts](conformance/lib-node-perf-hooks.ts) | Monotonic milliseconds since process start |
842
+ | `PerformanceObserver` (`entryTypes` / `type` + `buffered`, batched, sorted by `startTime`), `timerify`, `createHistogram`, `monitorEventLoopDelay`, `eventLoopUtilization` | ✅ | [lib-node-perf-observer.ts](conformance/lib-node-perf-observer.ts) | `eventLoopUtilization` is estimated from CPU time |
659
843
 
660
844
  #### `node:tty`
661
845
 
662
- | API | Status | Probe | Notes |
663
- | ------------ | :----: | ---------------------------------------------------------- | ---------------------------------------- |
664
- | `isatty(fd)` | ✅ | [lib-node-perf-hooks.ts](conformance/lib-node-perf-hooks.ts) | Character-device check on fds 0–2 |
665
- | `ReadStream` / `WriteStream` (`columns`, `setRawMode`) | ❌ | — | Terminal sizes need non-portable syscalls |
846
+ | API | Status | Probe | Notes |
847
+ | ------------------------------------ | :----: | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
848
+ | `isatty(fd)` | ✅ | [lib-node-perf-hooks.ts](conformance/lib-node-perf-hooks.ts) | Character-device check on fds 0–2 |
849
+ | `ReadStream` / `WriteStream` classes | ❌ | — | Feasible; the terminal calls behind them exist (`process.stdout.columns`, `process.stdin.setRawMode` in [process](#nodeprocess)) |
666
850
 
667
851
  #### `node:constants` / `node:sys`
668
852
 
669
- | API | Status | Probe | Notes |
670
- | ----------------------------------------- | :----: | ---------------------------------------------------------- | ---------------------------------------------------- |
671
- | `node:constants` (`F_OK`, `SIGINT`, …) | ✅ | [lib-node-perf-hooks.ts](conformance/lib-node-perf-hooks.ts) | Deprecated upstream: `fs.constants` + `os.constants.signals` |
672
- | `node:sys` | ✅ | — | Deprecated alias of `node:util` |
853
+ | API | Status | Probe | Notes |
854
+ | -------------------------------------- | :----: | ------------------------------------------------------------ | ------------------------------------------------------------ |
855
+ | `node:constants` (`F_OK`, `SIGINT`, …) | ✅ | [lib-node-perf-hooks.ts](conformance/lib-node-perf-hooks.ts) | Deprecated upstream: `fs.constants` + `os.constants.signals` |
856
+ | `node:sys` | ✅ | — | Deprecated alias of `node:util` |
673
857
 
674
858
  #### `node:events`
675
859
 
676
- | API | Status | Probe | Notes |
677
- | ---------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------- | -------------------------------------------------------------------------- |
678
- | `EventEmitter`: `on` / `once` / `off` / `prepend*` / `emit` / `removeAllListeners` / `listenerCount` / `eventNames` / max listeners / `newListener`; unhandled `'error'` throws | ✅ | [lib-node-events.ts](conformance/lib-node-events.ts) | Listeners are called with any signature; removal by identity |
679
- | `class X extends EventEmitter` | ✅ | [lib-node-events-extends.ts](conformance/lib-node-events-extends.ts) | The emitter is embedded; `this.emit` and inherited methods work |
680
- | `events.once` (→ promise) / `events.on` (async iterator) | ✅ | [lib-node-events-once.ts](conformance/lib-node-events-once.ts) | `'error'` rejects `once` |
681
- | `EventTarget` / `Event` / `AbortController` / `AbortSignal` (`abort`, `timeout`, `any`, `throwIfAborted`) | ✅ | [lib-node-abort.ts](conformance/lib-node-abort.ts) | Globals (also exported by `node:events`) |
682
- | `errorMonitor`, `captureRejections` (option and global), `getMaxListeners` / `setMaxListeners` (static), `addAbortListener` | ✅ | [lib-node-events-extra.ts](conformance/lib-node-events-extra.ts) | Captures rejections of listeners that return a promise; async arrow listeners run inline (their `await`s don't yield to `emit`) |
683
- | Symbol event names other than `errorMonitor`, `EventEmitterAsyncResource`, `Symbol.for('nodejs.rejection')` | ❌ | — | Event names are strings |
860
+ | API | Status | Probe | Notes |
861
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
862
+ | `EventEmitter`: `on` / `once` / `off` / `prepend*` / `emit` / `removeAllListeners` / `listenerCount` / `eventNames` / max listeners / `newListener`; unhandled `'error'` throws | ✅ | [lib-node-events.ts](conformance/lib-node-events.ts) | Listeners are called with any signature; removal by identity |
863
+ | `class X extends EventEmitter` | ✅ | [lib-node-events-extends.ts](conformance/lib-node-events-extends.ts) | The emitter is embedded; `this.emit` and inherited methods work |
864
+ | `events.once` (→ promise) / `events.on` (async iterator) | ✅ | [lib-node-events-once.ts](conformance/lib-node-events-once.ts) | `'error'` rejects `once` |
865
+ | `EventTarget` / `Event` / `AbortController` / `AbortSignal` (`abort`, `timeout`, `any`, `throwIfAborted`) | ✅ | [lib-node-abort.ts](conformance/lib-node-abort.ts) | Globals (also exported by `node:events`) |
866
+ | `errorMonitor`, `captureRejections` (option and global), `getMaxListeners` / `setMaxListeners` (static), `addAbortListener` | ✅ | [lib-node-events-extra.ts](conformance/lib-node-events-extra.ts) | Captures rejections of listeners that return a promise; async arrow listeners run inline (their `await`s don't yield to `emit`) |
867
+ | Symbol event names other than `errorMonitor`, `EventEmitterAsyncResource`, `Symbol.for('nodejs.rejection')` | ❌ | — | Event names are strings today; symbols are unique pointers, usable as listener keys, and `EventEmitterAsyncResource` fits on `AsyncResource` |
684
868
 
685
869
  #### `node:stream`
686
870
 
687
- | API | Status | Probe | Notes |
688
- | ----------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
689
- | `Readable` (`push`, `read`, `pause` / `resume`, `setEncoding`, `destroy`), `Readable.from`, `for await` | ✅ | [lib-node-stream-readable.ts](conformance/lib-node-stream-readable.ts) | Arrays, strings, Buffers and async generators as sources |
690
- | `Writable` (`write` / `end` / callbacks, `final`, `'finish'`, write after end) | ✅ | [lib-node-stream-writable.ts](conformance/lib-node-stream-writable.ts) | Strings become Buffers unless `decodeStrings: false` or `objectMode` |
691
- | `Transform` / `PassThrough` / `Duplex`, `pipe` chains, subclasses overriding `_transform` & co. | ✅ | [lib-node-stream-transform.ts](conformance/lib-node-stream-transform.ts) | Option methods (`transform`, `flush`, `write`, `final`, `read`) and `_`-overrides both work; `this` inside option methods is not the stream (use the callback) |
692
- | `pipeline` / `finished` / `stream/promises` / `stream/consumers` (`text`, `json`, `buffer`) | ✅ | [lib-node-stream-pipeline.ts](conformance/lib-node-stream-pipeline.ts) | Errors destroy the pipeline and reach the callback / rejection |
693
- | `Readable.toWeb` / `fromWeb`, `Writable.toWeb` / `fromWeb`, `Duplex.toWeb` / `fromWeb`, `compose` (Node and web streams) | ✅ | [lib-node-stream-web-bridge.ts](conformance/lib-node-stream-web-bridge.ts) | `toWeb` pauses the Node stream while the web queue is full |
694
- | Backpressure (`highWaterMark` beyond `write()`'s return value), `compose` with generator functions | ❌ | — | Not implemented |
871
+ | API | Status | Probe | Notes |
872
+ | ------------------------------------------------------------------------------------------------------------------------ | :----: | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
873
+ | `Readable` (`push`, `read`, `pause` / `resume`, `setEncoding`, `destroy`), `Readable.from`, `for await` | ✅ | [lib-node-stream-readable.ts](conformance/lib-node-stream-readable.ts) | Arrays, strings, Buffers and async generators as sources |
874
+ | `'readable'` events (paused mode), `read()` / `read(size)` | ✅ | [lib-node-stream-readable-event.ts](conformance/lib-node-stream-readable-event.ts) | A last `'readable'` (with `read()` giving `null`) comes before `'end'`; `read()` returns everything buffered, `read(n)` waits for `n` bytes unless the stream ended, and what it returns is also a `'data'` event. Chunk boundaries can differ from Node's read-ahead |
875
+ | `Writable` (`write` / `end` / callbacks, `final`, `'finish'`, write after end) | ✅ | [lib-node-stream-writable.ts](conformance/lib-node-stream-writable.ts) | Strings become Buffers unless `decodeStrings: false` or `objectMode` |
876
+ | `Transform` / `PassThrough` / `Duplex`, `pipe` chains, subclasses overriding `_transform` & co. | ✅ | [lib-node-stream-transform.ts](conformance/lib-node-stream-transform.ts) | Option methods (`transform`, `flush`, `write`, `final`, `read`) and `_`-overrides both work; `this` inside option methods is not the stream (use the callback) |
877
+ | `pipeline` / `finished` / `stream/promises` / `stream/consumers` (`text`, `json`, `buffer`) | ✅ | [lib-node-stream-pipeline.ts](conformance/lib-node-stream-pipeline.ts) | Errors destroy the pipeline and reach the callback / rejection |
878
+ | `Readable.toWeb` / `fromWeb`, `Writable.toWeb` / `fromWeb`, `Duplex.toWeb` / `fromWeb`, `compose` (Node and web streams) | ✅ | [lib-node-stream-web-bridge.ts](conformance/lib-node-stream-web-bridge.ts) | `toWeb` pauses the Node stream while the web queue is full |
879
+ | Backpressure (`highWaterMark` beyond `write()`'s return value), `compose` with generator functions | ❌ | — | Not implemented yet |
695
880
 
696
881
  #### `node:stream/web`
697
882
 
698
- | API | Status | Probe | Notes |
699
- | ----------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------- | --------------------------------------------------------------------- |
700
- | `ReadableStream` (underlying source `start` / `pull` / `cancel`, sync or async), `getReader()` → `read` / `releaseLock` / `cancel` / `closed`, `locked`, `cancel`, `tee`, `for await` / `values()`, `ReadableStream.from` | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | Promise reactions run as microtasks on the event loop; an error ends `for await` with a throw |
701
- | `WritableStream` (sink `start` / `write` / `close` / `abort`), `getWriter()` → `write` / `close` / `abort` / `ready` / `closed` / `desiredSize` / `releaseLock`; controller `error` / `signal` | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | Writes run one at a time; `ready` follows the queue's backpressure |
702
- | `TransformStream` (`transform` / `flush` / `start`, controller `enqueue` / `error` / `terminate`), `pipeThrough` / `pipeTo` (`preventClose` / `preventAbort` / `preventCancel` / `signal`) | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | A transform waits until its readable side wants more |
703
- | `CountQueuingStrategy` / `ByteLengthQueuingStrategy`, `{ highWaterMark, size }` strategies | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | |
704
- | `TextEncoderStream` / `TextDecoderStream` (characters split across chunks), `CompressionStream` / `DecompressionStream` (`gzip`, `deflate`, `deflate-raw`) | ✅ | [lib-node-stream-web-bridge.ts](conformance/lib-node-stream-web-bridge.ts) | Decompression decodes once the input ends |
705
- | BYOB readers (`getReader({ mode: 'byob' })` reads into a view), byte-stream controllers' `byobRequest`, transferring streams | ❌ | — | `getReader({ mode: 'byob' })` returns a default reader |
883
+ | API | Status | Probe | Notes |
884
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
885
+ | `ReadableStream` (underlying source `start` / `pull` / `cancel`, sync or async), `getReader()` → `read` / `releaseLock` / `cancel` / `closed`, `locked`, `cancel`, `tee`, `for await` / `values()`, `ReadableStream.from` | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | Promise reactions run as microtasks on the event loop; an error ends `for await` with a throw |
886
+ | `WritableStream` (sink `start` / `write` / `close` / `abort`), `getWriter()` → `write` / `close` / `abort` / `ready` / `closed` / `desiredSize` / `releaseLock`; controller `error` / `signal` | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | Writes run one at a time; `ready` follows the queue's backpressure |
887
+ | `TransformStream` (`transform` / `flush` / `start`, controller `enqueue` / `error` / `terminate`), `pipeThrough` / `pipeTo` (`preventClose` / `preventAbort` / `preventCancel` / `signal`) | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | A transform waits until its readable side wants more |
888
+ | `CountQueuingStrategy` / `ByteLengthQueuingStrategy`, `{ highWaterMark, size }` strategies | ✅ | [lib-node-stream-web.ts](conformance/lib-node-stream-web.ts) | |
889
+ | `TextEncoderStream` / `TextDecoderStream` (characters split across chunks), `CompressionStream` / `DecompressionStream` (`gzip`, `deflate`, `deflate-raw`) | ✅ | [lib-node-stream-web-bridge.ts](conformance/lib-node-stream-web-bridge.ts) | Decompression decodes once the input ends |
890
+ | BYOB readers (`getReader({ mode: 'byob' })` reads into a view), byte-stream controllers' `byobRequest`, transferring streams | ❌ | — | `getReader({ mode: 'byob' })` returns a default reader |
706
891
 
707
892
  #### `node:readline`
708
893
 
709
- | API | Status | Probe | Notes |
710
- | --------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
711
- | `createInterface` (`'line'` / `'close'`, `question(q, cb)`, `prompt`, `close`, `for await`) | ✅ | [lib-node-readline.ts](conformance/lib-node-readline.ts) | Any readable stream as input (`process.stdin` included) |
712
- | `node:readline/promises` (`await rl.question(q)`) | ✅ | [lib-node-readline-promises.ts](conformance/lib-node-readline-promises.ts) | |
713
- | `question(prompt)` (synchronous) | ✅ | [lib-node-readline-question.ts](conformance/lib-node-readline-question.ts) | TypeNative extension (not in Node): used by the self-hosted compiler |
714
- | `cursorTo` / `moveCursor` / `clearLine` / `clearScreenDown` | ✅ | [lib-node-readline-cursor.ts](conformance/lib-node-readline-cursor.ts) | ANSI escape sequences written to the stream; optional callback |
715
- | `emitKeypressEvents`, `history`, `completer` | ❌ | — | Need raw terminal mode (OS-specific syscalls) |
894
+ | API | Status | Probe | Notes |
895
+ | ------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
896
+ | `createInterface` (`'line'` / `'close'`, `question(q, cb)`, `prompt`, `close`, `for await`) | ✅ | [lib-node-readline.ts](conformance/lib-node-readline.ts) | Any readable stream as input (`process.stdin` included) |
897
+ | `node:readline/promises` (`await rl.question(q)`) | ✅ | [lib-node-readline-promises.ts](conformance/lib-node-readline-promises.ts) | |
898
+ | `question(prompt)` (synchronous) | ✅ | [lib-node-readline-question.ts](conformance/lib-node-readline-question.ts) | TypeNative extension (not in Node): used by the self-hosted compiler |
899
+ | `cursorTo` / `moveCursor` / `clearLine` / `clearScreenDown` | ✅ | [lib-node-readline-cursor.ts](conformance/lib-node-readline-cursor.ts) | ANSI escape sequences written to the stream; optional callback |
900
+ | `emitKeypressEvents(stream)` (`'keypress'` with `(str, key)`) | ✅ | [lib-node-readline-keypress.ts](conformance/lib-node-readline-keypress.ts) | A port of Node's key decoder: names, `ctrl` / `meta` / `shift`, xterm / rxvt / putty sequences, Escape after 500 ms. `str` is `""` (not `undefined`) for escape sequences, and so are `name` / `code` when Node leaves them out |
901
+ | `Interface` line editing, `history`, `completer` | ❌ | — | Feasible: keypresses and raw mode exist; needs the terminal-mode line editor on top |
716
902
 
717
903
  #### `node:child_process`
718
904
 
719
- | API | Status | Probe | Notes |
720
- | ------------------------------------------------------------------------------------------------ | :----: | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
721
- | `execSync` / `execFileSync` / `spawnSync` (`encoding`, `input`, `cwd`, `env`, `shell`, `stdio: 'inherit'`) | ✅ | [lib-node-child-process-sync.ts](conformance/lib-node-child-process-sync.ts) | Buffers unless an encoding is given (as in Node); a non-zero exit throws with `status` / `stdout` / `stderr` |
722
- | `exec` / `execFile` (callbacks), `spawn` → `ChildProcess` (stdio streams, `'exit'` / `'close'`, `kill`); `promisify(exec)` | ✅ | [lib-node-child-process-async.ts](conformance/lib-node-child-process-async.ts) | `'close'` follows the end of the stdio streams being read; exit codes on `err.code` |
723
- | `fork(modulePath, args, { env, cwd, silent })` → `send` / `'message'` / `disconnect` / `'disconnect'` / `connected`; in the child `process.send` / `process.on('message')` / `process.connected` / `process.disconnect` | ✅ | [lib-node-child-process-fork.ts](conformance/lib-node-child-process-fork.ts) | The child is this program run again (branch on `process.argv` / `process.send`), linked over loopback TCP; messages are structured clones (a superset of Node's default JSON) |
724
- | `detached`, `stdio` arrays beyond stdout, `serialization: 'advanced'` handle passing (`send(msg, socket)`), forking another file | ❌ | — | `detached` needs OS-specific process attributes; one binary holds one program |
905
+ | API | Status | Probe | Notes |
906
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
907
+ | `execSync` / `execFileSync` / `spawnSync` (`encoding`, `input`, `cwd`, `env`, `shell`, `stdio: 'inherit'`) | ✅ | [lib-node-child-process-sync.ts](conformance/lib-node-child-process-sync.ts) | Buffers unless an encoding is given (as in Node); a non-zero exit throws with `status` / `stdout` / `stderr` |
908
+ | `exec` / `execFile` (callbacks), `spawn` → `ChildProcess` (stdio streams, `'exit'` / `'close'`, `kill`); `promisify(exec)` | ✅ | [lib-node-child-process-async.ts](conformance/lib-node-child-process-async.ts) | `'close'` follows the end of the stdio streams being read; exit codes on `err.code` |
909
+ | `fork(modulePath, args, { env, cwd, silent })` → `send` / `'message'` / `disconnect` / `'disconnect'` / `connected`; in the child `process.send` / `process.on('message')` / `process.connected` / `process.disconnect` | ✅ | [lib-node-child-process-fork.ts](conformance/lib-node-child-process-fork.ts) | The child is this program run again (branch on `process.argv` / `process.send`), linked over loopback TCP; messages are structured clones (a superset of Node's default JSON) |
910
+ | `spawn` `detached`, `child.unref()` / `ref()` | ✅ | [lib-node-child-process-detached.ts](conformance/lib-node-child-process-detached.ts) | A new session (`setsid`) on Unix; `DETACHED_PROCESS \| CREATE_NEW_PROCESS_GROUP` on Windows, as libuv does. An unref'ed child's stdio pipes don't keep the parent alive either |
911
+ | `fork('./child.ts')` (another file) | ✅ | [lib-node-worker-entry.ts](conformance/lib-node-worker-entry.ts) | As for workers: a second entry point of the binary |
912
+ | `stdio` arrays beyond stdout | ❌ | — | Extra `stdio` entries are `ExtraFiles` |
913
+ | `serialization: 'advanced'` handle passing (`send(msg, socket)`) | ❌ | — | Needs file-descriptor passing over the IPC channel (`SCM_RIGHTS` on Unix) |
725
914
 
726
915
  #### `node:cluster`
727
916
 
728
- | API | Status | Probe | Notes |
729
- | ----------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------- | --------------------------------------------------------------------- |
730
- | `isPrimary` / `isWorker` / `isMaster`, `fork(env)`, `workers`, `worker`, `setupPrimary` / `settings`, `disconnect(cb)`, `SCHED_RR` / `schedulingPolicy`; events `'fork'` / `'online'` / `'listening'` / `'message'` / `'disconnect'` / `'exit'` | ✅ | [lib-node-cluster.ts](conformance/lib-node-cluster.ts) | Workers are this program run again with `NODE_UNIQUE_ID` set |
731
- | `Worker` (`id`, `process`, `send`, `'message'`, `disconnect`, `kill`, `isConnected`, `isDead`, `exitedAfterDisconnect`); `process.send` from workers | ✅ | [lib-node-cluster.ts](conformance/lib-node-cluster.ts) | |
732
- | Shared ports: `net` / `http` / `https` / `tls` servers in workers listen on one port (also `listen(0)`), connections round-robin | ✅ | [lib-node-cluster.ts](conformance/lib-node-cluster.ts) | The primary owns the listener and relays each connection to a worker's private loopback listener with the client's address (no handle passing) |
733
- | `SCHED_NONE` (OS-level balancing), `exclusive: true` listeners, dgram sockets in workers | ❌ | — | Everything goes through the primary |
917
+ | API | Status | Probe | Notes |
918
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
919
+ | `isPrimary` / `isWorker` / `isMaster`, `fork(env)`, `workers`, `worker`, `setupPrimary` / `settings`, `disconnect(cb)`, `SCHED_RR` / `schedulingPolicy`; events `'fork'` / `'online'` / `'listening'` / `'message'` / `'disconnect'` / `'exit'` | ✅ | [lib-node-cluster.ts](conformance/lib-node-cluster.ts) | Workers are this program run again with `NODE_UNIQUE_ID` set |
920
+ | `Worker` (`id`, `process`, `send`, `'message'`, `disconnect`, `kill`, `isConnected`, `isDead`, `exitedAfterDisconnect`); `process.send` from workers | ✅ | [lib-node-cluster.ts](conformance/lib-node-cluster.ts) | |
921
+ | Shared ports: `net` / `http` / `https` / `tls` servers in workers listen on one port (also `listen(0)`), connections round-robin | ✅ | [lib-node-cluster.ts](conformance/lib-node-cluster.ts) | The primary owns the listener and relays each connection to a worker's private loopback listener with the client's address (no handle passing) |
922
+ | `SCHED_NONE` (OS-level balancing), `exclusive: true` listeners, dgram sockets in workers | ❌ | — | Everything goes through the primary today; `SO_REUSEPORT` or handle passing would remove it |
734
923
 
735
924
  #### `node:diagnostics_channel`
736
925
 
737
- | API | Status | Probe | Notes |
738
- | ------------------------------------------------------------------------------------ | :----: | ---------------------------------------------------------------------------- | ----------------------------- |
739
- | `channel` / `publish` / `subscribe` / `unsubscribe` / `hasSubscribers` | ✅ | [lib-node-diagnostics-channel.ts](conformance/lib-node-diagnostics-channel.ts) | Synchronous; shared by name |
740
- | `tracingChannel` (`start` / `end` / `asyncStart` / `asyncEnd` / `error` channels, `subscribe` / `unsubscribe`, `traceSync` / `tracePromise` / `traceCallback`); `channel.bindStore` / `unbindStore` / `runStores` | ✅ | [lib-node-diagnostics-tracing.ts](conformance/lib-node-diagnostics-tracing.ts) | The context gets `result` / `error`; a struct context without those fields is copied into a record |
926
+ | API | Status | Probe | Notes |
927
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
928
+ | `channel` / `publish` / `subscribe` / `unsubscribe` / `hasSubscribers` | ✅ | [lib-node-diagnostics-channel.ts](conformance/lib-node-diagnostics-channel.ts) | Synchronous; shared by name |
929
+ | `tracingChannel` (`start` / `end` / `asyncStart` / `asyncEnd` / `error` channels, `subscribe` / `unsubscribe`, `traceSync` / `tracePromise` / `traceCallback`); `channel.bindStore` / `unbindStore` / `runStores` | ✅ | [lib-node-diagnostics-tracing.ts](conformance/lib-node-diagnostics-tracing.ts) | The context gets `result` / `error`; a struct context without those fields is copied into a record |
741
930
 
742
931
  #### `node:net`
743
932
 
744
- | API | Status | Probe | Notes |
745
- | ----------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------- | ----------------------------------------------------------------------------------------- |
746
- | `createServer` / `Server` (`listen` forms incl. `{ port, host }` and Unix paths, `address()`, `close(cb)`, `getConnections`, `maxConnections`, `ref` / `unref`; `'listening'` / `'connection'` / `'close'` / `'error'`) | ✅ | [lib-node-net.ts](conformance/lib-node-net.ts) | A listening server keeps the process alive; `close()` emits `'close'` once its connections end |
747
- | `connect` / `createConnection` / `Socket` (a duplex stream: `write` / `end` / `'data'` / `'end'`, `setEncoding`, `remoteAddress` / `remotePort` / `localPort`, `setTimeout` + `'timeout'`, `setNoDelay`, `setKeepAlive`, `destroy`, `'close'(hadError)`) | ✅ | [lib-node-net.ts](conformance/lib-node-net.ts) | One goroutine reads the `net.Conn`; `allowHalfOpen: false` ends the socket after `'end'`, as in Node |
748
- | Node's errors (`connect ECONNREFUSED 127.0.0.1:80`, `EADDRINUSE`, `ECONNRESET`; `code` / `errno` / `syscall` / `address` / `port`) | ✅ | [lib-node-net.ts](conformance/lib-node-net.ts) | |
749
- | `isIP` / `isIPv4` / `isIPv6` | ✅ | [lib-node-net.ts](conformance/lib-node-net.ts) | |
750
- | `BlockList` (`addAddress` / `addRange` / `addSubnet` / `check` / `rules` / `isBlockList`) / `SocketAddress` (`parse`, `toJSON`) | ✅ | [lib-node-net-blocklist.ts](conformance/lib-node-net-blocklist.ts) | `net/netip`; IPv4-mapped IPv6 addresses match IPv4 rules, as in Node |
751
- | `net.Stream`, `get/setDefaultAutoSelectFamily(AttemptTimeout)` | ✅ | [lib-node-net-blocklist.ts](conformance/lib-node-net-blocklist.ts) | Go's dialer always races IPv4 / IPv6, so the settings are reported but not used |
752
- | IPC handle passing (`send(msg, socket)`) | ❌ | — | Needs file-descriptor passing over the IPC channel |
933
+ | API | Status | Probe | Notes |
934
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
935
+ | `createServer` / `Server` (`listen` forms incl. `{ port, host }` and Unix paths, `address()`, `close(cb)`, `getConnections`, `maxConnections`, `ref` / `unref`; `'listening'` / `'connection'` / `'close'` / `'error'`) | ✅ | [lib-node-net.ts](conformance/lib-node-net.ts) | A listening server keeps the process alive; `close()` emits `'close'` once its connections end |
936
+ | `connect` / `createConnection` / `Socket` (a duplex stream: `write` / `end` / `'data'` / `'end'`, `setEncoding`, `remoteAddress` / `remotePort` / `localPort`, `setTimeout` + `'timeout'`, `setNoDelay`, `setKeepAlive`, `destroy`, `'close'(hadError)`) | ✅ | [lib-node-net.ts](conformance/lib-node-net.ts) | One goroutine reads the `net.Conn`; `allowHalfOpen: false` ends the socket after `'end'`, as in Node |
937
+ | Node's errors (`connect ECONNREFUSED 127.0.0.1:80`, `EADDRINUSE`, `ECONNRESET`; `code` / `errno` / `syscall` / `address` / `port`) | ✅ | [lib-node-net.ts](conformance/lib-node-net.ts) | |
938
+ | `isIP` / `isIPv4` / `isIPv6` | ✅ | [lib-node-net.ts](conformance/lib-node-net.ts) | |
939
+ | `BlockList` (`addAddress` / `addRange` / `addSubnet` / `check` / `rules` / `isBlockList`) / `SocketAddress` (`parse`, `toJSON`) | ✅ | [lib-node-net-blocklist.ts](conformance/lib-node-net-blocklist.ts) | `net/netip`; IPv4-mapped IPv6 addresses match IPv4 rules, as in Node |
940
+ | `net.Stream`, `get/setDefaultAutoSelectFamily(AttemptTimeout)` | ✅ | [lib-node-net-blocklist.ts](conformance/lib-node-net-blocklist.ts) | Go's dialer always races IPv4 / IPv6, so the settings are reported but not used |
941
+ | IPC handle passing (`send(msg, socket)`) | ❌ | — | Needs file-descriptor passing over the IPC channel |
753
942
 
754
943
  #### `node:dns`
755
944
 
756
- | API | Status | Probe | Notes |
757
- | -------------------------------------------------------------------------------------- | :----: | -------------------------------------------- | --------------------------------------------------------------------- |
758
- | `lookup` (`family`, `all`) and `dns/promises` / `dns.promises` `lookup` | ✅ | [lib-node-dns.ts](conformance/lib-node-dns.ts) | Go's resolver; `getaddrinfo ENOTFOUND host` errors with `hostname` |
759
- | `resolve` (rrtype) / `resolve4` / `resolve6` / `resolveCname` / `resolveMx` / `resolveTxt` / `resolveNs` / `resolveSrv` / `reverse` (callback and promise forms), `getServers` | ✅ | — | Implemented, not probed (needs a network); `getServers` reads `/etc/resolv.conf` |
760
- | `Resolver` class (callback and `dns/promises` forms: `setServers` / `getServers` / `setLocalAddress` / `cancel`, `timeout` option), module `setServers`, `lookupService` | ✅ | [lib-node-dns-resolver.ts](conformance/lib-node-dns-resolver.ts) | Go's pure resolver dialing the configured servers in turn; `ETIMEOUT` / `ECANCELLED`; services from `/etc/services` |
761
- | `resolveAny` / `resolveCaa` / `resolveNaptr` / `resolvePtr` / `resolveSoa`, the `ttl` option, `tries` | ❌ | — | Go's resolver does not expose these records or TTLs |
945
+ | API | Status | Probe | Notes |
946
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----: | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
947
+ | `lookup` (`family`, `all`) and `dns/promises` / `dns.promises` `lookup` | ✅ | [lib-node-dns.ts](conformance/lib-node-dns.ts) | Go's resolver; `getaddrinfo ENOTFOUND host` errors with `hostname` |
948
+ | `resolve` (rrtype) / `resolve4` / `resolve6` / `resolveCname` / `resolveMx` / `resolveTxt` / `resolveNs` / `resolveSrv` / `reverse` (callback and promise forms), `getServers` | ✅ | — | Implemented, not probed (needs a network); `getServers` reads `/etc/resolv.conf` |
949
+ | `Resolver` class (callback and `dns/promises` forms: `setServers` / `getServers` / `setLocalAddress` / `cancel`, `timeout` option), module `setServers`, `lookupService` | ✅ | [lib-node-dns-resolver.ts](conformance/lib-node-dns-resolver.ts) | Go's pure resolver dialing the configured servers in turn; `ETIMEOUT` / `ECANCELLED`; services from `/etc/services` |
950
+ | `resolveAny` / `resolveCaa` / `resolveNaptr` / `resolvePtr` / `resolveSoa` (and `resolve(name, rrtype)` for them), `resolve4` / `resolve6` `{ ttl: true }`, the `tries` option | ✅ | [lib-node-dns-records.ts](conformance/lib-node-dns-records.ts) | Queries built and parsed with `golang.org/x/net/dns/dnsmessage`, copied from GOROOT like `x/text`: UDP with EDNS0, TCP when truncated, each server in turn `tries` times (default 4, 5 s each). Errors are Node's (`queryX ENOTFOUND host`, `ENODATA`, `ESERVFAIL`, `EREFUSED`, `ETIMEOUT`, `ECANCELLED`); `resolveAny` groups records by type in Node's order |
762
951
 
763
952
  #### `node:http` / `node:https`
764
953
 
765
- | API | Status | Probe | Notes |
766
- | ----------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
767
- | `createServer((req, res) => …)` / `'request'`; `IncomingMessage` (a Readable: `method`, `url`, `headers`, `headersDistinct`, `rawHeaders`, `httpVersion`, `socket.remoteAddress`) | ✅ | [lib-node-http-server.ts](conformance/lib-node-http-server.ts) | Go's `net/http` serves the connections; bodies stream into the request |
768
- | `ServerResponse` (a Writable: `statusCode`, `setHeader` / `getHeader` / `getHeaders` / `hasHeader` / `removeHeader` / `appendHeader`, `writeHead`, `write`, `end`, `headersSent`, `'finish'`) | ✅ | [lib-node-http-server.ts](conformance/lib-node-http-server.ts) | `end(data)` without earlier writes sends a `Content-Length`; `write()` streams a chunked body |
769
- | `request` / `get` (URL strings, `URL` objects, options: `hostname` / `port` / `path` / `method` / `headers` / `auth` / `timeout` / `signal` / `socketPath`); `ClientRequest` (`setHeader`, `write`, `end`, `destroy`, `'response'`, `'error'`, `'timeout'`) | ✅ | [lib-node-http-client.ts](conformance/lib-node-http-client.ts) | No redirects are followed and bodies are not decompressed, as in Node; `destroy()` before a response fails with `socket hang up` |
770
- | `STATUS_CODES` / `METHODS` / `maxHeaderSize` / `Agent` / `globalAgent` | ✅ | [lib-node-http-server.ts](conformance/lib-node-http-server.ts) | `Agent` options are accepted; Go's transport pools connections |
771
- | `https.createServer({ key, cert })` / `https.request` / `https.get` (`ca`, `rejectUnauthorized`, `servername`, client `key` / `cert`) | ✅ | [lib-node-https.ts](conformance/lib-node-https.ts) | Certificate checks as in [node:tls](#nodetls) |
772
- | `headers` values | ✅ | [lib-node-http-client.ts](conformance/lib-node-http-client.ts) | Repeated headers are joined with `, ` (`; ` for `cookie`) — including `set-cookie`, which Node keeps as an array: use `headersDistinct['set-cookie']` |
773
- | Server `'upgrade'` / `'connect'` (`req, socket, head`) and client `'upgrade'` / `'connect'` events | ✅ | [lib-node-http-upgrade.ts](conformance/lib-node-http-upgrade.ts) | The server hijacks the connection; an upgrade nobody listens for is an ordinary request, an unhandled CONNECT closes the connection, as in Node |
774
- | `statusMessage` on responses we send, `'checkContinue'`, `Agent` socket pooling control, trailers we send | ❌ | — | Go's `ResponseWriter` sends its standard reason phrases |
954
+ | API | Status | Probe | Notes |
955
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
956
+ | `createServer((req, res) => …)` / `'request'`; `IncomingMessage` (a Readable: `method`, `url`, `headers`, `headersDistinct`, `rawHeaders`, `httpVersion`, `socket.remoteAddress`) | ✅ | [lib-node-http-server.ts](conformance/lib-node-http-server.ts) | Go's `net/http` serves the connections; bodies stream into the request |
957
+ | `ServerResponse` (a Writable: `statusCode`, `setHeader` / `getHeader` / `getHeaders` / `hasHeader` / `removeHeader` / `appendHeader`, `writeHead`, `write`, `end`, `headersSent`, `'finish'`) | ✅ | [lib-node-http-server.ts](conformance/lib-node-http-server.ts) | `end(data)` without earlier writes sends a `Content-Length`; `write()` streams a chunked body |
958
+ | `request` / `get` (URL strings, `URL` objects, options: `hostname` / `port` / `path` / `method` / `headers` / `auth` / `timeout` / `signal` / `socketPath`); `ClientRequest` (`setHeader`, `write`, `end`, `destroy`, `'response'`, `'error'`, `'timeout'`) | ✅ | [lib-node-http-client.ts](conformance/lib-node-http-client.ts) | No redirects are followed and bodies are not decompressed, as in Node; `destroy()` before a response fails with `socket hang up` |
959
+ | `STATUS_CODES` / `METHODS` / `maxHeaderSize` / `Agent` / `globalAgent` | ✅ | [lib-node-http-server.ts](conformance/lib-node-http-server.ts) | `Agent` options are accepted; Go's transport pools connections |
960
+ | `https.createServer({ key, cert })` / `https.request` / `https.get` (`ca`, `rejectUnauthorized`, `servername`, client `key` / `cert`) | ✅ | [lib-node-https.ts](conformance/lib-node-https.ts) | Certificate checks as in [node:tls](#nodetls) |
961
+ | `headers` values | ✅ | [lib-node-http-client.ts](conformance/lib-node-http-client.ts) | Repeated headers are joined with `, ` (`; ` for `cookie`) — including `set-cookie`, which Node keeps as an array: use `headersDistinct['set-cookie']` |
962
+ | Server `'upgrade'` / `'connect'` (`req, socket, head`) and client `'upgrade'` / `'connect'` events | ✅ | [lib-node-http-upgrade.ts](conformance/lib-node-http-upgrade.ts) | The server hijacks the connection; an upgrade nobody listens for is an ordinary request, an unhandled CONNECT closes the connection, as in Node |
963
+ | `res.addTrailers()` | ✅ | [lib-node-http-trailers.ts](conformance/lib-node-http-trailers.ts) | Sent after a chunked body, as in Node (not with a `Content-Length`); clients read them as `res.trailers` |
964
+ | Trailers on client requests, `Agent` socket pooling control | ❌ | — | Feasible: Go's `Request.Trailer`, `Transport.MaxConnsPerHost` / `MaxIdleConnsPerHost` |
965
+ | `statusMessage` on responses we send, `'checkContinue'` | ❌ | — | Go's `ResponseWriter` sends its standard reason phrases and answers `100-continue` itself: needs a hijacked connection |
775
966
 
776
967
  #### `node:http2`
777
968
 
778
- | API | Status | Probe | Notes |
779
- | ----------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------- | --------------------------------------------------------------------- |
780
- | `createServer` (cleartext h2c) / `createSecureServer({ key, cert, allowHTTP1 })`; `'stream'` → `ServerHttp2Stream` (`respond`, `write` / `end`, `respondWithFile`, `close`, a Duplex over the request body) with `:method` / `:path` / `:scheme` / `:authority` headers | ✅ | [lib-node-http2.ts](conformance/lib-node-http2.ts), [lib-node-http2-secure.ts](conformance/lib-node-http2-secure.ts) | On `net/http`'s HTTP/2 (`http.Protocols`) |
781
- | Compatibility API: `(req, res)` handlers get `Http2ServerRequest` / `Http2ServerResponse` (`httpVersion` `'2.0'`, pseudo-headers in `req.headers`) | ✅ | [lib-node-http2.ts](conformance/lib-node-http2.ts) | The node:http objects |
782
- | `connect(authority, { ca, rejectUnauthorized, servername })` → `ClientHttp2Session` (`request`, `close`, `destroy`, `'connect'` / `'error'` / `'close'`, `alpnProtocol`, `encrypted`); `ClientHttp2Stream` (`'response'` with `:status`, body as a Readable, request bodies) | ✅ | [lib-node-http2.ts](conformance/lib-node-http2.ts), [lib-node-http2-secure.ts](conformance/lib-node-http2-secure.ts) | Connection failures error the session and cancel its streams (`ERR_HTTP2_STREAM_CANCEL`); request bodies are sent once the writable side ends |
783
- | `constants`, `getDefaultSettings` | ✅ | [lib-node-http2.ts](conformance/lib-node-http2.ts) | |
784
- | Server push, `ping`, `settings` / `goaway` / `altsvc`, `'session'` events, `getPackedSettings`, upgrades from HTTP/1 | ❌ | — | Go's standard library does not expose HTTP/2 frames |
969
+ | API | Status | Probe | Notes |
970
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
971
+ | `createServer` (cleartext h2c) / `createSecureServer({ key, cert, allowHTTP1 })`; `'stream'` → `ServerHttp2Stream` (`respond`, `write` / `end`, `respondWithFile`, `close`, a Duplex over the request body) with `:method` / `:path` / `:scheme` / `:authority` headers | ✅ | [lib-node-http2.ts](conformance/lib-node-http2.ts), [lib-node-http2-secure.ts](conformance/lib-node-http2-secure.ts) | On `net/http`'s HTTP/2 (`http.Protocols`) |
972
+ | Compatibility API: `(req, res)` handlers get `Http2ServerRequest` / `Http2ServerResponse` (`httpVersion` `'2.0'`, pseudo-headers in `req.headers`) | ✅ | [lib-node-http2.ts](conformance/lib-node-http2.ts) | The node:http objects |
973
+ | `connect(authority, { ca, rejectUnauthorized, servername })` → `ClientHttp2Session` (`request`, `close`, `destroy`, `'connect'` / `'error'` / `'close'`, `alpnProtocol`, `encrypted`); `ClientHttp2Stream` (`'response'` with `:status`, body as a Readable, request bodies) | ✅ | [lib-node-http2.ts](conformance/lib-node-http2.ts), [lib-node-http2-secure.ts](conformance/lib-node-http2-secure.ts) | Connection failures error the session and cancel its streams (`ERR_HTTP2_STREAM_CANCEL`); request bodies are sent once the writable side ends |
974
+ | `constants`, `getDefaultSettings` | ✅ | [lib-node-http2.ts](conformance/lib-node-http2.ts) | |
975
+ | `ping`, `settings` / `goaway` / `altsvc`, `'session'` events, `getPackedSettings`, upgrades from HTTP/1 | ❌ | — | Go's bundled HTTP/2 hides frames: needs a vendored `golang.org/x/net/http2` |
976
+ | Server push | 🚫 | — | Deprecated (browsers removed it); Go's server doesn't push |
785
977
 
786
978
  #### `node:tls`
787
979
 
788
- | API | Status | Probe | Notes |
789
- | ----------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------- | ------------------------------------------------------------------------------------------- |
790
- | `createServer({ key, cert, ca, requestCert, ALPNProtocols, minVersion, maxVersion }, cb)` / `'secureConnection'` | ✅ | [lib-node-tls.ts](conformance/lib-node-tls.ts) | Handshakes run on the accept goroutine |
791
- | `connect` (`host`, `port`, `ca`, `servername`, `rejectUnauthorized`, client `key` / `cert`) / `'secureConnect'`; `TLSSocket` (`authorized`, `authorizationError`, `encrypted`, `alpnProtocol`, `getPeerCertificate`, `getProtocol`, `getCipher`) | ✅ | [lib-node-tls.ts](conformance/lib-node-tls.ts) | Node's verification codes: `DEPTH_ZERO_SELF_SIGNED_CERT`, `SELF_SIGNED_CERT_IN_CHAIN`, `UNABLE_TO_GET_ISSUER_CERT_LOCALLY`, `CERT_HAS_EXPIRED`, `ERR_TLS_CERT_ALTNAME_INVALID` |
792
- | `createSecureContext` / `getCiphers` / `DEFAULT_MIN_VERSION` / `DEFAULT_MAX_VERSION` | ✅ | — | Implemented, not probed; cipher names are Go's |
793
- | `checkServerIdentity` (function and `connect` option) | ✅ | [lib-node-tls-identity.ts](conformance/lib-node-tls-identity.ts) | Node's rules: one leftmost wildcard label, IP altnames, CN only without DNS altnames |
794
- | PFX / passphrase-protected keys, session resumption, `renegotiate`, `rootCertificates` | ❌ | — | Not implemented |
980
+ | API | Status | Probe | Notes |
981
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----: | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
982
+ | `createServer({ key, cert, ca, requestCert, ALPNProtocols, minVersion, maxVersion }, cb)` / `'secureConnection'` | ✅ | [lib-node-tls.ts](conformance/lib-node-tls.ts) | Handshakes run on the accept goroutine |
983
+ | `connect` (`host`, `port`, `ca`, `servername`, `rejectUnauthorized`, client `key` / `cert`) / `'secureConnect'`; `TLSSocket` (`authorized`, `authorizationError`, `encrypted`, `alpnProtocol`, `getPeerCertificate`, `getProtocol`, `getCipher`) | ✅ | [lib-node-tls.ts](conformance/lib-node-tls.ts) | Node's verification codes: `DEPTH_ZERO_SELF_SIGNED_CERT`, `SELF_SIGNED_CERT_IN_CHAIN`, `UNABLE_TO_GET_ISSUER_CERT_LOCALLY`, `CERT_HAS_EXPIRED`, `ERR_TLS_CERT_ALTNAME_INVALID` |
984
+ | `createSecureContext` / `getCiphers` / `DEFAULT_MIN_VERSION` / `DEFAULT_MAX_VERSION` | ✅ | — | Implemented, not probed; cipher names are Go's |
985
+ | `checkServerIdentity` (function and `connect` option) | ✅ | [lib-node-tls-identity.ts](conformance/lib-node-tls-identity.ts) | Node's rules: one leftmost wildcard label, IP altnames, CN only without DNS altnames |
986
+ | PFX / passphrase-protected keys, session resumption, `renegotiate`, `rootCertificates` | ❌ | — | Not implemented yet: PFX needs a PKCS#12 decoder; `rootCertificates` can embed Mozilla's bundle (as Node does); Go has session tickets (`ClientSessionCache`) and client-side renegotiation |
795
987
 
796
988
  #### `node:dgram`
797
989
 
798
- | API | Status | Probe | Notes |
799
- | ----------------------------------------------------------------------------------------- | :----: | ---------------------------------------------- | --------------------------------------------- |
800
- | `createSocket('udp4' \| 'udp6' \| { type })`, `bind`, `send` (offset / length forms, callback), `'message'(msg, rinfo)`, `address`, `close`, `connect` / `disconnect` / `remoteAddress`, `ref` / `unref` | ✅ | [lib-node-dgram.ts](conformance/lib-node-dgram.ts) | `send` binds an unbound socket first, as in Node |
801
- | Multicast membership, `setBroadcast` / `setTTL` effects | ❌ | — | Accepted without effect |
990
+ | API | Status | Probe | Notes |
991
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
992
+ | `createSocket('udp4' \| 'udp6' \| { type })`, `bind`, `send` (offset / length forms, callback), `'message'(msg, rinfo)`, `address`, `close`, `connect` / `disconnect` / `remoteAddress`, `ref` / `unref` | ✅ | [lib-node-dgram.ts](conformance/lib-node-dgram.ts) | `send` binds an unbound socket first, as in Node |
993
+ | `addMembership` / `dropMembership`, `setMulticastInterface` / `setMulticastTTL` / `setMulticastLoopback`, `setBroadcast`, `setTTL` | ✅ | [lib-node-dgram-multicast.ts](conformance/lib-node-dgram-multicast.ts) | `setsockopt` on the socket per OS (Linux, macOS, the BSDs, Windows). Options before `bind()` throw `EBADF` and membership binds an unbound socket, as in Node |
994
+ | `addSourceSpecificMembership` / `dropSourceSpecificMembership` | ❌ | — | Feasible: `IP_ADD_SOURCE_MEMBERSHIP`, whose struct layout differs per OS |
802
995
 
803
996
  #### `fetch`
804
997
 
805
- | API | Status | Probe | Notes |
806
- | ----------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------ | ------------------------------------------------------------------------------------------ |
807
- | `fetch(url \| Request, { method, headers, body, redirect, signal })`; `Response` (`status`, `ok`, `statusText`, `headers`, `url`, `redirected`, `text()` / `json()` / `bytes()` / `arrayBuffer()`, `clone()`, `Response.json` / `error` / `redirect`) | ✅ | [lib-node-fetch.ts](conformance/lib-node-fetch.ts) | Follows redirects (`manual` / `error` too); gzip bodies are decompressed; failures reject with `TypeError('fetch failed')` whose `cause` is the system error; aborts reject with `AbortError` |
808
- | `Headers` (`get` / `set` / `append` / `has` / `delete` / `forEach` / `entries` / `getSetCookie`, `for...of`) / `Request` | ✅ | [lib-node-fetch.ts](conformance/lib-node-fetch.ts) | Names are lower-cased and iterated in sorted order |
809
- | Streaming bodies: `response.body` / `request.body` as `ReadableStream`s, `ReadableStream` request bodies (`duplex: 'half'`), `clone()` tees the body | ✅ | [lib-node-fetch-stream.ts](conformance/lib-node-fetch-stream.ts) | Network bodies are read a chunk per pull |
810
- | `Blob` / `FormData` bodies (multipart encoding), `blob()` / `formData()` (multipart and urlencoded) | ✅ | [lib-node-blob.ts](conformance/lib-node-blob.ts), [lib-node-fetch-stream.ts](conformance/lib-node-fetch-stream.ts) | |
811
- | The Fetch standard's bad-port list (also on redirects) | ✅ | [lib-node-fetch-bad-port.ts](conformance/lib-node-fetch-bad-port.ts) | `TypeError: fetch failed` with cause `bad port` |
998
+ | API | Status | Probe | Notes |
999
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1000
+ | `fetch(url \| Request, { method, headers, body, redirect, signal })`; `Response` (`status`, `ok`, `statusText`, `headers`, `url`, `redirected`, `text()` / `json()` / `bytes()` / `arrayBuffer()`, `clone()`, `Response.json` / `error` / `redirect`) | ✅ | [lib-node-fetch.ts](conformance/lib-node-fetch.ts) | Follows redirects (`manual` / `error` too); gzip bodies are decompressed; failures reject with `TypeError('fetch failed')` whose `cause` is the system error; aborts reject with `AbortError` |
1001
+ | `Headers` (`get` / `set` / `append` / `has` / `delete` / `forEach` / `entries` / `getSetCookie`, `for...of`) / `Request` | ✅ | [lib-node-fetch.ts](conformance/lib-node-fetch.ts) | Names are lower-cased and iterated in sorted order |
1002
+ | Streaming bodies: `response.body` / `request.body` as `ReadableStream`s, `ReadableStream` request bodies (`duplex: 'half'`), `clone()` tees the body | ✅ | [lib-node-fetch-stream.ts](conformance/lib-node-fetch-stream.ts) | Network bodies are read a chunk per pull |
1003
+ | `Blob` / `FormData` bodies (multipart encoding), `blob()` / `formData()` (multipart and urlencoded) | ✅ | [lib-node-blob.ts](conformance/lib-node-blob.ts), [lib-node-fetch-stream.ts](conformance/lib-node-fetch-stream.ts) | |
1004
+ | The Fetch standard's bad-port list (also on redirects) | ✅ | [lib-node-fetch-bad-port.ts](conformance/lib-node-fetch-bad-port.ts) | `TypeError: fetch failed` with cause `bad port` |
812
1005
 
813
1006
  #### `node:async_hooks`
814
1007
 
815
- | API | Status | Probe | Notes |
816
- | ---------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
817
- | `AsyncLocalStorage` (`run`, `getStore`, `enterWith`, `exit`, `disable`, static `bind` / `snapshot`) | ✅ | [lib-node-async-hooks.ts](conformance/lib-node-async-hooks.ts) | The store follows timers, `setImmediate`, `nextTick`, microtasks, promise callbacks, `await`, async function bodies, fs / dns callbacks; streams, sockets and servers emit in the context they were created / listened in |
818
- | `AsyncResource` (`runInAsyncScope`, `bind`, `asyncId`, static `bind`) | ✅ | [lib-node-async-hooks.ts](conformance/lib-node-async-hooks.ts) | Captures the context it is created in |
819
- | `createHook` callbacks (`init` / `before` / `after` / `destroy`), real `executionAsyncId` / `triggerAsyncId` | ❌ | — | `createHook` is accepted but never calls back; ids are always `1` / `0` |
1008
+ | API | Status | Probe | Notes |
1009
+ | ------------------------------------------------------------------------------------------------------------ | :----: | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1010
+ | `AsyncLocalStorage` (`run`, `getStore`, `enterWith`, `exit`, `disable`, static `bind` / `snapshot`) | ✅ | [lib-node-async-hooks.ts](conformance/lib-node-async-hooks.ts) | The store follows timers, `setImmediate`, `nextTick`, microtasks, promise callbacks, `await`, async function bodies, fs / dns callbacks; streams, sockets and servers emit in the context they were created / listened in |
1011
+ | `AsyncResource` (`runInAsyncScope`, `bind`, `asyncId`, static `bind`) | ✅ | [lib-node-async-hooks.ts](conformance/lib-node-async-hooks.ts) | Captures the context it is created in |
1012
+ | `createHook` callbacks (`init` / `before` / `after` / `destroy`), real `executionAsyncId` / `triggerAsyncId` | ❌ | — | `createHook` is accepted but never calls back; ids are always `1` / `0`. Feasible: the event loop's `TnAsyncSnapshot` / `TnAsyncRun` are where the callbacks would fire |
820
1013
 
821
1014
  #### `node:test`
822
1015
 
823
- | API | Status | Probe | Notes |
824
- | ---------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
825
- | `test` / `it` / `describe` / `suite` (+ `.skip` / `.todo` / `.only`; `skip` / `todo` / `timeout` options); sync, async and `done`-callback tests | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | Tests run one after another once the main module has finished, as in Node |
826
- | `before` / `after` / `beforeEach` / `afterEach` (file and suite level, `t.before` & co.) | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | Node's order: outer `beforeEach` first, inner `afterEach` first |
827
- | `TestContext`: `t.test` subtests, `t.skip`, `t.todo`, `t.diagnostic`, `t.plan`, `t.name`, `t.fullName`, `t.signal`, `t.mock` | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | |
828
- | Reporting: TAP (Node's default when stdout is not a terminal) / spec (on a terminal); `tests` / `suites` / `pass` / `fail` / `cancelled` / `skipped` / `todo` counters; exit code 1 on failure | ✅ | [lib-node-test-fail.ts](conformance/lib-node-test-fail.ts) | Same layout as Node, without `location` / `stack` (a native binary has no source positions); timeouts count as cancelled |
829
- | `mock.fn(original?, implementation?)`; `fn.mock.calls` / `callCount()` / `mockImplementation(Once)` / `resetCalls()` / `restore()` | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | The mock has the original's Go function type |
830
- | `t.assert` (`node:assert`'s functions, counted by `t.plan`) and `mock.timers` (`enable({ apis, now })`, `tick`, `runAll`, `setTime`, `reset`; `setTimeout` / `setInterval` / `setImmediate` / `Date`) | ✅ | [lib-node-test-mock-timers.ts](conformance/lib-node-test-mock-timers.ts) | Mocked timers do not keep the process alive; `t.mock` timers reset after each test |
831
- | `mock.method` / `mock.getter` / `mock.setter` | ❌ | — | Go methods cannot be replaced at runtime |
832
- | Snapshots, coverage, `--test` / `--test-reporter` / `--test-only` flags, `run()` | ❌ | — | Not implemented (`only` runs everything, like Node without `--test-only`) |
1016
+ | API | Status | Probe | Notes |
1017
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----: | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1018
+ | `test` / `it` / `describe` / `suite` (+ `.skip` / `.todo` / `.only`; `skip` / `todo` / `timeout` options); sync, async and `done`-callback tests | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | Tests run one after another once the main module has finished, as in Node |
1019
+ | `before` / `after` / `beforeEach` / `afterEach` (file and suite level, `t.before` & co.) | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | Node's order: outer `beforeEach` first, inner `afterEach` first |
1020
+ | `TestContext`: `t.test` subtests, `t.skip`, `t.todo`, `t.diagnostic`, `t.plan`, `t.name`, `t.fullName`, `t.signal`, `t.mock` | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | |
1021
+ | Reporting: TAP (Node's default when stdout is not a terminal) / spec (on a terminal); `tests` / `suites` / `pass` / `fail` / `cancelled` / `skipped` / `todo` counters; exit code 1 on failure | ✅ | [lib-node-test-fail.ts](conformance/lib-node-test-fail.ts) | Same layout as Node, including each failure's `location` (`file:line:col`); stack traces are the remaining gap (the `//line` directives make them recoverable through `runtime.Callers`); timeouts count as cancelled |
1022
+ | `mock.fn(original?, implementation?)`; `fn.mock.calls` / `callCount()` / `mockImplementation(Once)` / `resetCalls()` / `restore()` | ✅ | [lib-node-test.ts](conformance/lib-node-test.ts) | The mock has the original's Go function type |
1023
+ | `t.assert` (`node:assert`'s functions, counted by `t.plan`) and `mock.timers` (`enable({ apis, now })`, `tick`, `runAll`, `setTime`, `reset`; `setTimeout` / `setInterval` / `setImmediate` / `Date`) | ✅ | [lib-node-test-mock-timers.ts](conformance/lib-node-test-mock-timers.ts) | Mocked timers do not keep the process alive; `t.mock` timers reset after each test |
1024
+ | `mock.method` / `mock.getter` / `mock.setter` | ✅ | [lib-node-test-mock-members.ts](conformance/lib-node-test-mock-members.ts) | Object-literal methods and getters swap the closure field; class methods route through per-instance override slots (other instances keep theirs, inherited members included); namespace functions (`console.log`, `Math.random`, …) dispatch by name; `t.mock` restores after each test |
1025
+ | `NODE_OPTIONS` flags: `--test-name-pattern` / `--test-skip-pattern` (repeatable, `/re/flags`), `--test-only`, `--test-reporter=tap\|spec\|dot\|junit` with `--test-reporter-destination` (a file, `stdout` or `stderr`, one per reporter); Node's notice for `.only` without `--test-only` | ✅ | [lib-node-test-flags.ts](conformance/lib-node-test-flags.ts) | Read from `NODE_OPTIONS`, as Node reads them (arguments after a program never reach Node's runner either). Filtered-out tests are not reported; a matching suite runs all its tests. The TAP / spec / dot outputs match Node's; junit's failure bodies have no stack traces |
1026
+ | Snapshots: `t.assert.snapshot` / `t.assert.fileSnapshot`, `--test-update-snapshots`, `snapshot.setDefaultSnapshotSerializers` / `setResolveSnapshotPath` | ✅ | [lib-node-test-snapshots.ts](conformance/lib-node-test-snapshots.ts) | Node's `<test file>.snapshot` format (entries sorted by name, JSON values), redirectable with `setResolveSnapshotPath`; a missing file or entry names the update flag |
1027
+ | `run({ files })`: a TestsStream (`test:pass` & co. events, `compose(reporter)`, `pipe`) | ✅ | [lib-node-test-run.ts](conformance/lib-node-test-run.ts) | Files with literal paths compile in as entry points and run as child processes; top-level numbering continues across files, child output becomes `test:stdout` / `test:stderr`, coverage and summaries merge |
1028
+ | Coverage: `--experimental-test-coverage`, `--test-coverage-include` / `-exclude`, `-lines` / `-branches` / `-functions` thresholds | ✅ | [lib-node-test-coverage.ts](conformance/lib-node-test-coverage.ts) | Programs that import `node:test` count what runs over V8-style source ranges (functions, blocks, ternary arms, `&&` / `\|\|` / `??` operands, class field initializers); `node:coverage ignore` comments exclude ranges; lcov records and the tap / spec table match Node's output |
833
1029
 
834
1030
  #### `node:worker_threads`
835
1031
 
836
- | API | Status | Probe | Notes |
837
- | ---------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
838
- | `Worker` (`workerData`, `argv`, `env` / `SHARE_ENV`; `postMessage`, `'online'` / `'message'` / `'error'` / `'exit'`, `terminate()`, `threadId`, `ref` / `unref`); `isMainThread`, `parentPort`, `workerData`, `threadId` | ✅ | [lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts) | A worker re-runs the current program as a child process (an isolate of its own, as in Node) linked over loopback TCP; branch on `isMainThread` |
839
- | Messages: structured clone of JSON-like values, Buffers (arriving as `Uint8Array`s), `Map`, `Set`, `Date`, `bigint`, errors | ✅ | [lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts) | Functions throw `DataCloneError` |
840
- | Uncaught exceptions in a worker / `terminate()` | ✅ | [lib-node-worker-errors.ts](conformance/lib-node-worker-errors.ts) | `'error'` with the message, then exit code `1` |
841
- | `MessageChannel` / `MessagePort` (`postMessage`, `on('message')`, `onmessage`, `start`, `close`, `ref` / `unref`), `receiveMessageOnPort`, `BroadcastChannel`, `get/setEnvironmentData` | ✅ | [lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts) | Channels and broadcast channels work within one process (ports can't be transferred to workers) |
842
- | Workers for another file / `eval: true`, transferring ports, `SharedArrayBuffer` / `Atomics`, `resourceLimits`, worker `stdout: true` streams | ❌ | — | One binary holds one program; memory is not shared between processes |
1032
+ | API | Status | Probe | Notes |
1033
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----: | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1034
+ | `Worker` (`workerData`, `argv`, `env` / `SHARE_ENV`; `postMessage`, `'online'` / `'message'` / `'error'` / `'exit'`, `terminate()`, `threadId`, `ref` / `unref`); `isMainThread`, `parentPort`, `workerData`, `threadId` | ✅ | [lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts) | A worker re-runs the current program as a child process (an isolate of its own, as in Node) linked over loopback TCP; branch on `isMainThread` |
1035
+ | Messages: structured clone of JSON-like values, Buffers (arriving as `Uint8Array`s), `Map`, `Set`, `Date`, `bigint`, errors | ✅ | [lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts) | Objects and records keep their key order, and convert to the listener's declared types; functions throw `DataCloneError` |
1036
+ | Uncaught exceptions in a worker / `terminate()` | ✅ | [lib-node-worker-errors.ts](conformance/lib-node-worker-errors.ts) | `'error'` with the message, then exit code `1` |
1037
+ | `MessageChannel` / `MessagePort` (`postMessage`, `on('message')`, `onmessage`, `start`, `close`, `ref` / `unref`), `receiveMessageOnPort`, `BroadcastChannel`, `get/setEnvironmentData` | ✅ | [lib-node-worker-threads.ts](conformance/lib-node-worker-threads.ts) | Channels and broadcast channels work within one process (ports can't be transferred to workers) |
1038
+ | `new Worker('./worker.ts')` (another file) | ✅ | [lib-node-worker-entry.ts](conformance/lib-node-worker-entry.ts) | The file (a literal path, `new URL('./f.ts', import.meta.url)` or `path.join(__dirname, 'f.ts')`, resolved from the source file at compile time) is compiled into the binary as a second entry point; the child runs it instead of the program, picked by `TN_ENTRY`. Its top-level names share one Go package with the program, so they must not clash; files the program imports still run their top-level code in every process |
1039
+ | Transferring ports, `resourceLimits`, worker `stdout: true` streams | ❌ | — | Ports can be relayed through the parent; `resourceLimits` maps to `debug.SetMemoryLimit` |
1040
+ | `eval: true`, `SharedArrayBuffer` / `Atomics` | 🚫 | — | `eval` needs a JavaScript engine; workers are processes, so memory is not shared |
843
1041
 
844
1042
  #### `node:sqlite`
845
1043
 
@@ -849,291 +1047,362 @@ ships the driver in [govendor/](govendor/) (`npm run vendor:go` updates it), so
849
1047
  network; it adds about 10 MB to a binary. Rows are records: `row.name`, `row as Row` and
850
1048
  `rows as Row[]` all work.
851
1049
 
852
- | API | Status | Probe | Notes |
853
- | --- | :----: | ----- | ----- |
854
- | `new DatabaseSync(path, options)` (`:memory:`, files, `file:` URIs), `open` / `close` / `isOpen` / `isTransaction` / `location()`, `exec` | ✅ | [lib-node-sqlite.ts](conformance/lib-node-sqlite.ts) | `open: false` defers to `open()` |
855
- | `prepare(sql, options)`; `StatementSync#run` (`{ changes, lastInsertRowid }`) / `get` / `all` / `iterate` (`for…of`, `next()`) | ✅ | [lib-node-sqlite.ts](conformance/lib-node-sqlite.ts) | Rows are objects keyed by column name; `get()` without a row is `undefined` |
856
- | Parameters: anonymous `?`, named `:x` / `$x` / `@x`, bare names (`{ x }`); values `null`, number (REAL), bigint (INTEGER), string, boolean (1 / 0), `Uint8Array` / Buffer | ✅ | [lib-node-sqlite.ts](conformance/lib-node-sqlite.ts) | Results: INTEGER → number (bigint with `readBigInts`), REAL → number, TEXT → string, BLOB → `Uint8Array`, NULL → `null` |
857
- | Options `readOnly`, `enableForeignKeyConstraints` (on by default), `enableDoubleQuotedStringLiterals`, `timeout`, `readBigInts`, `returnArrays`, `allowBareNamedParameters`, `allowUnknownNamedParameters`, `defensive`, `limits` | ✅ | [lib-node-sqlite-options.ts](conformance/lib-node-sqlite-options.ts) | `db.limits.x = n` sets a limit; `Infinity` restores the maximum |
858
- | `columns()`, `sourceSQL`, `expandedSQL`, `setReadBigInts` / `setReturnArrays` / `setAllowBareNamedParameters` / `setAllowUnknownNamedParameters`, `enableDefensive` | ✅ | [lib-node-sqlite-options.ts](conformance/lib-node-sqlite-options.ts) | |
859
- | `createTagStore()` (`` sql.get`… ${x}` `` / `all` / `run` / `iterate`, `size`, `capacity`, `clear`) | ✅ | [lib-node-sqlite-options.ts](conformance/lib-node-sqlite-options.ts) | One cached statement per template, least recently used out first |
860
- | `function(name, options, fn)` (`deterministic`, `directOnly`, `varargs`, `useBigIntArguments`), `aggregate(name, { start, step, result, inverse })` (window functions) | ✅ | [lib-node-sqlite-functions.ts](conformance/lib-node-sqlite-functions.ts) | A throw inside the callback is rethrown by the statement |
861
- | `setAuthorizer(callback)`, `constants` (`SQLITE_OK` / `DENY` / `IGNORE`, action codes, `SQLITE_CHANGESET_*`) | ✅ | [lib-node-sqlite-functions.ts](conformance/lib-node-sqlite-functions.ts) | |
862
- | Errors: SQLite's message with `code: 'ERR_SQLITE_ERROR'`, `errcode` (extended result code), `errstr`; `ERR_INVALID_STATE` / `ERR_OUT_OF_RANGE` / `ERR_INVALID_ARG_VALUE` | ✅ | [lib-node-sqlite-errors.ts](conformance/lib-node-sqlite-errors.ts) | Same messages as Node 24 |
863
- | `backup(db, path, { source, rate, progress })` | ✅ | [lib-node-sqlite-errors.ts](conformance/lib-node-sqlite-errors.ts) | Copies `rate` pages per event-loop turn; resolves with the page count |
864
- | `loadExtension` / `enableLoadExtension` | ❌ | — | SQLite runs as Wasm inside the program; native extensions can't load |
865
- | `createSession` / `applyChangeset` | ❌ | — | The bundled SQLite build has no session extension |
866
- | `serialize` / `deserialize` | ❌ | — | The driver has no `sqlite3_serialize` binding |
867
- | `undefined` as a parameter value, `[Object: null prototype]` rows | ❌ | — | `undefined` and `null` are both `nil` (binds NULL instead of throwing); rows print as plain objects |
868
- | Finalizing a statement when it is garbage-collected | ❌ | — | Statements live until `db.close()` (Go has no hook that is safe here): re-preparing in a loop holds every copy until then; reuse statements or `createTagStore()` |
1050
+ | API | Status | Probe | Notes |
1051
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----: | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
1052
+ | `new DatabaseSync(path, options)` (`:memory:`, files, `file:` URIs), `open` / `close` / `isOpen` / `isTransaction` / `location()`, `exec` | ✅ | [lib-node-sqlite.ts](conformance/lib-node-sqlite.ts) | `open: false` defers to `open()` |
1053
+ | `prepare(sql, options)`; `StatementSync#run` (`{ changes, lastInsertRowid }`) / `get` / `all` / `iterate` (`for…of`, `next()`) | ✅ | [lib-node-sqlite.ts](conformance/lib-node-sqlite.ts) | Rows are objects keyed by column name; `get()` without a row is `undefined` |
1054
+ | Parameters: anonymous `?`, named `:x` / `$x` / `@x`, bare names (`{ x }`); values `null`, number (REAL), bigint (INTEGER), string, boolean (1 / 0), `Uint8Array` / Buffer | ✅ | [lib-node-sqlite.ts](conformance/lib-node-sqlite.ts) | Results: INTEGER → number (bigint with `readBigInts`), REAL → number, TEXT → string, BLOB → `Uint8Array`, NULL → `null` |
1055
+ | Options `readOnly`, `enableForeignKeyConstraints` (on by default), `enableDoubleQuotedStringLiterals`, `timeout`, `readBigInts`, `returnArrays`, `allowBareNamedParameters`, `allowUnknownNamedParameters`, `defensive`, `limits` | ✅ | [lib-node-sqlite-options.ts](conformance/lib-node-sqlite-options.ts) | `db.limits.x = n` sets a limit; `Infinity` restores the maximum |
1056
+ | `columns()`, `sourceSQL`, `expandedSQL`, `setReadBigInts` / `setReturnArrays` / `setAllowBareNamedParameters` / `setAllowUnknownNamedParameters`, `enableDefensive` | ✅ | [lib-node-sqlite-options.ts](conformance/lib-node-sqlite-options.ts) | |
1057
+ | `createTagStore()` (`` sql.get`… ${x}` `` / `all` / `run` / `iterate`, `size`, `capacity`, `clear`) | ✅ | [lib-node-sqlite-options.ts](conformance/lib-node-sqlite-options.ts) | One cached statement per template, least recently used out first |
1058
+ | `function(name, options, fn)` (`deterministic`, `directOnly`, `varargs`, `useBigIntArguments`), `aggregate(name, { start, step, result, inverse })` (window functions) | ✅ | [lib-node-sqlite-functions.ts](conformance/lib-node-sqlite-functions.ts) | A throw inside the callback is rethrown by the statement |
1059
+ | `setAuthorizer(callback)`, `constants` (`SQLITE_OK` / `DENY` / `IGNORE`, action codes, `SQLITE_CHANGESET_*`) | ✅ | [lib-node-sqlite-functions.ts](conformance/lib-node-sqlite-functions.ts) | |
1060
+ | Errors: SQLite's message with `code: 'ERR_SQLITE_ERROR'`, `errcode` (extended result code), `errstr`; `ERR_INVALID_STATE` / `ERR_OUT_OF_RANGE` / `ERR_INVALID_ARG_VALUE` | ✅ | [lib-node-sqlite-errors.ts](conformance/lib-node-sqlite-errors.ts) | Same messages as Node 24 |
1061
+ | `backup(db, path, { source, rate, progress })` | ✅ | [lib-node-sqlite-errors.ts](conformance/lib-node-sqlite-errors.ts) | Copies `rate` pages per event-loop turn; resolves with the page count |
1062
+ | `loadExtension` / `enableLoadExtension` | 🚫 | — | SQLite runs as Wasm inside the program; native extensions can't load |
1063
+ | `createSession` / `applyChangeset` | ❌ | — | The bundled SQLite build has no session extension: needs an emulation over the preupdate hook (hard) |
1064
+ | `serialize(dbName?)` / `deserialize(buffer, { dbName })` | ✅ | [lib-node-sqlite-serialize.ts](conformance/lib-node-sqlite-serialize.ts) | Newer Node API (not in Node 22). The driver has no `sqlite3_serialize` binding, so the image goes through a temporary file and SQLite's backup API |
1065
+ | `undefined` as a parameter value, `[Object: null prototype]` rows | 🚫 | — | `undefined` and `null` are both `nil` (binds NULL instead of throwing); rows print as plain objects |
1066
+ | Finalizing a statement when it is garbage-collected | ✅ | [lib-node-sqlite-finalize.ts](conformance/lib-node-sqlite-finalize.ts) | `runtime.AddCleanup` posts the finalize to the event loop once nothing references the statement; `db.close()` finalizes the rest |
869
1067
 
870
1068
  #### `node:inspector`
871
1069
 
872
- | API | Status | Probe | Notes |
873
- | --- | :----: | ----- | ----- |
874
- | Debugger / profiler sessions (`Session`, `open`, `url`) | ❌ | — | Speaks the inspector protocol of a JavaScript engine; a native binary has none |
1070
+ | API | Status | Probe | Notes |
1071
+ | ------------------------------------------------------- | :----: | ----- | ------------------------------------------------------------------------------ |
1072
+ | Debugger / profiler sessions (`Session`, `open`, `url`) | 🚫 | — | Speaks the inspector protocol of a JavaScript engine; a native binary has none |
875
1073
 
876
1074
  #### `node:repl`
877
1075
 
878
- | API | Status | Probe | Notes |
879
- | --- | :----: | ----- | ----- |
880
- | `start` / `REPLServer` | ❌ | — | Evaluates JavaScript at runtime; needs a JavaScript engine |
1076
+ | API | Status | Probe | Notes |
1077
+ | ---------------------- | :----: | ----- | ---------------------------------------------------------- |
1078
+ | `start` / `REPLServer` | 🚫 | — | Evaluates JavaScript at runtime; needs a JavaScript engine |
881
1079
 
882
1080
  #### `node:vm`
883
1081
 
884
- | API | Status | Probe | Notes |
885
- | --- | :----: | ----- | ----- |
886
- | `Script` / `runInContext` / `createContext` / `compileFunction` & co. | ❌ | — | Compiles and runs JavaScript code at runtime; needs a JavaScript engine |
1082
+ | API | Status | Probe | Notes |
1083
+ | --------------------------------------------------------------------- | :----: | ----- | ----------------------------------------------------------------------- |
1084
+ | `Script` / `runInContext` / `createContext` / `compileFunction` & co. | 🚫 | — | Compiles and runs JavaScript code at runtime; needs a JavaScript engine |
887
1085
 
888
1086
  #### `node:v8`
889
1087
 
890
- | API | Status | Probe | Notes |
891
- | --- | :----: | ----- | ----- |
892
- | Heap statistics / snapshots, `serialize` / `deserialize`, flags | ❌ | — | V8 internals; there is no V8 in a native binary |
1088
+ | API | Status | Probe | Notes |
1089
+ | ------------------------------------------------------- | :----: | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1090
+ | `getHeapStatistics`, `serialize` / `deserialize` | ✅ | [lib-node-module-v8.ts](conformance/lib-node-module-v8.ts) | Heap numbers from `runtime.MemStats` (the limit is `GOMEMLIMIT`, else 4 GiB); `serialize` uses the structured-clone codec workers use, not V8's wire format; objects keep their key order |
1091
+ | `getHeapSpaceStatistics`, `getHeapCodeStatistics` | ❌ | — | Feasible as approximations; Go's heap has no V8 spaces |
1092
+ | Heap snapshots, `setFlagsFromString`, `startupSnapshot` | 🚫 | — | V8 internals; there is no V8 in a native binary |
893
1093
 
894
1094
  #### `node:wasi`
895
1095
 
896
- | API | Status | Probe | Notes |
897
- | --- | :----: | ----- | ----- |
898
- | `WASI` | ❌ | — | Runs WebAssembly modules; the generated program has no Wasm runtime |
1096
+ | API | Status | Probe | Notes |
1097
+ | ------ | :----: | ----- | -------------------------------------------------------------------------- |
1098
+ | `WASI` | ❌ | — | Needs a Wasm runtime: vendoring wazero (pure Go, no cgo) would provide one |
899
1099
 
900
1100
  #### `node:sea`
901
1101
 
902
- | API | Status | Probe | Notes |
903
- | --- | :----: | ----- | ----- |
904
- | `isSea` / `getAsset` / `getRawAsset` | ❌ | — | Single-executable-application assets; TypeNative already produces a native binary |
1102
+ | API | Status | Probe | Notes |
1103
+ | -------------------------------------- | :----: | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1104
+ | `isSea` | ✅ | [lib-node-module-v8.ts](conformance/lib-node-module-v8.ts) | Always `true`: every TypeNative binary is a single executable |
1105
+ | `getAsset` / `getRawAsset` with assets | ❌ | — | No SEA config is read, so no asset is added and these throw `ERR_SINGLE_EXECUTABLE_APPLICATION_ASSET_NOT_FOUND`; embed files with `go:embed` instead ([lib-go-embed.ts](conformance/lib-go-embed.ts)) |
905
1106
 
906
1107
  #### `node:trace_events`
907
1108
 
908
- | API | Status | Probe | Notes |
909
- | --- | :----: | ----- | ----- |
910
- | `createTracing` / `getEnabledCategories` | ❌ | — | V8 / Node trace categories; no native equivalent |
1109
+ | API | Status | Probe | Notes |
1110
+ | ---------------------------------------- | :----: | ----- | ------------------------------------------------ |
1111
+ | `createTracing` / `getEnabledCategories` | 🚫 | — | V8 / Node trace categories; no native equivalent |
911
1112
 
912
1113
  #### `node:module`
913
1114
 
914
- | API | Status | Probe | Notes |
915
- | --- | :----: | ----- | ----- |
916
- | `createRequire` / `register` / `builtinModules` / `findPackageJSON` & co. | ❌ | — | Loader hooks for a JavaScript runtime; imports are resolved at compile time |
1115
+ | API | Status | Probe | Notes |
1116
+ | ----------------------------------------------------------------------------- | :----: | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
1117
+ | `builtinModules` / `isBuiltin` | ✅ | [lib-node-module-v8.ts](conformance/lib-node-module-v8.ts) | Node 22's list; `node:test`, `node:sqlite` and `node:sea` need the scheme, as in Node |
1118
+ | `createRequire(import.meta.url)` and `require('./data.json')` | ✅ | [lib-json-modules.ts](conformance/lib-json-modules.ts) | JSON files only, read at compile time; `require` of a module reports an error (use `import`) |
1119
+ | `findPackageJSON`, `require` of modules | ❌ | — | Feasible: a literal module specifier resolved at compile time like an import |
1120
+ | `register` / `registerHooks` (loader hooks), `require` of computed specifiers | 🚫 | — | Hooks into a JavaScript loader; imports are resolved at compile time |
917
1121
 
918
1122
  #### `node:test/reporters`
919
1123
 
920
- | API | Status | Probe | Notes |
921
- | --- | :----: | ----- | ----- |
922
- | `tap` / `spec` / `dot` / `junit` / `lcov` | ❌ | — | Reporters consume `run()`'s event stream, and `run()` runs test files as separate processes; one binary holds one program (see [test](#nodetest)) |
1124
+ | API | Status | Probe | Notes |
1125
+ | ------------------------------------------- | :----: | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1126
+ | `tap` / `spec` / `dot` / `junit` as exports | ✅ | [lib-node-test-reporters.ts](conformance/lib-node-test-reporters.ts) | `tap` / `dot` / `junit` are generator functions over an event source (an array, an async generator, a stream such as `run()`'s); `spec` is a Transform stream for `compose()` — Node's output, byte for byte |
1127
+ | `lcov` | ✅ | [lib-node-test-reporters.ts](conformance/lib-node-test-reporters.ts) | A Transform stream (`new lcov()`, `compose(lcov)`); writes one record per `test:coverage` event (see coverage in [test](#nodetest)) |
923
1128
 
924
1129
  #### `node:domain`
925
1130
 
926
- | API | Status | Probe | Notes |
927
- | --- | :----: | ----- | ----- |
928
- | `create` / `Domain` | ❌ | — | Deprecated upstream |
1131
+ | API | Status | Probe | Notes |
1132
+ | ------------------- | :----: | ----- | ------------------- |
1133
+ | `create` / `Domain` | 🚫 | — | Deprecated upstream |
929
1134
 
930
1135
  ### Go bridges (`go:*`)
931
1136
 
932
- Status: ✅ probed, ⚠️ typed (declared and bridged), no probe yet, ❌ excluded.
1137
+ Status: ✅ probed, 🚫 can't work in a TypeNative program (see [Known limitations](#known-limitations-)).
933
1138
 
934
1139
  <!-- go-bridges:start -->
935
- | Module | Status | Probe | Notes |
936
- | ------ | :----: | ----- | ----- |
937
- | `go:archive/tar` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | tar archive read/write |
938
- | `go:archive/zip` | ✅ | [lib-go-archive.ts](conformance/lib-go-archive.ts) | ZIP archive read/write |
939
- | `go:bufio` | ✅ | [lib-go-bufio.ts](conformance/lib-go-bufio.ts) | Buffered I/O |
940
- | `go:bytes` | ✅ | [lib-go-bytes.ts](conformance/lib-go-bytes.ts) | Byte-slice utilities |
941
- | `go:cmp` | ✅ | [lib-go-slices.ts](conformance/lib-go-slices.ts) | Ordered comparison primitives |
942
- | `go:compress/bzip2` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | bzip2 decompression (read-only) |
943
- | `go:compress/flate` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | DEFLATE compression |
944
- | `go:compress/gzip` | ✅ | [lib-go-compress-gzip.ts](conformance/lib-go-compress-gzip.ts) | gzip read/write |
945
- | `go:compress/lzw` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | LZW compression (GIF/PDF/TIFF) |
946
- | `go:compress/zlib` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | zlib read/write |
947
- | `go:container/heap` | ✅ | [lib-go-container-heap.ts](conformance/lib-go-container-heap.ts) | A TS class implementing `heap.Interface` (see Go interfaces below) |
948
- | `go:container/list` | ✅ | [lib-go-containers.ts](conformance/lib-go-containers.ts) | Doubly linked list |
949
- | `go:container/ring` | ✅ | [lib-go-containers.ts](conformance/lib-go-containers.ts) | Circular list |
950
- | `go:context` | ✅ | [lib-go-sync.ts](conformance/lib-go-sync.ts) | Cancellation and deadlines |
951
- | `go:crypto` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | Crypto constants and algorithm selection |
952
- | `go:crypto/aes` | ✅ | [lib-go-crypto-aes.ts](conformance/lib-go-crypto-aes.ts) | AES encryption |
953
- | `go:crypto/cipher` | ✅ | [lib-go-crypto-aes.ts](conformance/lib-go-crypto-aes.ts) | Block cipher modes (GCM, CBC, CTR) |
954
- | `go:crypto/des` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | DES / triple DES (deprecated) |
955
- | `go:crypto/dsa` | ✅ | [lib-go-crypto-more.ts](conformance/lib-go-crypto-more.ts) | DSA signatures (deprecated) |
956
- | `go:crypto/ecdh` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | ECDH key exchange |
957
- | `go:crypto/ecdsa` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | ECDSA signatures |
958
- | `go:crypto/ed25519` | ✅ | [lib-go-ed25519.ts](conformance/lib-go-ed25519.ts) | Ed25519 signatures |
959
- | `go:crypto/elliptic` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | Elliptic curves (legacy; use ecdh/ecdsa) |
960
- | `go:crypto/fips140` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | FIPS 140-3 mode controls |
961
- | `go:crypto/hkdf` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | HKDF key derivation |
962
- | `go:crypto/hmac` | ✅ | [lib-go-crypto-hash.ts](conformance/lib-go-crypto-hash.ts) | HMAC keyed hashing |
963
- | `go:crypto/hpke` | ✅ | [lib-go-crypto-more.ts](conformance/lib-go-crypto-more.ts) | HPKE encryption (RFC 9180) |
964
- | `go:crypto/md5` | ✅ | [lib-go-crypto-hash.ts](conformance/lib-go-crypto-hash.ts) | MD5 hash |
965
- | `go:crypto/mlkem` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | ML-KEM post-quantum key encapsulation |
966
- | `go:crypto/mlkem/mlkemtest` | ✅ | [lib-go-crypto-more.ts](conformance/lib-go-crypto-more.ts) | Deterministic ML-KEM encapsulation |
967
- | `go:crypto/pbkdf2` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | PBKDF2 key derivation |
968
- | `go:crypto/rand` | ✅ | [lib-go-crypto-aes.ts](conformance/lib-go-crypto-aes.ts) | Cryptographically secure random bytes |
969
- | `go:crypto/rc4` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | RC4 stream cipher (deprecated) |
970
- | `go:crypto/rsa` | ✅ | [lib-go-rsa.ts](conformance/lib-go-rsa.ts) | RSA signatures / encryption |
971
- | `go:crypto/sha1` | ✅ | [lib-go-crypto-hash.ts](conformance/lib-go-crypto-hash.ts) | SHA-1 hash |
972
- | `go:crypto/sha256` | ✅ | [lib-go-hash.ts](conformance/lib-go-hash.ts) | SHA-224 / SHA-256 hashes |
973
- | `go:crypto/sha3` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | SHA-3 / SHAKE hashes |
974
- | `go:crypto/sha512` | ✅ | [lib-go-crypto-hash.ts](conformance/lib-go-crypto-hash.ts) | SHA-384 / SHA-512 family hashes |
975
- | `go:crypto/subtle` | ✅ | [lib-go-crypto-aes.ts](conformance/lib-go-crypto-aes.ts) | Constant-time comparison primitives |
976
- | `go:crypto/tls` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | TLS client/server; loopback probe is a later phase |
977
- | `go:crypto/x509` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | X.509 certificates and revocation |
978
- | `go:crypto/x509/pkix` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | X.509 ASN.1/PKIX structures |
979
- | `go:database/sql` | ✅ | [lib-go-sql.ts](conformance/lib-go-sql.ts) | No std driver: registry and errors probed |
980
- | `go:database/sql/driver` | ✅ | [lib-go-sql.ts](conformance/lib-go-sql.ts) | Driver interfaces and value converters |
981
- | `go:debug/buildinfo` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Build info from executables |
982
- | `go:debug/dwarf` | ⚠️ | — | DWARF debug info parsing |
983
- | `go:debug/elf` | ⚠️ | — | ELF object files |
984
- | `go:debug/gosym` | ⚠️ | — | Go symbol tables |
985
- | `go:debug/macho` | ⚠️ | — | Mach-O object files |
986
- | `go:debug/pe` | ⚠️ | — | PE (Windows) object files |
987
- | `go:debug/plan9obj` | ⚠️ | — | Plan 9 object files |
988
- | `go:encoding` | ✅ | [lib-go-encoding.ts](conformance/lib-go-encoding.ts) | Shared encoding interfaces |
989
- | `go:encoding/ascii85` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | ascii85 encoding |
990
- | `go:encoding/asn1` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | ASN.1 DER encoding |
991
- | `go:encoding/base32` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | base32 encoding |
992
- | `go:encoding/base64` | ✅ | [lib-go-encoding.ts](conformance/lib-go-encoding.ts) | base64 encoding |
993
- | `go:encoding/binary` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | Binary packing / varints |
994
- | `go:encoding/csv` | ✅ | [lib-go-csv.ts](conformance/lib-go-csv.ts) | CSV read/write |
995
- | `go:encoding/gob` | ✅ | [lib-go-gob.ts](conformance/lib-go-gob.ts) | Go binary serialization |
996
- | `go:encoding/hex` | ✅ | [lib-go-encoding.ts](conformance/lib-go-encoding.ts) | hex encoding |
997
- | `go:encoding/json` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | JSON encode/decode |
998
- | `go:encoding/pem` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | PEM encoding |
999
- | `go:encoding/xml` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | XML read/write |
1000
- | `go:errors` | ✅ | [lib-go-errors.ts](conformance/lib-go-errors.ts) | Error creation / wrapping / inspection |
1001
- | `go:expvar` | ✅ | [lib-go-runtime.ts](conformance/lib-go-runtime.ts) | Public process variables |
1002
- | `go:flag` | ✅ | [lib-go-exec.ts](conformance/lib-go-exec.ts) | Command-line flag parsing |
1003
- | `go:fmt` | ✅ | [lib-go-fmt.ts](conformance/lib-go-fmt.ts) | Formatted I/O; integer verbs take TS numbers |
1004
- | `go:go/ast` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Go syntax tree |
1005
- | `go:go/build` | ✅ | [lib-go-gotypes.ts](conformance/lib-go-gotypes.ts) | Go package build metadata |
1006
- | `go:go/build/constraint` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Build-tag constraint parsing |
1007
- | `go:go/constant` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Untyped constant values |
1008
- | `go:go/doc` | ✅ | [lib-go-gotypes.ts](conformance/lib-go-gotypes.ts) | Go doc extraction |
1009
- | `go:go/doc/comment` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Doc comment parse/print |
1010
- | `go:go/format` | ✅ | [lib-go-gotools.ts](conformance/lib-go-gotools.ts) | Go source formatting |
1011
- | `go:go/importer` | ✅ | [lib-go-gotypes.ts](conformance/lib-go-gotypes.ts) | Export-data type importer |
1012
- | `go:go/parser` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Go source parser |
1013
- | `go:go/printer` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Go AST printer |
1014
- | `go:go/scanner` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Go tokenizer |
1015
- | `go:go/token` | ✅ | [lib-go-gotools.ts](conformance/lib-go-gotools.ts) | Go tokens / positions |
1016
- | `go:go/types` | ✅ | [lib-go-gotypes.ts](conformance/lib-go-gotypes.ts) | Go type checker |
1017
- | `go:go/version` | ✅ | [lib-go-gotools.ts](conformance/lib-go-gotools.ts) | Go version comparison |
1018
- | `go:hash` | ✅ | [lib-go-hash.ts](conformance/lib-go-hash.ts) | Hash function interface |
1019
- | `go:hash/adler32` | ✅ | [lib-go-hash-extra.ts](conformance/lib-go-hash-extra.ts) | Adler-32 checksum |
1020
- | `go:hash/crc32` | ✅ | [lib-go-hash.ts](conformance/lib-go-hash.ts) | CRC-32 checksum |
1021
- | `go:hash/crc64` | ✅ | [lib-go-hash-extra.ts](conformance/lib-go-hash-extra.ts) | CRC-64 checksum |
1022
- | `go:hash/fnv` | ✅ | [lib-go-hash.ts](conformance/lib-go-hash.ts) | FNV-1 / FNV-1a hash |
1023
- | `go:hash/maphash` | ✅ | [lib-go-hash-extra.ts](conformance/lib-go-hash-extra.ts) | Seeded string hashing |
1024
- | `go:html` | ✅ | [lib-go-url.ts](conformance/lib-go-url.ts) | HTML escaping |
1025
- | `go:html/template` | ✅ | [lib-go-text-extra.ts](conformance/lib-go-text-extra.ts) | HTML templating (auto-escaped) |
1026
- | `go:image` | ✅ | [lib-go-image.ts](conformance/lib-go-image.ts) | 2D image interface |
1027
- | `go:image/color` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | Color types |
1028
- | `go:image/color/palette` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | Standard color palettes |
1029
- | `go:image/draw` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | Image compositing |
1030
- | `go:image/gif` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | GIF decode/encode |
1031
- | `go:image/jpeg` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | JPEG decode/encode |
1032
- | `go:image/png` | ✅ | [lib-go-image.ts](conformance/lib-go-image.ts) | PNG decode/encode |
1033
- | `go:index/suffixarray` | ✅ | [lib-go-text.ts](conformance/lib-go-text.ts) | Suffix-array substring search |
1034
- | `go:io` | ✅ | [lib-go-compress-gzip.ts](conformance/lib-go-compress-gzip.ts) | Core I/O interfaces (Reader/Writer) |
1035
- | `go:io/fs` | ✅ | [lib-go-path-fs.ts](conformance/lib-go-path-fs.ts) | Filesystem abstraction |
1036
- | `go:io/ioutil` | ✅ | [lib-go-path-fs.ts](conformance/lib-go-path-fs.ts) | Deprecated I/O helpers (Go 1.16) |
1037
- | `go:iter` | ✅ | [lib-go-collections.ts](conformance/lib-go-collections.ts) | Range-over-func iterators via `for…of`; `Pull` not bridged |
1038
- | `go:log` | ✅ | [lib-go-log.ts](conformance/lib-go-log.ts) | Logging to stderr |
1039
- | `go:log/slog` | ✅ | [lib-go-log.ts](conformance/lib-go-log.ts) | Structured logging |
1040
- | `go:log/syslog` | ⚠️ | — | Unix syslog; no portable probe |
1041
- | `go:maps` | ✅ | [lib-go-collections.ts](conformance/lib-go-collections.ts) | Generic map helpers |
1042
- | `go:math` | ✅ | [lib-go-math.ts](conformance/lib-go-math.ts) | Math functions |
1043
- | `go:math/big` | ✅ | [lib-go-big.ts](conformance/lib-go-big.ts) | Arbitrary-precision arithmetic |
1044
- | `go:math/bits` | ✅ | [lib-go-math-extra.ts](conformance/lib-go-math-extra.ts) | Bit operations |
1045
- | `go:math/cmplx` | ⚠️ | — | `complex128` has no TS mapping |
1046
- | `go:math/rand` | ✅ | [lib-go-math-extra.ts](conformance/lib-go-math-extra.ts) | Pseudo-random numbers |
1047
- | `go:math/rand/v2` | ✅ | [lib-go-math-extra.ts](conformance/lib-go-math-extra.ts) | Pseudo-random numbers (v2 API) |
1048
- | `go:mime` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | MIME media types |
1049
- | `go:mime/multipart` | ✅ | [lib-go-misc.ts](conformance/lib-go-misc.ts) | Multipart forms |
1050
- | `go:mime/quotedprintable` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | Quoted-printable encoding |
1051
- | `go:net` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | Sockets (loopback TCP), addresses |
1052
- | `go:net/http` | ✅ | [lib-go-http.ts](conformance/lib-go-http.ts) | HTTP client/server (loopback) |
1053
- | `go:net/http/cgi` | ✅ | [lib-go-http-extra.ts](conformance/lib-go-http-extra.ts) | CGI request parsing |
1054
- | `go:net/http/cookiejar` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | Cookie jars (loopback) |
1055
- | `go:net/http/fcgi` | ⚠️ | — | FastCGI handler; needs a FastCGI web server |
1056
- | `go:net/http/httptest` | ✅ | [lib-go-http.ts](conformance/lib-go-http.ts) | HTTP test servers (loopback) |
1057
- | `go:net/http/httptrace` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | HTTP tracing hooks |
1058
- | `go:net/http/httputil` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | HTTP utilities (loopback) |
1059
- | `go:net/http/pprof` | ✅ | [lib-go-http-extra.ts](conformance/lib-go-http-extra.ts) | pprof HTTP handlers |
1060
- | `go:net/mail` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | Mail address parsing |
1061
- | `go:net/netip` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | IP address types |
1062
- | `go:net/rpc` | ⚠️ | — | Needs Go method sets on registered receivers |
1063
- | `go:net/rpc/jsonrpc` | ⚠️ | — | Needs Go method sets on registered receivers |
1064
- | `go:net/smtp` | ⚠️ | — | SMTP client; needs a server |
1065
- | `go:net/textproto` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | Text protocol I/O |
1066
- | `go:net/url` | ✅ | [lib-go-url.ts](conformance/lib-go-url.ts) | URL parsing |
1067
- | `go:os` | ✅ | [lib-go-os.ts](conformance/lib-go-os.ts) | OS files and processes |
1068
- | `go:os/exec` | ✅ | [lib-go-exec.ts](conformance/lib-go-exec.ts) | External commands |
1069
- | `go:os/signal` | ✅ | [lib-go-misc.ts](conformance/lib-go-misc.ts) | Signal notification (`Notify` + `Stop`) |
1070
- | `go:os/user` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | User lookup |
1071
- | `go:path` | ✅ | [lib-go-path-fs.ts](conformance/lib-go-path-fs.ts) | Slash-separated paths |
1072
- | `go:path/filepath` | ✅ | [lib-go-os.ts](conformance/lib-go-os.ts) | File paths |
1073
- | `go:reflect` | ✅ | [lib-go-text-extra.ts](conformance/lib-go-text-extra.ts) | Runtime reflection |
1074
- | `go:regexp` | ✅ | [lib-go-regexp.ts](conformance/lib-go-regexp.ts) | Regular expressions |
1075
- | `go:regexp/syntax` | ✅ | [lib-go-text-extra.ts](conformance/lib-go-text-extra.ts) | Regexp parse trees |
1076
- | `go:runtime` | ✅ | [lib-go-runtime.ts](conformance/lib-go-runtime.ts) | Runtime introspection |
1077
- | `go:runtime/debug` | ✅ | [lib-go-runtime.ts](conformance/lib-go-runtime.ts) | Stack traces and GC stats |
1078
- | `go:runtime/metrics` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Runtime metrics sampling |
1079
- | `go:runtime/pprof` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Profiling data |
1080
- | `go:runtime/trace` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Execution tracing |
1081
- | `go:slices` | ✅ | [lib-go-slices.ts](conformance/lib-go-slices.ts) | Generic slice helpers |
1082
- | `go:sort` | ✅ | [lib-go-sort.ts](conformance/lib-go-sort.ts) | Sorting |
1083
- | `go:strconv` | ✅ | [lib-go-strconv.ts](conformance/lib-go-strconv.ts) | String conversions |
1084
- | `go:strings` | ✅ | [lib-go-strings.ts](conformance/lib-go-strings.ts) | String utilities |
1085
- | `go:structs` | ✅ | [lib-go-lowlevel.ts](conformance/lib-go-lowlevel.ts) | `HostLayout` marker |
1086
- | `go:sync` | ✅ | [lib-go-sync.ts](conformance/lib-go-sync.ts) | Mutexes and wait groups |
1087
- | `go:sync/atomic` | ✅ | [lib-go-sync.ts](conformance/lib-go-sync.ts) | Atomic operations |
1088
- | `go:syscall` | ✅ | [lib-go-lowlevel.ts](conformance/lib-go-lowlevel.ts) | Portable subset probed; per-arch constants dropped |
1089
- | `go:testing` | ✅ | [lib-go-testing.ts](conformance/lib-go-testing.ts) | Helpers usable outside `go test` |
1090
- | `go:testing/cryptotest` | ⚠️ | — | Needs a `*testing.T` (no `go test` harness) |
1091
- | `go:testing/fstest` | ✅ | [lib-go-testing.ts](conformance/lib-go-testing.ts) | `TestFS` over any `fs.FS` |
1092
- | `go:testing/iotest` | ✅ | [lib-go-testing.ts](conformance/lib-go-testing.ts) | Reader/writer test wrappers |
1093
- | `go:testing/quick` | ✅ | [lib-go-testing.ts](conformance/lib-go-testing.ts) | Property checks with TS callbacks |
1094
- | `go:testing/slogtest` | ⚠️ | — | Needs a `*testing.T` (no `go test` harness) |
1095
- | `go:testing/synctest` | ⚠️ | — | Needs a `*testing.T` (no `go test` harness) |
1096
- | `go:text/scanner` | ✅ | [lib-go-text.ts](conformance/lib-go-text.ts) | Text scanner |
1097
- | `go:text/tabwriter` | ✅ | [lib-go-text.ts](conformance/lib-go-text.ts) | Aligned text columns |
1098
- | `go:text/template` | ✅ | [lib-go-template.ts](conformance/lib-go-template.ts) | Text templating |
1099
- | `go:text/template/parse` | ✅ | [lib-go-text-extra.ts](conformance/lib-go-text-extra.ts) | Template parse trees |
1100
- | `go:time` | ✅ | [lib-go-time.ts](conformance/lib-go-time.ts) | Time and durations |
1101
- | `go:time/tzdata` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Embedded timezone database (side-effect import) |
1102
- | `go:unicode` | ✅ | [lib-go-unicode.ts](conformance/lib-go-unicode.ts) | Unicode tables |
1103
- | `go:unicode/utf16` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | UTF-16 encoding |
1104
- | `go:unicode/utf8` | ✅ | [lib-go-unicode.ts](conformance/lib-go-unicode.ts) | UTF-8 encoding |
1105
- | `go:unique` | ✅ | [lib-go-collections.ts](conformance/lib-go-collections.ts) | Canonical values |
1106
- | `go:weak` | ✅ | [lib-go-lowlevel.ts](conformance/lib-go-lowlevel.ts) | Weak pointers |
1107
- | `go:plugin` | ❌ | — | cgo, `-buildmode=plugin` |
1108
- | `go:unsafe` | ❌ | — | raw pointers |
1109
- | `go:runtime/race` | ❌ | — | needs `-race` |
1110
- | `go:runtime/coverage` | ❌ | — | needs `-cover` |
1111
- | `go:runtime/cgo` | ❌ | — | needs cgo |
1112
- | `go:embed` | ❌ | — | needs a `//go:embed` directive; a later phase |
1140
+
1141
+ | Module | Status | Probe | Notes |
1142
+ | --------------------------- | :----: | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
1143
+ | `go:archive/tar` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | tar archive read/write |
1144
+ | `go:archive/zip` | ✅ | [lib-go-archive.ts](conformance/lib-go-archive.ts) | ZIP archive read/write |
1145
+ | `go:bufio` | ✅ | [lib-go-bufio.ts](conformance/lib-go-bufio.ts) | Buffered I/O |
1146
+ | `go:bytes` | ✅ | [lib-go-bytes.ts](conformance/lib-go-bytes.ts) | Byte-slice utilities |
1147
+ | `go:cmp` | ✅ | [lib-go-slices.ts](conformance/lib-go-slices.ts) | Ordered comparison primitives |
1148
+ | `go:compress/bzip2` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | bzip2 decompression (read-only) |
1149
+ | `go:compress/flate` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | DEFLATE compression |
1150
+ | `go:compress/gzip` | ✅ | [lib-go-compress-gzip.ts](conformance/lib-go-compress-gzip.ts) | gzip read/write |
1151
+ | `go:compress/lzw` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | LZW compression (GIF/PDF/TIFF) |
1152
+ | `go:compress/zlib` | ✅ | [lib-go-compress-extra.ts](conformance/lib-go-compress-extra.ts) | zlib read/write |
1153
+ | `go:container/heap` | ✅ | [lib-go-container-heap.ts](conformance/lib-go-container-heap.ts) | A TS class implementing `heap.Interface` (see Go interfaces below) |
1154
+ | `go:container/list` | ✅ | [lib-go-containers.ts](conformance/lib-go-containers.ts) | Doubly linked list |
1155
+ | `go:container/ring` | ✅ | [lib-go-containers.ts](conformance/lib-go-containers.ts) | Circular list |
1156
+ | `go:context` | ✅ | [lib-go-sync.ts](conformance/lib-go-sync.ts) | Cancellation and deadlines |
1157
+ | `go:crypto` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | Crypto constants and algorithm selection |
1158
+ | `go:crypto/aes` | ✅ | [lib-go-crypto-aes.ts](conformance/lib-go-crypto-aes.ts) | AES encryption |
1159
+ | `go:crypto/cipher` | ✅ | [lib-go-crypto-aes.ts](conformance/lib-go-crypto-aes.ts) | Block cipher modes (GCM, CBC, CTR) |
1160
+ | `go:crypto/des` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | DES / triple DES (deprecated) |
1161
+ | `go:crypto/dsa` | ✅ | [lib-go-crypto-more.ts](conformance/lib-go-crypto-more.ts) | DSA signatures (deprecated) |
1162
+ | `go:crypto/ecdh` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | ECDH key exchange |
1163
+ | `go:crypto/ecdsa` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | ECDSA signatures |
1164
+ | `go:crypto/ed25519` | ✅ | [lib-go-ed25519.ts](conformance/lib-go-ed25519.ts) | Ed25519 signatures |
1165
+ | `go:crypto/elliptic` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | Elliptic curves (legacy; use ecdh/ecdsa) |
1166
+ | `go:crypto/fips140` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | FIPS 140-3 mode controls |
1167
+ | `go:crypto/hkdf` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | HKDF key derivation |
1168
+ | `go:crypto/hmac` | ✅ | [lib-go-crypto-hash.ts](conformance/lib-go-crypto-hash.ts) | HMAC keyed hashing |
1169
+ | `go:crypto/hpke` | ✅ | [lib-go-crypto-more.ts](conformance/lib-go-crypto-more.ts) | HPKE encryption (RFC 9180) |
1170
+ | `go:crypto/md5` | ✅ | [lib-go-crypto-hash.ts](conformance/lib-go-crypto-hash.ts) | MD5 hash |
1171
+ | `go:crypto/mlkem` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | ML-KEM post-quantum key encapsulation |
1172
+ | `go:crypto/mlkem/mlkemtest` | ✅ | [lib-go-crypto-more.ts](conformance/lib-go-crypto-more.ts) | Deterministic ML-KEM encapsulation |
1173
+ | `go:crypto/pbkdf2` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | PBKDF2 key derivation |
1174
+ | `go:crypto/rand` | ✅ | [lib-go-crypto-aes.ts](conformance/lib-go-crypto-aes.ts) | Cryptographically secure random bytes |
1175
+ | `go:crypto/rc4` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | RC4 stream cipher (deprecated) |
1176
+ | `go:crypto/rsa` | ✅ | [lib-go-rsa.ts](conformance/lib-go-rsa.ts) | RSA signatures / encryption |
1177
+ | `go:crypto/sha1` | ✅ | [lib-go-crypto-hash.ts](conformance/lib-go-crypto-hash.ts) | SHA-1 hash |
1178
+ | `go:crypto/sha256` | ✅ | [lib-go-hash.ts](conformance/lib-go-hash.ts) | SHA-224 / SHA-256 hashes |
1179
+ | `go:crypto/sha3` | ✅ | [lib-go-crypto-extra.ts](conformance/lib-go-crypto-extra.ts) | SHA-3 / SHAKE hashes |
1180
+ | `go:crypto/sha512` | ✅ | [lib-go-crypto-hash.ts](conformance/lib-go-crypto-hash.ts) | SHA-384 / SHA-512 family hashes |
1181
+ | `go:crypto/subtle` | ✅ | [lib-go-crypto-aes.ts](conformance/lib-go-crypto-aes.ts) | Constant-time comparison primitives |
1182
+ | `go:crypto/tls` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | TLS client/server; loopback probe is a later phase |
1183
+ | `go:crypto/x509` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | X.509 certificates and revocation |
1184
+ | `go:crypto/x509/pkix` | ✅ | [lib-go-crypto-keys.ts](conformance/lib-go-crypto-keys.ts) | X.509 ASN.1/PKIX structures |
1185
+ | `go:database/sql` | ✅ | [lib-go-sql.ts](conformance/lib-go-sql.ts) | No std driver: registry and errors probed |
1186
+ | `go:database/sql/driver` | ✅ | [lib-go-sql.ts](conformance/lib-go-sql.ts) | Driver interfaces and value converters |
1187
+ | `go:debug/buildinfo` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Build info from executables |
1188
+ | `go:debug/dwarf` | ✅ | [lib-go-debug.ts](conformance/lib-go-debug.ts) | DWARF debug info parsing |
1189
+ | `go:debug/elf` | ✅ | [lib-go-debug.ts](conformance/lib-go-debug.ts) | ELF object files |
1190
+ | `go:debug/gosym` | ✅ | [lib-go-debug.ts](conformance/lib-go-debug.ts) | Go symbol tables |
1191
+ | `go:debug/macho` | ✅ | [lib-go-debug.ts](conformance/lib-go-debug.ts) | Mach-O object files |
1192
+ | `go:debug/pe` | ✅ | [lib-go-debug.ts](conformance/lib-go-debug.ts) | PE (Windows) object files |
1193
+ | `go:debug/plan9obj` | ✅ | [lib-go-debug.ts](conformance/lib-go-debug.ts) | Plan 9 object files |
1194
+ | `go:embed` | ✅ | [lib-go-embed.ts](conformance/lib-go-embed.ts) | `embed.string` / `bytes` / `files` compile to `//go:embed` vars |
1195
+ | `go:encoding` | ✅ | [lib-go-encoding.ts](conformance/lib-go-encoding.ts) | Shared encoding interfaces |
1196
+ | `go:encoding/ascii85` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | ascii85 encoding |
1197
+ | `go:encoding/asn1` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | ASN.1 DER encoding |
1198
+ | `go:encoding/base32` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | base32 encoding |
1199
+ | `go:encoding/base64` | ✅ | [lib-go-encoding.ts](conformance/lib-go-encoding.ts) | base64 encoding |
1200
+ | `go:encoding/binary` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | Binary packing / varints |
1201
+ | `go:encoding/csv` | ✅ | [lib-go-csv.ts](conformance/lib-go-csv.ts) | CSV read/write |
1202
+ | `go:encoding/gob` | ✅ | [lib-go-gob.ts](conformance/lib-go-gob.ts) | Go binary serialization |
1203
+ | `go:encoding/hex` | ✅ | [lib-go-encoding.ts](conformance/lib-go-encoding.ts) | hex encoding |
1204
+ | `go:encoding/json` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | JSON encode/decode |
1205
+ | `go:encoding/pem` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | PEM encoding |
1206
+ | `go:encoding/xml` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | XML read/write |
1207
+ | `go:errors` | ✅ | [lib-go-errors.ts](conformance/lib-go-errors.ts) | Error creation / wrapping / inspection |
1208
+ | `go:expvar` | ✅ | [lib-go-runtime.ts](conformance/lib-go-runtime.ts) | Public process variables |
1209
+ | `go:flag` | ✅ | [lib-go-exec.ts](conformance/lib-go-exec.ts) | Command-line flag parsing |
1210
+ | `go:fmt` | ✅ | [lib-go-fmt.ts](conformance/lib-go-fmt.ts) | Formatted I/O; integer verbs take TS numbers |
1211
+ | `go:go/ast` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Go syntax tree |
1212
+ | `go:go/build` | ✅ | [lib-go-gotypes.ts](conformance/lib-go-gotypes.ts) | Go package build metadata |
1213
+ | `go:go/build/constraint` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Build-tag constraint parsing |
1214
+ | `go:go/constant` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Untyped constant values |
1215
+ | `go:go/doc` | ✅ | [lib-go-gotypes.ts](conformance/lib-go-gotypes.ts) | Go doc extraction |
1216
+ | `go:go/doc/comment` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Doc comment parse/print |
1217
+ | `go:go/format` | ✅ | [lib-go-gotools.ts](conformance/lib-go-gotools.ts) | Go source formatting |
1218
+ | `go:go/importer` | ✅ | [lib-go-gotypes.ts](conformance/lib-go-gotypes.ts) | Export-data type importer |
1219
+ | `go:go/parser` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Go source parser |
1220
+ | `go:go/printer` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Go AST printer |
1221
+ | `go:go/scanner` | ✅ | [lib-go-gotools-extra.ts](conformance/lib-go-gotools-extra.ts) | Go tokenizer |
1222
+ | `go:go/token` | ✅ | [lib-go-gotools.ts](conformance/lib-go-gotools.ts) | Go tokens / positions |
1223
+ | `go:go/types` | ✅ | [lib-go-gotypes.ts](conformance/lib-go-gotypes.ts) | Go type checker |
1224
+ | `go:go/version` | ✅ | [lib-go-gotools.ts](conformance/lib-go-gotools.ts) | Go version comparison |
1225
+ | `go:hash` | ✅ | [lib-go-hash.ts](conformance/lib-go-hash.ts) | Hash function interface |
1226
+ | `go:hash/adler32` | ✅ | [lib-go-hash-extra.ts](conformance/lib-go-hash-extra.ts) | Adler-32 checksum |
1227
+ | `go:hash/crc32` | ✅ | [lib-go-hash.ts](conformance/lib-go-hash.ts) | CRC-32 checksum |
1228
+ | `go:hash/crc64` | ✅ | [lib-go-hash-extra.ts](conformance/lib-go-hash-extra.ts) | CRC-64 checksum |
1229
+ | `go:hash/fnv` | ✅ | [lib-go-hash.ts](conformance/lib-go-hash.ts) | FNV-1 / FNV-1a hash |
1230
+ | `go:hash/maphash` | ✅ | [lib-go-hash-extra.ts](conformance/lib-go-hash-extra.ts) | Seeded string hashing |
1231
+ | `go:html` | ✅ | [lib-go-url.ts](conformance/lib-go-url.ts) | HTML escaping |
1232
+ | `go:html/template` | ✅ | [lib-go-text-extra.ts](conformance/lib-go-text-extra.ts) | HTML templating (auto-escaped) |
1233
+ | `go:image` | ✅ | [lib-go-image.ts](conformance/lib-go-image.ts) | 2D image interface |
1234
+ | `go:image/color` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | Color types |
1235
+ | `go:image/color/palette` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | Standard color palettes |
1236
+ | `go:image/draw` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | Image compositing |
1237
+ | `go:image/gif` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | GIF decode/encode |
1238
+ | `go:image/jpeg` | ✅ | [lib-go-image-extra.ts](conformance/lib-go-image-extra.ts) | JPEG decode/encode |
1239
+ | `go:image/png` | ✅ | [lib-go-image.ts](conformance/lib-go-image.ts) | PNG decode/encode |
1240
+ | `go:index/suffixarray` | ✅ | [lib-go-text.ts](conformance/lib-go-text.ts) | Suffix-array substring search |
1241
+ | `go:io` | ✅ | [lib-go-compress-gzip.ts](conformance/lib-go-compress-gzip.ts) | Core I/O interfaces (Reader/Writer) |
1242
+ | `go:io/fs` | ✅ | [lib-go-path-fs.ts](conformance/lib-go-path-fs.ts) | Filesystem abstraction |
1243
+ | `go:io/ioutil` | ✅ | [lib-go-path-fs.ts](conformance/lib-go-path-fs.ts) | Deprecated I/O helpers (Go 1.16) |
1244
+ | `go:iter` | ✅ | [lib-go-collections.ts](conformance/lib-go-collections.ts) | Range-over-func iterators via `for…of`; `Pull` not bridged |
1245
+ | `go:log` | ✅ | [lib-go-log.ts](conformance/lib-go-log.ts) | Logging to stderr |
1246
+ | `go:log/slog` | ✅ | [lib-go-log.ts](conformance/lib-go-log.ts) | Structured logging |
1247
+ | `go:log/syslog` | ✅ | [lib-go-syslog.ts](conformance/lib-go-syslog.ts) | Network syslog; Unix only (no Windows build, the probe skips it) |
1248
+ | `go:maps` | ✅ | [lib-go-collections.ts](conformance/lib-go-collections.ts) | Generic map helpers |
1249
+ | `go:math` | ✅ | [lib-go-math.ts](conformance/lib-go-math.ts) | Math functions |
1250
+ | `go:math/big` | ✅ | [lib-go-big.ts](conformance/lib-go-big.ts) | Arbitrary-precision arithmetic |
1251
+ | `go:math/bits` | ✅ | [lib-go-math-extra.ts](conformance/lib-go-math-extra.ts) | Bit operations |
1252
+ | `go:math/cmplx` | ✅ | [lib-go-math-cmplx.ts](conformance/lib-go-math-cmplx.ts) | `complex128` values pass between calls opaquely |
1253
+ | `go:math/rand` | ✅ | [lib-go-math-extra.ts](conformance/lib-go-math-extra.ts) | Pseudo-random numbers |
1254
+ | `go:math/rand/v2` | ✅ | [lib-go-math-extra.ts](conformance/lib-go-math-extra.ts) | Pseudo-random numbers (v2 API) |
1255
+ | `go:mime` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | MIME media types |
1256
+ | `go:mime/multipart` | ✅ | [lib-go-misc.ts](conformance/lib-go-misc.ts) | Multipart forms |
1257
+ | `go:mime/quotedprintable` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | Quoted-printable encoding |
1258
+ | `go:net` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | Sockets (loopback TCP), addresses |
1259
+ | `go:net/http` | ✅ | [lib-go-http.ts](conformance/lib-go-http.ts) | HTTP client/server (loopback) |
1260
+ | `go:net/http/cgi` | ✅ | [lib-go-http-extra.ts](conformance/lib-go-http-extra.ts) | CGI request parsing |
1261
+ | `go:net/http/cookiejar` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | Cookie jars (loopback) |
1262
+ | `go:net/http/fcgi` | ✅ | [lib-go-fcgi.ts](conformance/lib-go-fcgi.ts) | FastCGI responder serving a TS `http.Handler` class |
1263
+ | `go:net/http/httptest` | ✅ | [lib-go-http.ts](conformance/lib-go-http.ts) | HTTP test servers (loopback) |
1264
+ | `go:net/http/httptrace` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | HTTP tracing hooks |
1265
+ | `go:net/http/httputil` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | HTTP utilities (loopback) |
1266
+ | `go:net/http/pprof` | ✅ | [lib-go-http-extra.ts](conformance/lib-go-http-extra.ts) | pprof HTTP handlers |
1267
+ | `go:net/mail` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | Mail address parsing |
1268
+ | `go:net/netip` | ✅ | [lib-go-encoding-extra.ts](conformance/lib-go-encoding-extra.ts) | IP address types |
1269
+ | `go:net/rpc` | ✅ | [lib-go-rpc.ts](conformance/lib-go-rpc.ts) | TS class services: methods compile to `M(*Args, *Reply) error` |
1270
+ | `go:net/rpc/jsonrpc` | ✅ | [lib-go-rpc.ts](conformance/lib-go-rpc.ts) | JSON-RPC codec (client, server and the wire format) |
1271
+ | `go:net/smtp` | ✅ | [lib-go-smtp.ts](conformance/lib-go-smtp.ts) | SMTP client, against a TS server over loopback |
1272
+ | `go:net/textproto` | ✅ | [lib-go-net.ts](conformance/lib-go-net.ts) | Text protocol I/O |
1273
+ | `go:net/url` | ✅ | [lib-go-url.ts](conformance/lib-go-url.ts) | URL parsing |
1274
+ | `go:os` | ✅ | [lib-go-os.ts](conformance/lib-go-os.ts) | OS files and processes |
1275
+ | `go:os/exec` | ✅ | [lib-go-exec.ts](conformance/lib-go-exec.ts) | External commands |
1276
+ | `go:os/signal` | ✅ | [lib-go-misc.ts](conformance/lib-go-misc.ts) | Signal notification (`Notify` + `Stop`) |
1277
+ | `go:os/user` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | User lookup |
1278
+ | `go:path` | ✅ | [lib-go-path-fs.ts](conformance/lib-go-path-fs.ts) | Slash-separated paths |
1279
+ | `go:path/filepath` | ✅ | [lib-go-os.ts](conformance/lib-go-os.ts) | File paths |
1280
+ | `go:reflect` | ✅ | [lib-go-text-extra.ts](conformance/lib-go-text-extra.ts) | Runtime reflection |
1281
+ | `go:regexp` | ✅ | [lib-go-regexp.ts](conformance/lib-go-regexp.ts) | Regular expressions |
1282
+ | `go:regexp/syntax` | ✅ | [lib-go-text-extra.ts](conformance/lib-go-text-extra.ts) | Regexp parse trees |
1283
+ | `go:runtime` | ✅ | [lib-go-runtime.ts](conformance/lib-go-runtime.ts) | Runtime introspection |
1284
+ | `go:runtime/coverage` | ✅ | [lib-go-coverage.ts](conformance/lib-go-coverage.ts) | Needs `--cover`; calls throw without it |
1285
+ | `go:runtime/debug` | ✅ | [lib-go-runtime.ts](conformance/lib-go-runtime.ts) | Stack traces and GC stats |
1286
+ | `go:runtime/metrics` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Runtime metrics sampling |
1287
+ | `go:runtime/pprof` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Profiling data |
1288
+ | `go:runtime/trace` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Execution tracing |
1289
+ | `go:slices` | ✅ | [lib-go-slices.ts](conformance/lib-go-slices.ts) | Generic slice helpers |
1290
+ | `go:sort` | ✅ | [lib-go-sort.ts](conformance/lib-go-sort.ts) | Sorting |
1291
+ | `go:strconv` | ✅ | [lib-go-strconv.ts](conformance/lib-go-strconv.ts) | String conversions |
1292
+ | `go:strings` | ✅ | [lib-go-strings.ts](conformance/lib-go-strings.ts) | String utilities |
1293
+ | `go:structs` | ✅ | [lib-go-lowlevel.ts](conformance/lib-go-lowlevel.ts) | `HostLayout` marker |
1294
+ | `go:sync` | ✅ | [lib-go-sync.ts](conformance/lib-go-sync.ts) | Mutexes and wait groups |
1295
+ | `go:sync/atomic` | ✅ | [lib-go-sync.ts](conformance/lib-go-sync.ts) | Atomic operations |
1296
+ | `go:syscall` | ✅ | [lib-go-lowlevel.ts](conformance/lib-go-lowlevel.ts) | Portable subset probed; per-arch constants dropped |
1297
+ | `go:testing` | ✅ | [lib-go-testing.ts](conformance/lib-go-testing.ts) | Helpers usable outside `go test` |
1298
+ | `go:testing/cryptotest` | ✅ | [lib-go-testing-t.ts](conformance/lib-go-testing-t.ts) | Real `*testing.T` via `testing.Main`; refuses outside `go test` |
1299
+ | `go:testing/fstest` | ✅ | [lib-go-testing.ts](conformance/lib-go-testing.ts) | `TestFS` over any `fs.FS` |
1300
+ | `go:testing/iotest` | ✅ | [lib-go-testing.ts](conformance/lib-go-testing.ts) | Reader/writer test wrappers |
1301
+ | `go:testing/quick` | ✅ | [lib-go-testing.ts](conformance/lib-go-testing.ts) | Property checks with TS callbacks |
1302
+ | `go:testing/slogtest` | ✅ | [lib-go-testing-t.ts](conformance/lib-go-testing-t.ts) | Handler suite: `TestHandler`, and `Run` under `testing.Main` |
1303
+ | `go:testing/synctest` | ✅ | [lib-go-testing-t.ts](conformance/lib-go-testing-t.ts) | Fake-time bubbles under `testing.Main` |
1304
+ | `go:text/scanner` | ✅ | [lib-go-text.ts](conformance/lib-go-text.ts) | Text scanner |
1305
+ | `go:text/tabwriter` | ✅ | [lib-go-text.ts](conformance/lib-go-text.ts) | Aligned text columns |
1306
+ | `go:text/template` | ✅ | [lib-go-template.ts](conformance/lib-go-template.ts) | Text templating |
1307
+ | `go:text/template/parse` | ✅ | [lib-go-text-extra.ts](conformance/lib-go-text-extra.ts) | Template parse trees |
1308
+ | `go:time` | ✅ | [lib-go-time.ts](conformance/lib-go-time.ts) | Time and durations |
1309
+ | `go:time/tzdata` | ✅ | [lib-go-runtime-extra.ts](conformance/lib-go-runtime-extra.ts) | Embedded timezone database (side-effect import) |
1310
+ | `go:unicode` | ✅ | [lib-go-unicode.ts](conformance/lib-go-unicode.ts) | Unicode tables |
1311
+ | `go:unicode/utf16` | ✅ | [lib-go-encoding-more.ts](conformance/lib-go-encoding-more.ts) | UTF-16 encoding |
1312
+ | `go:unicode/utf8` | ✅ | [lib-go-unicode.ts](conformance/lib-go-unicode.ts) | UTF-8 encoding |
1313
+ | `go:unique` | ✅ | [lib-go-collections.ts](conformance/lib-go-collections.ts) | Canonical values |
1314
+ | `go:weak` | ✅ | [lib-go-lowlevel.ts](conformance/lib-go-lowlevel.ts) | Weak pointers |
1315
+ | `go:plugin` | 🚫 | — | Loads plugins with `dlopen`: needs cgo and `-buildmode=plugin` (no Windows support) |
1316
+ | `go:unsafe` | 🚫 | — | Raw pointer arithmetic and memory reinterpretation; TS values have no addresses |
1317
+ | `go:runtime/race` | 🚫 | — | No public API: the race detector is a build mode (`-race`) that needs cgo |
1318
+ | `go:runtime/cgo` | 🚫 | — | Links only with cgo and a C toolchain; `Handle` exists to pass Go values to C |
1319
+
1113
1320
  <!-- go-bridges:end -->
1114
1321
 
1115
1322
  #### Go bridge semantics
1116
1323
 
1117
- | Rule | Meaning |
1118
- | ---- | ------- |
1119
- | Number conversion | All Go ints/floats map to TS `number`; args convert via `T(x)`, results read back via `float64(x)`. `int64`/`uint64` beyond 2^53 lose precision. |
1120
- | Throw on error | `(T, error)` results throw a `GoError` on failure; `error`-only calls throw as statements and yield the error value in value position. |
1121
- | Tuples | Multi-value results pack into a slice (TS tuple); `const [a, b] = f()` types each element (ints read as numbers). |
1122
- | Structs | `new pkg.T({...})` builds a composite literal (pointer when any method needs it); fields read/write directly, converting numbers both ways (`h.Size += 1`). Embedded structs promote their fields. |
1123
- | Named numerics | Typed constants (`time.Second`, `reflect.String`) stay typed in Go; arithmetic and `===` coerce the `number` side (`time.Second * 2`). Results read as numbers: `token.Token(n)` restores the methods. |
1124
- | Callbacks | Func-typed params and struct fields become Go closures with the exact Go signature (int params read as numbers, returns convert to the result type); sync callbacks (sort, slices, strings, ...) run inline. |
1125
- | Generics | Type args are inferred from the arguments, including through constraints (`maps.Keys(m)` with `Map ~map[K]V`); unresolved ones become `any`. |
1126
- | printf verbs | With a literal format, numbers passed to `%d %x %o %b %c %U` convert to `int64`; scan into number refs with `%v`. |
1127
- | nil | `null` passes as `nil`; `x === null` on nil-able Go values (slices, maps, interfaces, pointers) is a real nil check. |
1128
- | Channels | `chan<T>(size?)` / `GoChan<T>` with `send`, `recv`, `close`; `for…of` ranges channels, `iter.Seq` and `iter.Seq2` (`for (const [k, v] of seq2)`). |
1129
- | Out-params | `ref<T>(init?)` makes a pointer cell; `.value` dereferences it. |
1130
- | Byte slices | `[]byte` is `Uint8Array` (zero-copy); `number[]` converts per call (mutations of the copy are lost). |
1131
- | Side-effect imports | `import 'go:time/tzdata'` emits a blank `import _`. |
1132
- | Go interfaces | A TS class instance passed where Go expects an interface (`heap.Interface`, `sort.Interface`) is wrapped in a generated adapter with the exact Go method signatures (`Len() int` calls the class's `Len(): number`); the class needs every method, inherited ones count. Values typed as the interface itself are not adapted. |
1324
+ | Rule | Meaning |
1325
+ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1326
+ | Number conversion | All Go ints/floats map to TS `number`; args convert via `T(x)`, results read back via `float64(x)`. `int64`/`uint64` beyond 2^53 lose precision. |
1327
+ | Throw on error | `(T, error)` results throw a `GoError` on failure; `error`-only calls throw as statements and yield the error value in value position ([lib-go-bridge-smoke.ts](conformance/lib-go-bridge-smoke.ts)). |
1328
+ | Tuples | Multi-value results pack into a slice (TS tuple); `const [a, b] = f()` types each element (ints read as numbers). |
1329
+ | Structs | `new pkg.T({...})` builds a composite literal (pointer when any method needs it); fields read/write directly, converting numbers both ways (`h.Size += 1`). Embedded structs promote their fields. |
1330
+ | Type annotations | `pkg.T` in an annotation is the Go type (`let d: dwarf.Data \| null = null`, `(t: testing.T) => …`): a struct is a pointer when the package hands out `*T`, a value when it hands out `T` (`time.Time`) ([lib-go-debug.ts](conformance/lib-go-debug.ts)). |
1331
+ | Named numerics | Typed constants (`time.Second`, `reflect.String`) stay typed in Go; arithmetic and `===` coerce the `number` side (`time.Second * 2`). Results read as numbers: `token.Token(n)` restores the methods. |
1332
+ | Callbacks | Func-typed params and struct fields become Go closures with the exact Go signature (int params read as numbers, returns convert to the result type); a `(T, error)` callback returns `T` and a `nil` error; sync callbacks (sort, slices, strings, ...) run inline. |
1333
+ | Generics | Type args are inferred from the arguments, including through constraints (`maps.Keys(m)` with `Map ~map[K]V`); unresolved ones become `any`. |
1334
+ | printf verbs | With a literal format, numbers passed to `%d %x %o %b %c %U` convert to `int64`; scan into number refs with `%v`. |
1335
+ | nil | `null` passes as `nil`; `x === null` on nil-able Go values (slices, maps, interfaces, pointers) is a real nil check. |
1336
+ | Channels | `chan<T>(size?)` (a `chan T`) / `GoChan<T>` with `send`, `recv`, `close`; `for…of` ranges channels, `iter.Seq` and `iter.Seq2` (`for (const [k, v] of seq2)`) ([lib-go-builtin.ts](conformance/lib-go-builtin.ts)). |
1337
+ | Out-params | `ref<T>(init?)` makes a pointer cell; `.value` reads and writes through it, also on `GoRef<T>` params ([lib-go-builtin.ts](conformance/lib-go-builtin.ts), [lib-go-rpc.ts](conformance/lib-go-rpc.ts)). |
1338
+ | Byte slices | `[]byte` is `Uint8Array` (zero-copy); `number[]` converts per call (mutations of the copy are lost). |
1339
+ | Maps | A TS record (`Record<K, V>`) passes where Go takes a `map[K]V` of the same key and value types, as a copy ([lib-go-testing-t.ts](conformance/lib-go-testing-t.ts)). |
1340
+ | Side-effect imports | `import 'go:time/tzdata'` emits a blank `import _`. |
1341
+ | Embedding | `const page = embed.string('./page.html')` (also `embed.bytes`, and `embed.files(...patterns)` for an `embed.FS`) compiles to a package-level `//go:embed` var. Only as a top-level initializer with literal paths, relative to the file; they must stay inside the entry file's directory, and `embed.FS` names are relative to it. The CLI copies the files next to the Go sources ([lib-go-embed.ts](conformance/lib-go-embed.ts)). |
1342
+ | Coverage | `--cover` builds with `-cover -covermode=atomic`, so `go:runtime/coverage` has data to write; set `GOCOVERDIR` to also get a profile at exit ([lib-go-coverage.ts](conformance/lib-go-coverage.ts)). |
1343
+ | Go interfaces | A TS class instance passed where Go expects an interface (`heap.Interface`, `sort.Interface`) is wrapped in a generated adapter with the exact Go method signatures (`Len() int` calls the class's `Len(): number`); the class needs every method, inherited ones count. Values typed as the interface itself are not adapted. |
1133
1344
 
1134
1345
  ### npm packages
1135
1346
 
1136
- | Pattern | Status | Probe | Notes |
1137
- | ------------------------- | :----: | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
1138
- | `import { x } from 'pkg'` | ✅ | [syntax-import-npm.ts](conformance/syntax-import-npm.ts) | Mapped to Go module imports (fixture dep in [conformance/package.json](conformance/package.json)) |
1139
- | Packages published as plain JavaScript / CommonJS (tried: `ms`, `escape-html`, `tiny-invariant`) | ❌ | — | Without TypeScript sources there are no types to compile from: untyped packages stop at the type check (TS7016), and typed ones whose code is CommonJS (`module.exports`, union-typed callbacks) don't lower. Packages that ship `.ts` sources work |
1347
+ | Pattern | Status | Probe | Notes |
1348
+ | ------------------------------------------------- | :----: | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1349
+ | `import { x } from 'pkg'` | ✅ | [syntax-import-npm.ts](conformance/syntax-import-npm.ts) | Mapped to Go module imports (fixture dep in [conformance/package.json](conformance/package.json)) |
1350
+ | Packages published as plain JavaScript / CommonJS | 🚫 | — | Without TypeScript sources there are no types to compile from: untyped packages stop at the type check (TS7016), and typed ones whose code is CommonJS (`module.exports`, union-typed callbacks) don't lower. Packages that ship `.ts` sources work |
1351
+
1352
+ ### Native app windows (`@webviewjs/webview`)
1353
+
1354
+ Programs open windows through the [`@webviewjs/webview`](https://www.npmjs.com/package/@webviewjs/webview)
1355
+ API, so the same source runs under Node.js (the real package) and compiled (a built-in
1356
+ implementation, no npm package needed). Build a windowed app with `--gui`. Anything not listed
1357
+ here is a type error when compiled.
1358
+
1359
+ | API | Status | Probe | Notes |
1360
+ | ----------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
1361
+ | `new Application()`, `run`, `exit`, `isReady`, `whenReady` | ✅ | [lib-webview-api.ts](conformance/lib-webview-api.ts) | `ApplicationOptions` aren't accepted |
1362
+ | `app.createWebContext({ dataDirectory })` | ✅ | [lib-webview-api.ts](conformance/lib-webview-api.ts) | Without one, compiled apps use the per-user cache folder |
1363
+ | `app.createBrowserWindow({ title, width, height, logical, resizable })` | ✅ | [lib-webview-api.ts](conformance/lib-webview-api.ts) | Sizes are physical pixels unless `logical`, as in the package |
1364
+ | `win.createWebview({ url, html, enableDevtools, webContext })` | ✅ | [lib-webview-api.ts](conformance/lib-webview-api.ts) | One webview per window, which opens once it has one. `enableDevtools` also enables the right-click menu |
1365
+ | `win.setTitle`, `win.close` | ✅ | [lib-webview-api.ts](conformance/lib-webview-api.ts) | |
1366
+ | `view.loadUrl`, `loadHtml`, `evaluateScript`, `reload` | ✅ | [lib-webview-api.ts](conformance/lib-webview-api.ts) | Once a browser app window is open these throw `ERR_WEBVIEW_UNSUPPORTED` |
1367
+ | Events `ready`, `window-close-requested`, `application-close-requested`, window `close` | ✅ | [app-webview-window.ts](conformance/app-webview-window.ts) | A close from the program skips `close` and `window-close-requested`, as in the package |
1368
+ | `event.preventDefault()` on `close` | 🚫 | — | The window is already gone when `close` arrives: save before it, for example on the page's `beforeunload` |
1369
+ | Menus, tray icons, notifications, IPC (`expose`, `onIpcMessage`), custom protocols, window controls | ❌ | — | Not implemented |
1370
+
1371
+ How a window is hosted:
1372
+
1373
+ | Platform | Window | Closing it is detected by | Verified |
1374
+ | ---------------------------------------- | -------------------------------------- | ------------------------------------- | ---------------------------------------------------------- |
1375
+ | Windows | Embedded WebView2, pure Go, no cgo | The window's message loop ending | Run end to end |
1376
+ | Windows without the WebView2 runtime | Edge or Chrome in app mode | A job object emptying | Run end to end (`TYPENATIVE_WEBVIEW=browser` forces this) |
1377
+ | macOS, Linux | Chrome, Edge or Chromium in app mode | The DevTools pipe reporting the page closed | Builds in CI; **never run on these systems**, only the pipe's messages were checked on Windows |
1378
+
1379
+ With no browser to open, opening the window throws `ERR_WEBVIEW_NO_BROWSER`. Run
1380
+ [app-webview-window.ts](conformance/app-webview-window.ts) with `TN_WEBVIEW_SMOKE=1` to open a real
1381
+ window: the suite skips it otherwise, since CI has no display.
1382
+
1383
+ Under Node.js on Windows the package has a pitfall that compiled programs don't: while the window
1384
+ is idle, its event pump can hold the JS thread until a window message arrives (seen on 0.6.0 and
1385
+ 1.0.0-rc.4, and `controlFlow` doesn't change it), which starves timers and an HTTP server in the
1386
+ same process. [desktop-notes](examples/desktop-notes/) gives the window its own process there. Its
1387
+ default profile folder is beside `node.exe`, which is read-only under Program Files, so pass a
1388
+ `dataDirectory`.
1389
+
1390
+ ## Known limitations (🚫)
1391
+
1392
+ These follow from compiling to a native Go binary, and won't change:
1393
+
1394
+ - **No JavaScript engine at runtime**, so code can't be compiled while the program runs: `eval`,
1395
+ `new Function`, `node:vm`, `node:repl`, Worker `eval: true`. Nothing can inspect an engine
1396
+ either: `node:inspector`, `node:v8` heap snapshots and flags, `node:trace_events`, and
1397
+ `node:module` loader hooks.
1398
+ - **Classes are static Go structs** with fixed fields and method sets: no prototype mutation
1399
+ (`C.prototype.m = …`, `Object.setPrototypeOf`, `util.inherits`), no `Proxy` over typed values,
1400
+ no sparse-array holes.
1401
+ - **`undefined` and `null` are both Go `nil`**, so APIs that tell them apart can't (`node:sqlite`
1402
+ binding `undefined`).
1403
+ - **One process per isolate**: workers, `fork` and cluster workers are separate processes, so
1404
+ `SharedArrayBuffer` / `Atomics` can't share memory.
1405
+ - **No cgo**: `go:plugin`, `go:runtime/cgo`, `go:runtime/race` (the race detector), and SQLite
1406
+ native extensions (SQLite runs as Wasm translated to Go).
1407
+ - **No raw memory**: `go:unsafe` reinterprets memory through pointers; TS values have no addresses.
1408
+ - **Deprecated upstream**: `node:domain`, HTTP/2 server push, `util.inherits`.