Initial ES modules support

This commit is contained in:
2026-10-26 12:39:58 +00:00
parent f7c5b2c80f
commit 1e12e7be2e
35 changed files with 1266 additions and 505 deletions
+13 -1
View File
@@ -5,6 +5,18 @@
// A failure rejects with the negative errno, not an `Error`. A read or a write
// that the kernel does not finish in one op is not continued
import {
__native_io_queue_close,
__native_io_queue_open,
__native_io_queue_read,
__native_io_queue_stat,
__native_io_queue_write,
__native_io_result_number,
__native_io_result_string,
__native_io_status,
} from "jsrt:native";
import { __pending } from "jsrt:loop";
// A promise of what op `h` gives when it completes: its status, its data, or
// a number. A result can only be read before the next wait, so these read it
// when the op completes
@@ -39,7 +51,7 @@ function __io_ok(h) {
return __io_status(h).then((status) => (status < 0 ? Promise.reject(status) : status));
}
const fs = {
export const fs = {
readFile(path) {
let fd = -1;
let text = "";