Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/src/app/limitations/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const results = await Promise.all(jobs); // number[] — compiles
- CommonJS module metadata (`module.id`, `filename`, `path`, `paths`, `loaded`, `isPreloading`, `parent`, `children`, `require.main`, and read-only `require.cache` lookup/enumeration) compiles natively. A compiled binary has a fixed module graph, so cache deletion/reloading, metadata writes, `module.paths` mutation, and `require.extensions` remain explicit refusals.
- The type checker sees the full standard library; only the supported surface compiles. Reaching declared-but-unlowered surface is SC2020 with the supported alternatives in the hint — e.g. parts of the regex API (`re.exec`), `Symbol`, `globalThis`, array/Map/Set methods beyond the lowered sets.
- `Date` values support zero-argument construction, one number/string argument, storage and passing, `getTime`/`valueOf`, `toISOString`, the local and UTC calendar getters, and `getTimezoneOffset`. `Date.parse(dateString)` accepts one string using the same bounded parser as `new Date(dateString).getTime()`. Date-armed unions, the year/month field constructor, setters, identity comparisons, throwing `Date` values, and locale/string formatters remain fenced; the supported string grammar is described below.
- `URL` supports construction from one absolute string and read-only `protocol`, `origin`, `username`, `pathname`, `href`, `host`, `hostname`, `port`, `search`, and `hash` getters. `searchParams` remains a live view. Relative inputs with a base argument and setters remain fenced.
- `URL` supports construction from one absolute string and read-only `protocol`, `origin`, `username`, `password`, `pathname`, `href`, `host`, `hostname`, `port`, `search`, and `hash` getters. `searchParams` remains a live view. Relative inputs with a base argument and setters remain fenced.
- `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.
- Map keys and Set elements are strings and numbers; other key types are fenced.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/generated/node-v24-compatibility-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"schemaVersion": 3,
"nodeVersion": "24.15.0",
"nodeCommit": "848430679556aed0bd073f2bc263331ad84fa119",
"artifactVersion": "bbbe77bce52b68292e6d",
"artifactVersion": "adbd8f7460bcf5854031",
"rowCount": 3662
}
28 changes: 14 additions & 14 deletions docs/src/generated/node-v24-compatibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,9 @@
"apiEntries": 276,
"static": {
"supported": 0,
"partial": 44,
"partial": 48,
"refused": 0,
"not-implemented": 232,
"not-implemented": 228,
"by-design": 0,
"unreviewed": 0,
"not-applicable": 0
Expand Down Expand Up @@ -38513,9 +38513,9 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"detail": "No static compiler lowering is registered for this API yet.",
"verification": "registry-gap"
"status": "partial",
"detail": "Implemented for the call shapes accepted by the compiler lowering.",
"verification": "test-backed"
},
"dynamic": {
"status": "not-implemented",
Expand Down Expand Up @@ -38597,9 +38597,9 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"detail": "No static compiler lowering is registered for this API yet.",
"verification": "registry-gap"
"status": "partial",
"detail": "Implemented for the call shapes accepted by the compiler lowering.",
"verification": "test-backed"
},
"dynamic": {
"status": "not-implemented",
Expand All @@ -38625,9 +38625,9 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"detail": "No static compiler lowering is registered for this API yet.",
"verification": "registry-gap"
"status": "partial",
"detail": "Implemented for the call shapes accepted by the compiler lowering.",
"verification": "test-backed"
},
"dynamic": {
"status": "not-implemented",
Expand Down Expand Up @@ -38821,9 +38821,9 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"detail": "No static compiler lowering is registered for this API yet.",
"verification": "registry-gap"
"status": "partial",
"detail": "Implemented for the call shapes accepted by the compiler lowering.",
"verification": "test-backed"
},
"dynamic": {
"status": "not-implemented",
Expand Down
60 changes: 34 additions & 26 deletions internal/compatibility/generated/node-v24-backlog.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"tiers": {
"static": {
"replace-refusal": 46,
"verify-gap": 2703,
"audit-partial": 463,
"verify-gap": 2699,
"audit-partial": 467,
"classify": 2,
"implement": 81
},
Expand Down Expand Up @@ -38114,12 +38114,14 @@
"priority": "high",
"tiers": {
"static": {
"status": "not-implemented",
"action": "verify-gap",
"verification": "registry-gap",
"confidence": "low",
"source": "compiler-unmatched:fs",
"tests": []
"status": "partial",
"action": "audit-partial",
"verification": "test-backed",
"confidence": "high",
"source": "surface-manifest:node-builtin.fs.fchmodSync",
"tests": [
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
"status": "not-implemented",
Expand Down Expand Up @@ -38213,12 +38215,14 @@
"priority": "high",
"tiers": {
"static": {
"status": "not-implemented",
"action": "verify-gap",
"verification": "registry-gap",
"confidence": "low",
"source": "compiler-unmatched:fs",
"tests": []
"status": "partial",
"action": "audit-partial",
"verification": "test-backed",
"confidence": "high",
"source": "surface-manifest:node-builtin.fs.fstatSync",
"tests": [
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
"status": "not-implemented",
Expand Down Expand Up @@ -38246,12 +38250,14 @@
"priority": "high",
"tiers": {
"static": {
"status": "not-implemented",
"action": "verify-gap",
"verification": "registry-gap",
"confidence": "low",
"source": "compiler-unmatched:fs",
"tests": []
"status": "partial",
"action": "audit-partial",
"verification": "test-backed",
"confidence": "high",
"source": "surface-manifest:node-builtin.fs.fsyncSync",
"tests": [
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
"status": "not-implemented",
Expand Down Expand Up @@ -38477,12 +38483,14 @@
"priority": "high",
"tiers": {
"static": {
"status": "not-implemented",
"action": "verify-gap",
"verification": "registry-gap",
"confidence": "low",
"source": "compiler-unmatched:fs",
"tests": []
"status": "partial",
"action": "audit-partial",
"verification": "test-backed",
"confidence": "high",
"source": "surface-manifest:node-builtin.fs.linkSync",
"tests": [
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
"status": "not-implemented",
Expand Down
35 changes: 24 additions & 11 deletions internal/compatibility/generated/node-v24-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@
"apiEntries": 276,
"static": {
"supported": 0,
"partial": 44,
"partial": 48,
"refused": 0,
"not-implemented": 232,
"not-implemented": 228,
"by-design": 0,
"unreviewed": 0,
"not-applicable": 0
Expand Down Expand Up @@ -50575,7 +50575,8 @@
"tests/corpus/2920-fs-promises-function-values.ts",
"tests/corpus/2940-fsp-realpath.ts",
"tests/corpus/2941-fsp-lstat-identity.ts",
"tests/corpus/2942-fsp-readdir-dirent.ts"
"tests/corpus/2942-fsp-readdir-dirent.ts",
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
Expand Down Expand Up @@ -54535,8 +54536,11 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"evidence": "compiler-unmatched:fs"
"status": "partial",
"evidence": "surface-manifest:node-builtin.fs.fchmodSync",
"tests": [
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
"status": "not-implemented",
Expand Down Expand Up @@ -54616,8 +54620,11 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"evidence": "compiler-unmatched:fs"
"status": "partial",
"evidence": "surface-manifest:node-builtin.fs.fstatSync",
"tests": [
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
"status": "not-implemented",
Expand All @@ -54643,8 +54650,11 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"evidence": "compiler-unmatched:fs"
"status": "partial",
"evidence": "surface-manifest:node-builtin.fs.fsyncSync",
"tests": [
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
"status": "not-implemented",
Expand Down Expand Up @@ -54832,8 +54842,11 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"evidence": "compiler-unmatched:fs"
"status": "partial",
"evidence": "surface-manifest:node-builtin.fs.linkSync",
"tests": [
"tests/corpus/2950-fs-descriptor-publication.ts"
]
},
"dynamic": {
"status": "not-implemented",
Expand Down
4 changes: 4 additions & 0 deletions internal/compatibility/static-support.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
"node-builtin.dns": ["tests/corpus/2597-dgram-send-ladders.cjs"],
"node-builtin.events": ["tests/corpus/1677-emitter-listeners.ts", "tests/corpus/2620-ee-override-once-order.ts"],
"node-builtin.fs": ["tests/corpus/1403-buffer-fs.ts", "tests/corpus/2595-fs-arg-ladders.cjs", "tests/corpus/2919-fs-function-values.ts", "tests/corpus/2920-fs-promises-function-values.ts"],
"node-builtin.fs.fchmodSync": ["tests/corpus/2950-fs-descriptor-publication.ts"],
"node-builtin.fs.fstatSync": ["tests/corpus/2950-fs-descriptor-publication.ts"],
"node-builtin.fs.fsyncSync": ["tests/corpus/2950-fs-descriptor-publication.ts"],
"node-builtin.fs.linkSync": ["tests/corpus/2950-fs-descriptor-publication.ts"],
"node-builtin.http": ["tests/corpus/1780-http-res-surface.ts", "tests/corpus/2672-http-request-response-callback.ts"],
"node-builtin.http2": ["tests/corpus/2260-http2-constants.cjs"],
"node-builtin.https": ["tests/corpus/2645-https-client-url-argument.ts", "tests/corpus/2690-https-server-timeout-option.ts"],
Expand Down
17 changes: 15 additions & 2 deletions packages/compiler/ambient/scriptc-node-fallback.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,9 @@ declare module "node:fs" {
export function mkdirSync(path: string, options: { recursive?: boolean; mode?: number }): void;
export function unlinkSync(path: string): void;
export function chmodSync(path: string, mode: number): void;
export function fchmodSync(fd: number, mode: number): void;
export function fsyncSync(fd: number): void;
export function linkSync(existingPath: string, newPath: string): void;
export function chownSync(path: string, uid: number, gid: number): void;
/* The 2-argument form only (Node's mode flags have no lowering). The
* destination is created or truncated carrying the SOURCE's mode. */
Expand Down Expand Up @@ -1079,6 +1082,15 @@ declare module "node:fs" {
readonly R_OK: number;
readonly W_OK: number;
readonly X_OK: number;
readonly O_RDONLY: number;
readonly O_WRONLY: number;
readonly O_RDWR: number;
readonly O_CREAT: number;
readonly O_EXCL: number;
readonly O_NOFOLLOW: number;
readonly O_NONBLOCK: number;
readonly O_TRUNC: number;
readonly O_APPEND: number;
};
/* A stat(2) snapshot (statSync follows symlinks, lstatSync does not —
* Node's split) — immutable; the supported surface is exactly these
Expand All @@ -1101,9 +1113,9 @@ declare module "node:fs" {
export function statSync(path: string): Stats;
export function lstatSync(path: string): Stats;
/* The fd pair behind spawn's fd-stdio form: openSync(path, flags) →
* the raw fd (string flags only — "r", "w", "a" and the +/x/s
* variants), closeSync(fd). */
* the raw fd. Numeric flags use an inline OR of the O_* constants. */
export function openSync(path: string, flags: string): number;
export function openSync(path: string, flags: number, mode?: number): number;
export function closeSync(fd: number): void;
/* Read into a caller buffer from the fd's current position when position
* is omitted/null, or from a numeric byte position without advancing the
Expand Down Expand Up @@ -1384,6 +1396,7 @@ interface URL {
readonly protocol: string;
readonly origin: string;
readonly username: string;
readonly password: string;
readonly pathname: string;
readonly href: string;
readonly host: string;
Expand Down
12 changes: 12 additions & 0 deletions packages/compiler/src/backend/c/exprs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4499,6 +4499,16 @@ function emitFilesystemLibCall(state: LibCallState): Temp {
// Throws Node-shaped fs errors (may-throw seed set); the fd
// comes back as f64.
return finish(`scr_fs_open(${arg(0)}, ${arg(1)})`);
case "fs.openNumericSync":
return finish(`scr_fs_open_numeric(${arg(0)}, ${arg(1)}, ${arg(2)})`);
case "fs.fstatSync":
return finish(`scr_fs_fstat(${arg(0)})`);
case "fs.fchmodSync":
return finish(`scr_fs_fchmod(${arg(0)}, ${arg(1)})`);
case "fs.fsyncSync":
return finish(`scr_fs_fsync(${arg(0)})`);
case "fs.linkSync":
return finish(`scr_fs_link(${arg(0)}, ${arg(1)})`);
case "fs.readSync":
return finish(`scr_fs_read_sync(${arg(0)}, ${arg(1)}, ${arg(2)}, ${arg(3)}, ${arg(4)})`);
case "fs.writeSync":
Expand Down Expand Up @@ -4954,6 +4964,8 @@ function emitPathUrlLibCall(state: LibCallState): Temp {
return finish(`scr_url_origin(${arg(0)})`);
case "url.username":
return finish(`scr_url_username(${arg(0)})`);
case "url.password":
return finish(`scr_url_password(${arg(0)})`);
case "url.host":
return finish(`scr_url_host(${arg(0)})`);
case "url.hostname":
Expand Down
6 changes: 6 additions & 0 deletions packages/compiler/src/backend/llvm/lib-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,12 @@ export const LIB_FN_SYMS: Record<string, string> = {
// sync fs calls; the getters are pure reads.
"fs.statSync": "scr_fs_stat",
"fs.lstatSync": "scr_fs_lstat",
"fs.fstatSync": "scr_fs_fstat",
"fs.fchmodSync": "scr_fs_fchmod",
"fs.fsyncSync": "scr_fs_fsync",
"fs.linkSync": "scr_fs_link",
"fs.openSync": "scr_fs_open",
"fs.openNumericSync": "scr_fs_open_numeric",
"fs.readSync": "scr_fs_read_sync",
"fs.writeSync": "scr_fs_write_sync",
"fs.writeStrSync": "scr_fs_write_str_sync",
Expand Down Expand Up @@ -326,6 +331,7 @@ export const LIB_FN_SYMS: Record<string, string> = {
"url.protocol": "scr_url_protocol",
"url.origin": "scr_url_origin",
"url.username": "scr_url_username",
"url.password": "scr_url_password",
"url.host": "scr_url_host",
"url.hostname": "scr_url_hostname",
"url.port": "scr_url_port",
Expand Down
Loading
Loading