Initial ES modules support
This commit is contained in:
+13
-1
@@ -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 = "";
|
||||
|
||||
Reference in New Issue
Block a user