Support native runtime values used by OpenTUI

- Add shared ArrayBuffer storage and native Unicode grapheme segmentation.
- Preserve builtin modules, globals, and byte views across JavaScript bindings.
- Compile package initialization expressions and optional native callables.
This commit is contained in:
Chris Tate
2026-09-28 19:01:50 -05:00
committed by GitHub
parent 2a23ddc37d
commit f668fc4bfd
79 changed files with 3726 additions and 512 deletions
+4
View File
@@ -50,6 +50,10 @@ const results = await Promise.all(jobs); // number[] — compiles
- `URL` supports absolute inputs and relative inputs with runtime string or `URL` bases, including optional bases, and read-only `protocol`, `origin`, `username`, `password`, `pathname`, `href`, `host`, `hostname`, `port`, `search`, and `hash` getters. `searchParams` remains a live view. Setters remain fenced. Non-ASCII and percent-escaped hosts are rejected; opaque paths retain their input bytes without the WHATWG C0 encoding pass.
- `fs.openSync` accepts inline bitwise OR expressions of `fs.constants.O_RDONLY`, `O_WRONLY`, `O_RDWR`, `O_CREAT`, `O_EXCL`, `O_NOFOLLOW`, `O_NONBLOCK`, `O_TRUNC`, and `O_APPEND`, with an optional creation mode. Computed numeric flags remain fenced because their bit values differ by target. `fstatSync`, `fchmodSync`, `fsyncSync`, and `linkSync` compile at direct call sites. On Windows, a numeric open with `O_NOFOLLOW` and `fchmodSync` throw `ENOSYS` because the CRT cannot enforce those contracts; programs requiring them should use a POSIX target.
- Numeric `process.exitCode = value` writes in statement position set the implicit exit status; `process.exit()` with no argument uses that status. Reading or resetting `process.exitCode`, and assignments used as values, remain fenced.
- `process.getBuiltinModule()` exposes native subsets of `path`, `path/posix`, and `path/win32`, native `os` functions, and main-thread `worker_threads` metadata. Module references and stored functions retain identity. Other modules and exports, including `Worker`, throw `SC2020`. `process.versions` is a shared dictionary containing `node` and `openssl`; other component versions are absent unless defined by the program.
- Fixed-length `ArrayBuffer` values support shared typed-array and DataView storage. Resizing and transferring buffers remain unsupported. `Uint8Array` and Buffer values preserve shared storage when passed through `unknown`.
- `Intl.Segmenter` supports default Unicode grapheme segmentation, segment iteration, and `containing()`. Locale negotiation, word and sentence segmentation, `resolvedOptions()`, and detached method values remain unsupported.
- Stored `globalThis` references support identity and probes for absent host capabilities. Most builtin members still require direct global access; reading them through a stored global object can raise `SC2020`.
- Map keys and Set elements support numbers and strings by value, and records, class instances, arrays, symbols, and server handles by identity. Unions consisting only of these identity types also compile. Collections with `unknown` slots, including JavaScript's unannotated `new Map()` and `new Set()`, use native checked values: supported primitives compare by value and supported object references retain their identity. BigInts, symbols, nested collections, Error objects, and promises whose payload requires an adapter cannot cross into those checked slots; `Promise<unknown>` retains its original identity. Other statically typed key forms, mixed scalar/reference unions, nullable key unions, and key conversions that copy an existing reference remain fenced.
- Static `zlib.deflateSync`, `deflateRawSync`, and `gzipSync` accept default options or an inline `{ level: n }` with an integer literal from `-1` through `9`. Other compression options and runtime-valued levels remain fenced.
@@ -2,6 +2,6 @@
"schemaVersion": 3,
"nodeVersion": "24.15.0",
"nodeCommit": "848430679556aed0bd073f2bc263331ad84fa119",
"artifactVersion": "413a7021676b19ceaf47",
"artifactVersion": "13f2c3f789ea7a8500d1",
"rowCount": 3662
}
@@ -842,9 +842,9 @@
"apiEntries": 119,
"static": {
"supported": 0,
"partial": 25,
"partial": 27,
"refused": 0,
"not-implemented": 94,
"not-implemented": 92,
"by-design": 0,
"unreviewed": 0,
"not-applicable": 0
@@ -65658,9 +65658,9 @@
"anchor": "processgetbuiltinmoduleid",
"nodeStability": null,
"static": {
"status": "not-implemented",
"detail": "No static compiler lowering is registered for this API yet.",
"verification": "registry-gap"
"status": "partial",
"detail": "Implemented for the documented scriptc module-loader subset.",
"verification": "test-backed"
},
"dynamic": {
"status": "not-implemented",
@@ -67734,9 +67734,9 @@
"anchor": "",
"nodeStability": null,
"static": {
"status": "not-implemented",
"detail": "No static compiler lowering is registered for this API yet.",
"verification": "registry-gap"
"status": "partial",
"detail": "Implemented for the documented scriptc module-loader subset.",
"verification": "test-backed"
},
"dynamic": {
"status": "partial",