@tybys/wasm-util 0.5.0 → 0.5.1
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.
- package/dist/wasm-util.esm-bundler.js +66 -48
- package/dist/wasm-util.esm.js +66 -48
- package/dist/wasm-util.js +66 -48
- package/lib/cjs/asyncify.js +0 -13
- package/lib/cjs/memory.js +1 -0
- package/lib/cjs/wasi/index.js +2 -1
- package/lib/cjs/wasi/rights.js +1 -0
- package/lib/cjs/wasi/types.js +61 -30
- package/lib/mjs/asyncify.mjs +0 -13
- package/lib/mjs/memory.mjs +1 -1
- package/lib/mjs/wasi/index.mjs +2 -1
- package/lib/mjs/wasi/rights.mjs +2 -2
- package/lib/mjs/wasi/types.mjs +61 -30
- package/package.json +1 -1
|
@@ -195,20 +195,7 @@ class Asyncify {
|
|
|
195
195
|
return ignore ? exportValue : this.wrapExportFunction(exportValue);
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
}
|
|
199
|
-
// /** @public */
|
|
200
|
-
// export class Instance extends WebAssembly.Instance {
|
|
201
|
-
// constructor (options: AsyncifyOptions, module: WebAssembly.Module, importObject?: WebAssembly.Imports) {
|
|
202
|
-
// importObject = importObject ?? {}
|
|
203
|
-
// const asyncify = new Asyncify()
|
|
204
|
-
// super(module, asyncify.wrapImports(importObject))
|
|
205
|
-
// asyncify.init(importObject, this, options)
|
|
206
|
-
// }
|
|
207
|
-
// get exports (): WebAssembly.Exports {
|
|
208
|
-
// return wrappedExports.get(super.exports)!
|
|
209
|
-
// }
|
|
210
|
-
// }
|
|
211
|
-
// Object.defineProperty(Instance.prototype, 'exports', { enumerable: true })
|
|
198
|
+
}
|
|
212
199
|
|
|
213
200
|
function validateImports(imports) {
|
|
214
201
|
if (imports && typeof imports !== 'object') {
|
|
@@ -383,37 +370,67 @@ function resolve(...args) {
|
|
|
383
370
|
return resolvedPath.length > 0 ? resolvedPath : '.';
|
|
384
371
|
}
|
|
385
372
|
|
|
373
|
+
const FD_DATASYNC = /*#__PURE__*/ (BigInt(1) << BigInt(0));
|
|
374
|
+
const FD_READ = /*#__PURE__*/ (BigInt(1) << BigInt(1));
|
|
375
|
+
const FD_SEEK = /*#__PURE__*/ (BigInt(1) << BigInt(2));
|
|
376
|
+
const FD_FDSTAT_SET_FLAGS = /*#__PURE__*/ (BigInt(1) << BigInt(3));
|
|
377
|
+
const FD_SYNC = /*#__PURE__*/ (BigInt(1) << BigInt(4));
|
|
378
|
+
const FD_TELL = /*#__PURE__*/ (BigInt(1) << BigInt(5));
|
|
379
|
+
const FD_WRITE = /*#__PURE__*/ (BigInt(1) << BigInt(6));
|
|
380
|
+
const FD_ADVISE = /*#__PURE__*/ (BigInt(1) << BigInt(7));
|
|
381
|
+
const FD_ALLOCATE = /*#__PURE__*/ (BigInt(1) << BigInt(8));
|
|
382
|
+
const PATH_CREATE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(9));
|
|
383
|
+
const PATH_CREATE_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(10));
|
|
384
|
+
const PATH_LINK_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(11));
|
|
385
|
+
const PATH_LINK_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(12));
|
|
386
|
+
const PATH_OPEN = /*#__PURE__*/ (BigInt(1) << BigInt(13));
|
|
387
|
+
const FD_READDIR = /*#__PURE__*/ (BigInt(1) << BigInt(14));
|
|
388
|
+
const PATH_READLINK = /*#__PURE__*/ (BigInt(1) << BigInt(15));
|
|
389
|
+
const PATH_RENAME_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(16));
|
|
390
|
+
const PATH_RENAME_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(17));
|
|
391
|
+
const PATH_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(18));
|
|
392
|
+
const PATH_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(19));
|
|
393
|
+
const PATH_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(20));
|
|
394
|
+
const FD_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(21));
|
|
395
|
+
const FD_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(22));
|
|
396
|
+
const FD_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(23));
|
|
397
|
+
const PATH_SYMLINK = /*#__PURE__*/ (BigInt(1) << BigInt(24));
|
|
398
|
+
const PATH_REMOVE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(25));
|
|
399
|
+
const PATH_UNLINK_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(26));
|
|
400
|
+
const POLL_FD_READWRITE = /*#__PURE__*/ (BigInt(1) << BigInt(27));
|
|
401
|
+
const SOCK_SHUTDOWN = /*#__PURE__*/ (BigInt(1) << BigInt(28));
|
|
402
|
+
const SOCK_ACCEPT = /*#__PURE__*/ (BigInt(1) << BigInt(29));
|
|
386
403
|
const WasiRights = {
|
|
387
|
-
FD_DATASYNC
|
|
388
|
-
FD_READ
|
|
389
|
-
FD_SEEK
|
|
390
|
-
FD_FDSTAT_SET_FLAGS
|
|
391
|
-
FD_SYNC
|
|
392
|
-
FD_TELL
|
|
393
|
-
FD_WRITE
|
|
394
|
-
FD_ADVISE
|
|
395
|
-
FD_ALLOCATE
|
|
396
|
-
PATH_CREATE_DIRECTORY
|
|
397
|
-
PATH_CREATE_FILE
|
|
398
|
-
PATH_LINK_SOURCE
|
|
399
|
-
PATH_LINK_TARGET
|
|
400
|
-
PATH_OPEN
|
|
401
|
-
FD_READDIR
|
|
402
|
-
PATH_READLINK
|
|
403
|
-
PATH_RENAME_SOURCE
|
|
404
|
-
PATH_RENAME_TARGET
|
|
405
|
-
PATH_FILESTAT_GET
|
|
406
|
-
PATH_FILESTAT_SET_SIZE
|
|
407
|
-
PATH_FILESTAT_SET_TIMES
|
|
408
|
-
FD_FILESTAT_GET
|
|
409
|
-
FD_FILESTAT_SET_SIZE
|
|
410
|
-
FD_FILESTAT_SET_TIMES
|
|
411
|
-
PATH_SYMLINK
|
|
412
|
-
PATH_REMOVE_DIRECTORY
|
|
413
|
-
PATH_UNLINK_FILE
|
|
414
|
-
POLL_FD_READWRITE
|
|
415
|
-
SOCK_SHUTDOWN
|
|
416
|
-
SOCK_ACCEPT
|
|
404
|
+
FD_DATASYNC,
|
|
405
|
+
FD_READ,
|
|
406
|
+
FD_SEEK,
|
|
407
|
+
FD_FDSTAT_SET_FLAGS,
|
|
408
|
+
FD_SYNC,
|
|
409
|
+
FD_TELL,
|
|
410
|
+
FD_WRITE,
|
|
411
|
+
FD_ADVISE,
|
|
412
|
+
FD_ALLOCATE,
|
|
413
|
+
PATH_CREATE_DIRECTORY,
|
|
414
|
+
PATH_CREATE_FILE,
|
|
415
|
+
PATH_LINK_SOURCE,
|
|
416
|
+
PATH_LINK_TARGET,
|
|
417
|
+
PATH_OPEN,
|
|
418
|
+
FD_READDIR,
|
|
419
|
+
PATH_READLINK,
|
|
420
|
+
PATH_RENAME_SOURCE,
|
|
421
|
+
PATH_RENAME_TARGET,
|
|
422
|
+
PATH_FILESTAT_GET,
|
|
423
|
+
PATH_FILESTAT_SET_SIZE,
|
|
424
|
+
PATH_FILESTAT_SET_TIMES,
|
|
425
|
+
FD_FILESTAT_GET,
|
|
426
|
+
FD_FILESTAT_SET_SIZE,
|
|
427
|
+
FD_FILESTAT_SET_TIMES,
|
|
428
|
+
PATH_SYMLINK,
|
|
429
|
+
PATH_REMOVE_DIRECTORY,
|
|
430
|
+
PATH_UNLINK_FILE,
|
|
431
|
+
POLL_FD_READWRITE,
|
|
432
|
+
SOCK_SHUTDOWN,
|
|
433
|
+
SOCK_ACCEPT
|
|
417
434
|
};
|
|
418
435
|
|
|
419
436
|
function strerror(errno) {
|
|
@@ -559,7 +576,7 @@ const REGULAR_FILE_BASE = WasiRights.FD_DATASYNC |
|
|
|
559
576
|
WasiRights.FD_FILESTAT_SET_SIZE |
|
|
560
577
|
WasiRights.FD_FILESTAT_SET_TIMES |
|
|
561
578
|
WasiRights.POLL_FD_READWRITE;
|
|
562
|
-
const REGULAR_FILE_INHERITING = BigInt(0);
|
|
579
|
+
const REGULAR_FILE_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
563
580
|
const DIRECTORY_BASE = WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
564
581
|
WasiRights.FD_SYNC |
|
|
565
582
|
WasiRights.FD_ADVISE |
|
|
@@ -594,7 +611,7 @@ const TTY_BASE = WasiRights.FD_READ |
|
|
|
594
611
|
WasiRights.FD_WRITE |
|
|
595
612
|
WasiRights.FD_FILESTAT_GET |
|
|
596
613
|
WasiRights.POLL_FD_READWRITE;
|
|
597
|
-
const TTY_INHERITING = BigInt(0);
|
|
614
|
+
const TTY_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
598
615
|
function getRights(stdio, fd, flags, type) {
|
|
599
616
|
const ret = {
|
|
600
617
|
base: BigInt(0),
|
|
@@ -901,7 +918,7 @@ class AsyncTable extends FileDescriptorTable {
|
|
|
901
918
|
}
|
|
902
919
|
|
|
903
920
|
/** @public */
|
|
904
|
-
const WebAssemblyMemory =
|
|
921
|
+
const WebAssemblyMemory = _WebAssembly.Memory;
|
|
905
922
|
/** @public */
|
|
906
923
|
class Memory extends WebAssemblyMemory {
|
|
907
924
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
@@ -2321,7 +2338,8 @@ class WASI$1 {
|
|
|
2321
2338
|
}
|
|
2322
2339
|
}
|
|
2323
2340
|
|
|
2324
|
-
|
|
2341
|
+
// eslint-disable-next-line spaced-comment
|
|
2342
|
+
const kEmptyObject = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.create(null));
|
|
2325
2343
|
const kExitCode = Symbol('kExitCode');
|
|
2326
2344
|
const kSetMemory = Symbol('kSetMemory');
|
|
2327
2345
|
const kStarted = Symbol('kStarted');
|
package/dist/wasm-util.esm.js
CHANGED
|
@@ -195,20 +195,7 @@ class Asyncify {
|
|
|
195
195
|
return ignore ? exportValue : this.wrapExportFunction(exportValue);
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
}
|
|
199
|
-
// /** @public */
|
|
200
|
-
// export class Instance extends WebAssembly.Instance {
|
|
201
|
-
// constructor (options: AsyncifyOptions, module: WebAssembly.Module, importObject?: WebAssembly.Imports) {
|
|
202
|
-
// importObject = importObject ?? {}
|
|
203
|
-
// const asyncify = new Asyncify()
|
|
204
|
-
// super(module, asyncify.wrapImports(importObject))
|
|
205
|
-
// asyncify.init(importObject, this, options)
|
|
206
|
-
// }
|
|
207
|
-
// get exports (): WebAssembly.Exports {
|
|
208
|
-
// return wrappedExports.get(super.exports)!
|
|
209
|
-
// }
|
|
210
|
-
// }
|
|
211
|
-
// Object.defineProperty(Instance.prototype, 'exports', { enumerable: true })
|
|
198
|
+
}
|
|
212
199
|
|
|
213
200
|
function validateImports(imports) {
|
|
214
201
|
if (imports && typeof imports !== 'object') {
|
|
@@ -383,37 +370,67 @@ function resolve(...args) {
|
|
|
383
370
|
return resolvedPath.length > 0 ? resolvedPath : '.';
|
|
384
371
|
}
|
|
385
372
|
|
|
373
|
+
const FD_DATASYNC = /*#__PURE__*/ (BigInt(1) << BigInt(0));
|
|
374
|
+
const FD_READ = /*#__PURE__*/ (BigInt(1) << BigInt(1));
|
|
375
|
+
const FD_SEEK = /*#__PURE__*/ (BigInt(1) << BigInt(2));
|
|
376
|
+
const FD_FDSTAT_SET_FLAGS = /*#__PURE__*/ (BigInt(1) << BigInt(3));
|
|
377
|
+
const FD_SYNC = /*#__PURE__*/ (BigInt(1) << BigInt(4));
|
|
378
|
+
const FD_TELL = /*#__PURE__*/ (BigInt(1) << BigInt(5));
|
|
379
|
+
const FD_WRITE = /*#__PURE__*/ (BigInt(1) << BigInt(6));
|
|
380
|
+
const FD_ADVISE = /*#__PURE__*/ (BigInt(1) << BigInt(7));
|
|
381
|
+
const FD_ALLOCATE = /*#__PURE__*/ (BigInt(1) << BigInt(8));
|
|
382
|
+
const PATH_CREATE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(9));
|
|
383
|
+
const PATH_CREATE_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(10));
|
|
384
|
+
const PATH_LINK_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(11));
|
|
385
|
+
const PATH_LINK_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(12));
|
|
386
|
+
const PATH_OPEN = /*#__PURE__*/ (BigInt(1) << BigInt(13));
|
|
387
|
+
const FD_READDIR = /*#__PURE__*/ (BigInt(1) << BigInt(14));
|
|
388
|
+
const PATH_READLINK = /*#__PURE__*/ (BigInt(1) << BigInt(15));
|
|
389
|
+
const PATH_RENAME_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(16));
|
|
390
|
+
const PATH_RENAME_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(17));
|
|
391
|
+
const PATH_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(18));
|
|
392
|
+
const PATH_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(19));
|
|
393
|
+
const PATH_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(20));
|
|
394
|
+
const FD_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(21));
|
|
395
|
+
const FD_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(22));
|
|
396
|
+
const FD_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(23));
|
|
397
|
+
const PATH_SYMLINK = /*#__PURE__*/ (BigInt(1) << BigInt(24));
|
|
398
|
+
const PATH_REMOVE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(25));
|
|
399
|
+
const PATH_UNLINK_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(26));
|
|
400
|
+
const POLL_FD_READWRITE = /*#__PURE__*/ (BigInt(1) << BigInt(27));
|
|
401
|
+
const SOCK_SHUTDOWN = /*#__PURE__*/ (BigInt(1) << BigInt(28));
|
|
402
|
+
const SOCK_ACCEPT = /*#__PURE__*/ (BigInt(1) << BigInt(29));
|
|
386
403
|
const WasiRights = {
|
|
387
|
-
FD_DATASYNC
|
|
388
|
-
FD_READ
|
|
389
|
-
FD_SEEK
|
|
390
|
-
FD_FDSTAT_SET_FLAGS
|
|
391
|
-
FD_SYNC
|
|
392
|
-
FD_TELL
|
|
393
|
-
FD_WRITE
|
|
394
|
-
FD_ADVISE
|
|
395
|
-
FD_ALLOCATE
|
|
396
|
-
PATH_CREATE_DIRECTORY
|
|
397
|
-
PATH_CREATE_FILE
|
|
398
|
-
PATH_LINK_SOURCE
|
|
399
|
-
PATH_LINK_TARGET
|
|
400
|
-
PATH_OPEN
|
|
401
|
-
FD_READDIR
|
|
402
|
-
PATH_READLINK
|
|
403
|
-
PATH_RENAME_SOURCE
|
|
404
|
-
PATH_RENAME_TARGET
|
|
405
|
-
PATH_FILESTAT_GET
|
|
406
|
-
PATH_FILESTAT_SET_SIZE
|
|
407
|
-
PATH_FILESTAT_SET_TIMES
|
|
408
|
-
FD_FILESTAT_GET
|
|
409
|
-
FD_FILESTAT_SET_SIZE
|
|
410
|
-
FD_FILESTAT_SET_TIMES
|
|
411
|
-
PATH_SYMLINK
|
|
412
|
-
PATH_REMOVE_DIRECTORY
|
|
413
|
-
PATH_UNLINK_FILE
|
|
414
|
-
POLL_FD_READWRITE
|
|
415
|
-
SOCK_SHUTDOWN
|
|
416
|
-
SOCK_ACCEPT
|
|
404
|
+
FD_DATASYNC,
|
|
405
|
+
FD_READ,
|
|
406
|
+
FD_SEEK,
|
|
407
|
+
FD_FDSTAT_SET_FLAGS,
|
|
408
|
+
FD_SYNC,
|
|
409
|
+
FD_TELL,
|
|
410
|
+
FD_WRITE,
|
|
411
|
+
FD_ADVISE,
|
|
412
|
+
FD_ALLOCATE,
|
|
413
|
+
PATH_CREATE_DIRECTORY,
|
|
414
|
+
PATH_CREATE_FILE,
|
|
415
|
+
PATH_LINK_SOURCE,
|
|
416
|
+
PATH_LINK_TARGET,
|
|
417
|
+
PATH_OPEN,
|
|
418
|
+
FD_READDIR,
|
|
419
|
+
PATH_READLINK,
|
|
420
|
+
PATH_RENAME_SOURCE,
|
|
421
|
+
PATH_RENAME_TARGET,
|
|
422
|
+
PATH_FILESTAT_GET,
|
|
423
|
+
PATH_FILESTAT_SET_SIZE,
|
|
424
|
+
PATH_FILESTAT_SET_TIMES,
|
|
425
|
+
FD_FILESTAT_GET,
|
|
426
|
+
FD_FILESTAT_SET_SIZE,
|
|
427
|
+
FD_FILESTAT_SET_TIMES,
|
|
428
|
+
PATH_SYMLINK,
|
|
429
|
+
PATH_REMOVE_DIRECTORY,
|
|
430
|
+
PATH_UNLINK_FILE,
|
|
431
|
+
POLL_FD_READWRITE,
|
|
432
|
+
SOCK_SHUTDOWN,
|
|
433
|
+
SOCK_ACCEPT
|
|
417
434
|
};
|
|
418
435
|
|
|
419
436
|
function strerror(errno) {
|
|
@@ -559,7 +576,7 @@ const REGULAR_FILE_BASE = WasiRights.FD_DATASYNC |
|
|
|
559
576
|
WasiRights.FD_FILESTAT_SET_SIZE |
|
|
560
577
|
WasiRights.FD_FILESTAT_SET_TIMES |
|
|
561
578
|
WasiRights.POLL_FD_READWRITE;
|
|
562
|
-
const REGULAR_FILE_INHERITING = BigInt(0);
|
|
579
|
+
const REGULAR_FILE_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
563
580
|
const DIRECTORY_BASE = WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
564
581
|
WasiRights.FD_SYNC |
|
|
565
582
|
WasiRights.FD_ADVISE |
|
|
@@ -594,7 +611,7 @@ const TTY_BASE = WasiRights.FD_READ |
|
|
|
594
611
|
WasiRights.FD_WRITE |
|
|
595
612
|
WasiRights.FD_FILESTAT_GET |
|
|
596
613
|
WasiRights.POLL_FD_READWRITE;
|
|
597
|
-
const TTY_INHERITING = BigInt(0);
|
|
614
|
+
const TTY_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
598
615
|
function getRights(stdio, fd, flags, type) {
|
|
599
616
|
const ret = {
|
|
600
617
|
base: BigInt(0),
|
|
@@ -901,7 +918,7 @@ class AsyncTable extends FileDescriptorTable {
|
|
|
901
918
|
}
|
|
902
919
|
|
|
903
920
|
/** @public */
|
|
904
|
-
const WebAssemblyMemory =
|
|
921
|
+
const WebAssemblyMemory = _WebAssembly.Memory;
|
|
905
922
|
/** @public */
|
|
906
923
|
class Memory extends WebAssemblyMemory {
|
|
907
924
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
@@ -2321,7 +2338,8 @@ class WASI$1 {
|
|
|
2321
2338
|
}
|
|
2322
2339
|
}
|
|
2323
2340
|
|
|
2324
|
-
|
|
2341
|
+
// eslint-disable-next-line spaced-comment
|
|
2342
|
+
const kEmptyObject = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.create(null));
|
|
2325
2343
|
const kExitCode = Symbol('kExitCode');
|
|
2326
2344
|
const kSetMemory = Symbol('kSetMemory');
|
|
2327
2345
|
const kStarted = Symbol('kStarted');
|
package/dist/wasm-util.js
CHANGED
|
@@ -201,20 +201,7 @@
|
|
|
201
201
|
return ignore ? exportValue : this.wrapExportFunction(exportValue);
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
-
}
|
|
205
|
-
// /** @public */
|
|
206
|
-
// export class Instance extends WebAssembly.Instance {
|
|
207
|
-
// constructor (options: AsyncifyOptions, module: WebAssembly.Module, importObject?: WebAssembly.Imports) {
|
|
208
|
-
// importObject = importObject ?? {}
|
|
209
|
-
// const asyncify = new Asyncify()
|
|
210
|
-
// super(module, asyncify.wrapImports(importObject))
|
|
211
|
-
// asyncify.init(importObject, this, options)
|
|
212
|
-
// }
|
|
213
|
-
// get exports (): WebAssembly.Exports {
|
|
214
|
-
// return wrappedExports.get(super.exports)!
|
|
215
|
-
// }
|
|
216
|
-
// }
|
|
217
|
-
// Object.defineProperty(Instance.prototype, 'exports', { enumerable: true })
|
|
204
|
+
}
|
|
218
205
|
|
|
219
206
|
function validateImports(imports) {
|
|
220
207
|
if (imports && typeof imports !== 'object') {
|
|
@@ -389,37 +376,67 @@
|
|
|
389
376
|
return resolvedPath.length > 0 ? resolvedPath : '.';
|
|
390
377
|
}
|
|
391
378
|
|
|
379
|
+
const FD_DATASYNC = /*#__PURE__*/ (BigInt(1) << BigInt(0));
|
|
380
|
+
const FD_READ = /*#__PURE__*/ (BigInt(1) << BigInt(1));
|
|
381
|
+
const FD_SEEK = /*#__PURE__*/ (BigInt(1) << BigInt(2));
|
|
382
|
+
const FD_FDSTAT_SET_FLAGS = /*#__PURE__*/ (BigInt(1) << BigInt(3));
|
|
383
|
+
const FD_SYNC = /*#__PURE__*/ (BigInt(1) << BigInt(4));
|
|
384
|
+
const FD_TELL = /*#__PURE__*/ (BigInt(1) << BigInt(5));
|
|
385
|
+
const FD_WRITE = /*#__PURE__*/ (BigInt(1) << BigInt(6));
|
|
386
|
+
const FD_ADVISE = /*#__PURE__*/ (BigInt(1) << BigInt(7));
|
|
387
|
+
const FD_ALLOCATE = /*#__PURE__*/ (BigInt(1) << BigInt(8));
|
|
388
|
+
const PATH_CREATE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(9));
|
|
389
|
+
const PATH_CREATE_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(10));
|
|
390
|
+
const PATH_LINK_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(11));
|
|
391
|
+
const PATH_LINK_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(12));
|
|
392
|
+
const PATH_OPEN = /*#__PURE__*/ (BigInt(1) << BigInt(13));
|
|
393
|
+
const FD_READDIR = /*#__PURE__*/ (BigInt(1) << BigInt(14));
|
|
394
|
+
const PATH_READLINK = /*#__PURE__*/ (BigInt(1) << BigInt(15));
|
|
395
|
+
const PATH_RENAME_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(16));
|
|
396
|
+
const PATH_RENAME_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(17));
|
|
397
|
+
const PATH_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(18));
|
|
398
|
+
const PATH_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(19));
|
|
399
|
+
const PATH_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(20));
|
|
400
|
+
const FD_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(21));
|
|
401
|
+
const FD_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(22));
|
|
402
|
+
const FD_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(23));
|
|
403
|
+
const PATH_SYMLINK = /*#__PURE__*/ (BigInt(1) << BigInt(24));
|
|
404
|
+
const PATH_REMOVE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(25));
|
|
405
|
+
const PATH_UNLINK_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(26));
|
|
406
|
+
const POLL_FD_READWRITE = /*#__PURE__*/ (BigInt(1) << BigInt(27));
|
|
407
|
+
const SOCK_SHUTDOWN = /*#__PURE__*/ (BigInt(1) << BigInt(28));
|
|
408
|
+
const SOCK_ACCEPT = /*#__PURE__*/ (BigInt(1) << BigInt(29));
|
|
392
409
|
const WasiRights = {
|
|
393
|
-
FD_DATASYNC
|
|
394
|
-
FD_READ
|
|
395
|
-
FD_SEEK
|
|
396
|
-
FD_FDSTAT_SET_FLAGS
|
|
397
|
-
FD_SYNC
|
|
398
|
-
FD_TELL
|
|
399
|
-
FD_WRITE
|
|
400
|
-
FD_ADVISE
|
|
401
|
-
FD_ALLOCATE
|
|
402
|
-
PATH_CREATE_DIRECTORY
|
|
403
|
-
PATH_CREATE_FILE
|
|
404
|
-
PATH_LINK_SOURCE
|
|
405
|
-
PATH_LINK_TARGET
|
|
406
|
-
PATH_OPEN
|
|
407
|
-
FD_READDIR
|
|
408
|
-
PATH_READLINK
|
|
409
|
-
PATH_RENAME_SOURCE
|
|
410
|
-
PATH_RENAME_TARGET
|
|
411
|
-
PATH_FILESTAT_GET
|
|
412
|
-
PATH_FILESTAT_SET_SIZE
|
|
413
|
-
PATH_FILESTAT_SET_TIMES
|
|
414
|
-
FD_FILESTAT_GET
|
|
415
|
-
FD_FILESTAT_SET_SIZE
|
|
416
|
-
FD_FILESTAT_SET_TIMES
|
|
417
|
-
PATH_SYMLINK
|
|
418
|
-
PATH_REMOVE_DIRECTORY
|
|
419
|
-
PATH_UNLINK_FILE
|
|
420
|
-
POLL_FD_READWRITE
|
|
421
|
-
SOCK_SHUTDOWN
|
|
422
|
-
SOCK_ACCEPT
|
|
410
|
+
FD_DATASYNC,
|
|
411
|
+
FD_READ,
|
|
412
|
+
FD_SEEK,
|
|
413
|
+
FD_FDSTAT_SET_FLAGS,
|
|
414
|
+
FD_SYNC,
|
|
415
|
+
FD_TELL,
|
|
416
|
+
FD_WRITE,
|
|
417
|
+
FD_ADVISE,
|
|
418
|
+
FD_ALLOCATE,
|
|
419
|
+
PATH_CREATE_DIRECTORY,
|
|
420
|
+
PATH_CREATE_FILE,
|
|
421
|
+
PATH_LINK_SOURCE,
|
|
422
|
+
PATH_LINK_TARGET,
|
|
423
|
+
PATH_OPEN,
|
|
424
|
+
FD_READDIR,
|
|
425
|
+
PATH_READLINK,
|
|
426
|
+
PATH_RENAME_SOURCE,
|
|
427
|
+
PATH_RENAME_TARGET,
|
|
428
|
+
PATH_FILESTAT_GET,
|
|
429
|
+
PATH_FILESTAT_SET_SIZE,
|
|
430
|
+
PATH_FILESTAT_SET_TIMES,
|
|
431
|
+
FD_FILESTAT_GET,
|
|
432
|
+
FD_FILESTAT_SET_SIZE,
|
|
433
|
+
FD_FILESTAT_SET_TIMES,
|
|
434
|
+
PATH_SYMLINK,
|
|
435
|
+
PATH_REMOVE_DIRECTORY,
|
|
436
|
+
PATH_UNLINK_FILE,
|
|
437
|
+
POLL_FD_READWRITE,
|
|
438
|
+
SOCK_SHUTDOWN,
|
|
439
|
+
SOCK_ACCEPT
|
|
423
440
|
};
|
|
424
441
|
|
|
425
442
|
function strerror(errno) {
|
|
@@ -565,7 +582,7 @@
|
|
|
565
582
|
WasiRights.FD_FILESTAT_SET_SIZE |
|
|
566
583
|
WasiRights.FD_FILESTAT_SET_TIMES |
|
|
567
584
|
WasiRights.POLL_FD_READWRITE;
|
|
568
|
-
const REGULAR_FILE_INHERITING = BigInt(0);
|
|
585
|
+
const REGULAR_FILE_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
569
586
|
const DIRECTORY_BASE = WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
570
587
|
WasiRights.FD_SYNC |
|
|
571
588
|
WasiRights.FD_ADVISE |
|
|
@@ -600,7 +617,7 @@
|
|
|
600
617
|
WasiRights.FD_WRITE |
|
|
601
618
|
WasiRights.FD_FILESTAT_GET |
|
|
602
619
|
WasiRights.POLL_FD_READWRITE;
|
|
603
|
-
const TTY_INHERITING = BigInt(0);
|
|
620
|
+
const TTY_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
604
621
|
function getRights(stdio, fd, flags, type) {
|
|
605
622
|
const ret = {
|
|
606
623
|
base: BigInt(0),
|
|
@@ -907,7 +924,7 @@
|
|
|
907
924
|
}
|
|
908
925
|
|
|
909
926
|
/** @public */
|
|
910
|
-
const WebAssemblyMemory =
|
|
927
|
+
const WebAssemblyMemory = _WebAssembly.Memory;
|
|
911
928
|
/** @public */
|
|
912
929
|
class Memory extends WebAssemblyMemory {
|
|
913
930
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
@@ -2327,7 +2344,8 @@
|
|
|
2327
2344
|
}
|
|
2328
2345
|
}
|
|
2329
2346
|
|
|
2330
|
-
|
|
2347
|
+
// eslint-disable-next-line spaced-comment
|
|
2348
|
+
const kEmptyObject = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.create(null));
|
|
2331
2349
|
const kExitCode = Symbol('kExitCode');
|
|
2332
2350
|
const kSetMemory = Symbol('kSetMemory');
|
|
2333
2351
|
const kStarted = Symbol('kStarted');
|
package/lib/cjs/asyncify.js
CHANGED
|
@@ -155,17 +155,4 @@ class Asyncify {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
exports.Asyncify = Asyncify;
|
|
158
|
-
// /** @public */
|
|
159
|
-
// export class Instance extends WebAssembly.Instance {
|
|
160
|
-
// constructor (options: AsyncifyOptions, module: WebAssembly.Module, importObject?: WebAssembly.Imports) {
|
|
161
|
-
// importObject = importObject ?? {}
|
|
162
|
-
// const asyncify = new Asyncify()
|
|
163
|
-
// super(module, asyncify.wrapImports(importObject))
|
|
164
|
-
// asyncify.init(importObject, this, options)
|
|
165
|
-
// }
|
|
166
|
-
// get exports (): WebAssembly.Exports {
|
|
167
|
-
// return wrappedExports.get(super.exports)!
|
|
168
|
-
// }
|
|
169
|
-
// }
|
|
170
|
-
// Object.defineProperty(Instance.prototype, 'exports', { enumerable: true })
|
|
171
158
|
//# sourceMappingURL=asyncify.js.map
|
package/lib/cjs/memory.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extendMemory = exports.Memory = exports.WebAssemblyMemory = void 0;
|
|
4
|
+
/* eslint-disable spaced-comment */
|
|
4
5
|
const webassembly_1 = require("./webassembly");
|
|
5
6
|
/** @public */
|
|
6
7
|
exports.WebAssemblyMemory = webassembly_1._WebAssembly.Memory;
|
package/lib/cjs/wasi/index.js
CHANGED
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WASI = void 0;
|
|
4
4
|
const preview1_1 = require("./preview1");
|
|
5
5
|
const util_1 = require("./util");
|
|
6
|
-
|
|
6
|
+
// eslint-disable-next-line spaced-comment
|
|
7
|
+
const kEmptyObject = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.create(null));
|
|
7
8
|
const kExitCode = Symbol('kExitCode');
|
|
8
9
|
const kSetMemory = Symbol('kSetMemory');
|
|
9
10
|
const kStarted = Symbol('kStarted');
|
package/lib/cjs/wasi/rights.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRights = exports.TTY_INHERITING = exports.TTY_BASE = exports.SOCKET_INHERITING = exports.SOCKET_BASE = exports.DIRECTORY_INHERITING = exports.DIRECTORY_BASE = exports.REGULAR_FILE_INHERITING = exports.REGULAR_FILE_BASE = exports.CHARACTER_DEVICE_INHERITING = exports.CHARACTER_DEVICE_BASE = exports.BLOCK_DEVICE_INHERITING = exports.BLOCK_DEVICE_BASE = exports.RIGHTS_ALL = void 0;
|
|
4
|
+
/* eslint-disable spaced-comment */
|
|
4
5
|
const error_1 = require("./error");
|
|
5
6
|
const types_1 = require("./types");
|
|
6
7
|
exports.RIGHTS_ALL = types_1.WasiRights.FD_DATASYNC |
|
package/lib/cjs/wasi/types.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WasiFstFlag = exports.WasiClockid = exports.WasiFdFlag = exports.WasiFileControlFlag = exports.FileControlFlag = exports.WasiWhence = exports.WasiRights = exports.WasiFileType = exports.WasiErrno = void 0;
|
|
4
|
+
/* eslint-disable spaced-comment */
|
|
4
5
|
var WasiErrno;
|
|
5
6
|
(function (WasiErrno) {
|
|
6
7
|
WasiErrno[WasiErrno["ESUCCESS"] = 0] = "ESUCCESS";
|
|
@@ -92,37 +93,67 @@ var WasiFileType;
|
|
|
92
93
|
WasiFileType[WasiFileType["SOCKET_STREAM"] = 6] = "SOCKET_STREAM";
|
|
93
94
|
WasiFileType[WasiFileType["SYMBOLIC_LINK"] = 7] = "SYMBOLIC_LINK";
|
|
94
95
|
})(WasiFileType = exports.WasiFileType || (exports.WasiFileType = {}));
|
|
96
|
+
const FD_DATASYNC = /*#__PURE__*/ (BigInt(1) << BigInt(0));
|
|
97
|
+
const FD_READ = /*#__PURE__*/ (BigInt(1) << BigInt(1));
|
|
98
|
+
const FD_SEEK = /*#__PURE__*/ (BigInt(1) << BigInt(2));
|
|
99
|
+
const FD_FDSTAT_SET_FLAGS = /*#__PURE__*/ (BigInt(1) << BigInt(3));
|
|
100
|
+
const FD_SYNC = /*#__PURE__*/ (BigInt(1) << BigInt(4));
|
|
101
|
+
const FD_TELL = /*#__PURE__*/ (BigInt(1) << BigInt(5));
|
|
102
|
+
const FD_WRITE = /*#__PURE__*/ (BigInt(1) << BigInt(6));
|
|
103
|
+
const FD_ADVISE = /*#__PURE__*/ (BigInt(1) << BigInt(7));
|
|
104
|
+
const FD_ALLOCATE = /*#__PURE__*/ (BigInt(1) << BigInt(8));
|
|
105
|
+
const PATH_CREATE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(9));
|
|
106
|
+
const PATH_CREATE_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(10));
|
|
107
|
+
const PATH_LINK_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(11));
|
|
108
|
+
const PATH_LINK_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(12));
|
|
109
|
+
const PATH_OPEN = /*#__PURE__*/ (BigInt(1) << BigInt(13));
|
|
110
|
+
const FD_READDIR = /*#__PURE__*/ (BigInt(1) << BigInt(14));
|
|
111
|
+
const PATH_READLINK = /*#__PURE__*/ (BigInt(1) << BigInt(15));
|
|
112
|
+
const PATH_RENAME_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(16));
|
|
113
|
+
const PATH_RENAME_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(17));
|
|
114
|
+
const PATH_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(18));
|
|
115
|
+
const PATH_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(19));
|
|
116
|
+
const PATH_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(20));
|
|
117
|
+
const FD_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(21));
|
|
118
|
+
const FD_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(22));
|
|
119
|
+
const FD_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(23));
|
|
120
|
+
const PATH_SYMLINK = /*#__PURE__*/ (BigInt(1) << BigInt(24));
|
|
121
|
+
const PATH_REMOVE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(25));
|
|
122
|
+
const PATH_UNLINK_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(26));
|
|
123
|
+
const POLL_FD_READWRITE = /*#__PURE__*/ (BigInt(1) << BigInt(27));
|
|
124
|
+
const SOCK_SHUTDOWN = /*#__PURE__*/ (BigInt(1) << BigInt(28));
|
|
125
|
+
const SOCK_ACCEPT = /*#__PURE__*/ (BigInt(1) << BigInt(29));
|
|
95
126
|
exports.WasiRights = {
|
|
96
|
-
FD_DATASYNC
|
|
97
|
-
FD_READ
|
|
98
|
-
FD_SEEK
|
|
99
|
-
FD_FDSTAT_SET_FLAGS
|
|
100
|
-
FD_SYNC
|
|
101
|
-
FD_TELL
|
|
102
|
-
FD_WRITE
|
|
103
|
-
FD_ADVISE
|
|
104
|
-
FD_ALLOCATE
|
|
105
|
-
PATH_CREATE_DIRECTORY
|
|
106
|
-
PATH_CREATE_FILE
|
|
107
|
-
PATH_LINK_SOURCE
|
|
108
|
-
PATH_LINK_TARGET
|
|
109
|
-
PATH_OPEN
|
|
110
|
-
FD_READDIR
|
|
111
|
-
PATH_READLINK
|
|
112
|
-
PATH_RENAME_SOURCE
|
|
113
|
-
PATH_RENAME_TARGET
|
|
114
|
-
PATH_FILESTAT_GET
|
|
115
|
-
PATH_FILESTAT_SET_SIZE
|
|
116
|
-
PATH_FILESTAT_SET_TIMES
|
|
117
|
-
FD_FILESTAT_GET
|
|
118
|
-
FD_FILESTAT_SET_SIZE
|
|
119
|
-
FD_FILESTAT_SET_TIMES
|
|
120
|
-
PATH_SYMLINK
|
|
121
|
-
PATH_REMOVE_DIRECTORY
|
|
122
|
-
PATH_UNLINK_FILE
|
|
123
|
-
POLL_FD_READWRITE
|
|
124
|
-
SOCK_SHUTDOWN
|
|
125
|
-
SOCK_ACCEPT
|
|
127
|
+
FD_DATASYNC,
|
|
128
|
+
FD_READ,
|
|
129
|
+
FD_SEEK,
|
|
130
|
+
FD_FDSTAT_SET_FLAGS,
|
|
131
|
+
FD_SYNC,
|
|
132
|
+
FD_TELL,
|
|
133
|
+
FD_WRITE,
|
|
134
|
+
FD_ADVISE,
|
|
135
|
+
FD_ALLOCATE,
|
|
136
|
+
PATH_CREATE_DIRECTORY,
|
|
137
|
+
PATH_CREATE_FILE,
|
|
138
|
+
PATH_LINK_SOURCE,
|
|
139
|
+
PATH_LINK_TARGET,
|
|
140
|
+
PATH_OPEN,
|
|
141
|
+
FD_READDIR,
|
|
142
|
+
PATH_READLINK,
|
|
143
|
+
PATH_RENAME_SOURCE,
|
|
144
|
+
PATH_RENAME_TARGET,
|
|
145
|
+
PATH_FILESTAT_GET,
|
|
146
|
+
PATH_FILESTAT_SET_SIZE,
|
|
147
|
+
PATH_FILESTAT_SET_TIMES,
|
|
148
|
+
FD_FILESTAT_GET,
|
|
149
|
+
FD_FILESTAT_SET_SIZE,
|
|
150
|
+
FD_FILESTAT_SET_TIMES,
|
|
151
|
+
PATH_SYMLINK,
|
|
152
|
+
PATH_REMOVE_DIRECTORY,
|
|
153
|
+
PATH_UNLINK_FILE,
|
|
154
|
+
POLL_FD_READWRITE,
|
|
155
|
+
SOCK_SHUTDOWN,
|
|
156
|
+
SOCK_ACCEPT
|
|
126
157
|
};
|
|
127
158
|
var WasiWhence;
|
|
128
159
|
(function (WasiWhence) {
|
package/lib/mjs/asyncify.mjs
CHANGED
|
@@ -151,16 +151,3 @@ export class Asyncify {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
// /** @public */
|
|
155
|
-
// export class Instance extends WebAssembly.Instance {
|
|
156
|
-
// constructor (options: AsyncifyOptions, module: WebAssembly.Module, importObject?: WebAssembly.Imports) {
|
|
157
|
-
// importObject = importObject ?? {}
|
|
158
|
-
// const asyncify = new Asyncify()
|
|
159
|
-
// super(module, asyncify.wrapImports(importObject))
|
|
160
|
-
// asyncify.init(importObject, this, options)
|
|
161
|
-
// }
|
|
162
|
-
// get exports (): WebAssembly.Exports {
|
|
163
|
-
// return wrappedExports.get(super.exports)!
|
|
164
|
-
// }
|
|
165
|
-
// }
|
|
166
|
-
// Object.defineProperty(Instance.prototype, 'exports', { enumerable: true })
|
package/lib/mjs/memory.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _WebAssembly } from "./webassembly.mjs";
|
|
2
2
|
/** @public */
|
|
3
|
-
export const WebAssemblyMemory = _WebAssembly.Memory;
|
|
3
|
+
export const WebAssemblyMemory = /*#__PURE__*/ _WebAssembly.Memory;
|
|
4
4
|
/** @public */
|
|
5
5
|
export class Memory extends WebAssemblyMemory {
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
package/lib/mjs/wasi/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WASI as _WASI } from "./preview1.mjs";
|
|
2
2
|
import { validateObject, validateArray, validateBoolean, validateFunction, validateUndefined } from "./util.mjs";
|
|
3
|
-
|
|
3
|
+
// eslint-disable-next-line spaced-comment
|
|
4
|
+
const kEmptyObject = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.create(null));
|
|
4
5
|
const kExitCode = Symbol('kExitCode');
|
|
5
6
|
const kSetMemory = Symbol('kSetMemory');
|
|
6
7
|
const kStarted = Symbol('kStarted');
|
package/lib/mjs/wasi/rights.mjs
CHANGED
|
@@ -46,7 +46,7 @@ export const REGULAR_FILE_BASE = WasiRights.FD_DATASYNC |
|
|
|
46
46
|
WasiRights.FD_FILESTAT_SET_SIZE |
|
|
47
47
|
WasiRights.FD_FILESTAT_SET_TIMES |
|
|
48
48
|
WasiRights.POLL_FD_READWRITE;
|
|
49
|
-
export const REGULAR_FILE_INHERITING = BigInt(0);
|
|
49
|
+
export const REGULAR_FILE_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
50
50
|
export const DIRECTORY_BASE = WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
51
51
|
WasiRights.FD_SYNC |
|
|
52
52
|
WasiRights.FD_ADVISE |
|
|
@@ -81,7 +81,7 @@ export const TTY_BASE = WasiRights.FD_READ |
|
|
|
81
81
|
WasiRights.FD_WRITE |
|
|
82
82
|
WasiRights.FD_FILESTAT_GET |
|
|
83
83
|
WasiRights.POLL_FD_READWRITE;
|
|
84
|
-
export const TTY_INHERITING = BigInt(0);
|
|
84
|
+
export const TTY_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
85
85
|
export function getRights(stdio, fd, flags, type) {
|
|
86
86
|
const ret = {
|
|
87
87
|
base: BigInt(0),
|
package/lib/mjs/wasi/types.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable spaced-comment */
|
|
1
2
|
export var WasiErrno;
|
|
2
3
|
(function (WasiErrno) {
|
|
3
4
|
WasiErrno[WasiErrno["ESUCCESS"] = 0] = "ESUCCESS";
|
|
@@ -89,37 +90,67 @@ export var WasiFileType;
|
|
|
89
90
|
WasiFileType[WasiFileType["SOCKET_STREAM"] = 6] = "SOCKET_STREAM";
|
|
90
91
|
WasiFileType[WasiFileType["SYMBOLIC_LINK"] = 7] = "SYMBOLIC_LINK";
|
|
91
92
|
})(WasiFileType || (WasiFileType = {}));
|
|
93
|
+
const FD_DATASYNC = /*#__PURE__*/ (BigInt(1) << BigInt(0));
|
|
94
|
+
const FD_READ = /*#__PURE__*/ (BigInt(1) << BigInt(1));
|
|
95
|
+
const FD_SEEK = /*#__PURE__*/ (BigInt(1) << BigInt(2));
|
|
96
|
+
const FD_FDSTAT_SET_FLAGS = /*#__PURE__*/ (BigInt(1) << BigInt(3));
|
|
97
|
+
const FD_SYNC = /*#__PURE__*/ (BigInt(1) << BigInt(4));
|
|
98
|
+
const FD_TELL = /*#__PURE__*/ (BigInt(1) << BigInt(5));
|
|
99
|
+
const FD_WRITE = /*#__PURE__*/ (BigInt(1) << BigInt(6));
|
|
100
|
+
const FD_ADVISE = /*#__PURE__*/ (BigInt(1) << BigInt(7));
|
|
101
|
+
const FD_ALLOCATE = /*#__PURE__*/ (BigInt(1) << BigInt(8));
|
|
102
|
+
const PATH_CREATE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(9));
|
|
103
|
+
const PATH_CREATE_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(10));
|
|
104
|
+
const PATH_LINK_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(11));
|
|
105
|
+
const PATH_LINK_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(12));
|
|
106
|
+
const PATH_OPEN = /*#__PURE__*/ (BigInt(1) << BigInt(13));
|
|
107
|
+
const FD_READDIR = /*#__PURE__*/ (BigInt(1) << BigInt(14));
|
|
108
|
+
const PATH_READLINK = /*#__PURE__*/ (BigInt(1) << BigInt(15));
|
|
109
|
+
const PATH_RENAME_SOURCE = /*#__PURE__*/ (BigInt(1) << BigInt(16));
|
|
110
|
+
const PATH_RENAME_TARGET = /*#__PURE__*/ (BigInt(1) << BigInt(17));
|
|
111
|
+
const PATH_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(18));
|
|
112
|
+
const PATH_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(19));
|
|
113
|
+
const PATH_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(20));
|
|
114
|
+
const FD_FILESTAT_GET = /*#__PURE__*/ (BigInt(1) << BigInt(21));
|
|
115
|
+
const FD_FILESTAT_SET_SIZE = /*#__PURE__*/ (BigInt(1) << BigInt(22));
|
|
116
|
+
const FD_FILESTAT_SET_TIMES = /*#__PURE__*/ (BigInt(1) << BigInt(23));
|
|
117
|
+
const PATH_SYMLINK = /*#__PURE__*/ (BigInt(1) << BigInt(24));
|
|
118
|
+
const PATH_REMOVE_DIRECTORY = /*#__PURE__*/ (BigInt(1) << BigInt(25));
|
|
119
|
+
const PATH_UNLINK_FILE = /*#__PURE__*/ (BigInt(1) << BigInt(26));
|
|
120
|
+
const POLL_FD_READWRITE = /*#__PURE__*/ (BigInt(1) << BigInt(27));
|
|
121
|
+
const SOCK_SHUTDOWN = /*#__PURE__*/ (BigInt(1) << BigInt(28));
|
|
122
|
+
const SOCK_ACCEPT = /*#__PURE__*/ (BigInt(1) << BigInt(29));
|
|
92
123
|
export const WasiRights = {
|
|
93
|
-
FD_DATASYNC
|
|
94
|
-
FD_READ
|
|
95
|
-
FD_SEEK
|
|
96
|
-
FD_FDSTAT_SET_FLAGS
|
|
97
|
-
FD_SYNC
|
|
98
|
-
FD_TELL
|
|
99
|
-
FD_WRITE
|
|
100
|
-
FD_ADVISE
|
|
101
|
-
FD_ALLOCATE
|
|
102
|
-
PATH_CREATE_DIRECTORY
|
|
103
|
-
PATH_CREATE_FILE
|
|
104
|
-
PATH_LINK_SOURCE
|
|
105
|
-
PATH_LINK_TARGET
|
|
106
|
-
PATH_OPEN
|
|
107
|
-
FD_READDIR
|
|
108
|
-
PATH_READLINK
|
|
109
|
-
PATH_RENAME_SOURCE
|
|
110
|
-
PATH_RENAME_TARGET
|
|
111
|
-
PATH_FILESTAT_GET
|
|
112
|
-
PATH_FILESTAT_SET_SIZE
|
|
113
|
-
PATH_FILESTAT_SET_TIMES
|
|
114
|
-
FD_FILESTAT_GET
|
|
115
|
-
FD_FILESTAT_SET_SIZE
|
|
116
|
-
FD_FILESTAT_SET_TIMES
|
|
117
|
-
PATH_SYMLINK
|
|
118
|
-
PATH_REMOVE_DIRECTORY
|
|
119
|
-
PATH_UNLINK_FILE
|
|
120
|
-
POLL_FD_READWRITE
|
|
121
|
-
SOCK_SHUTDOWN
|
|
122
|
-
SOCK_ACCEPT
|
|
124
|
+
FD_DATASYNC,
|
|
125
|
+
FD_READ,
|
|
126
|
+
FD_SEEK,
|
|
127
|
+
FD_FDSTAT_SET_FLAGS,
|
|
128
|
+
FD_SYNC,
|
|
129
|
+
FD_TELL,
|
|
130
|
+
FD_WRITE,
|
|
131
|
+
FD_ADVISE,
|
|
132
|
+
FD_ALLOCATE,
|
|
133
|
+
PATH_CREATE_DIRECTORY,
|
|
134
|
+
PATH_CREATE_FILE,
|
|
135
|
+
PATH_LINK_SOURCE,
|
|
136
|
+
PATH_LINK_TARGET,
|
|
137
|
+
PATH_OPEN,
|
|
138
|
+
FD_READDIR,
|
|
139
|
+
PATH_READLINK,
|
|
140
|
+
PATH_RENAME_SOURCE,
|
|
141
|
+
PATH_RENAME_TARGET,
|
|
142
|
+
PATH_FILESTAT_GET,
|
|
143
|
+
PATH_FILESTAT_SET_SIZE,
|
|
144
|
+
PATH_FILESTAT_SET_TIMES,
|
|
145
|
+
FD_FILESTAT_GET,
|
|
146
|
+
FD_FILESTAT_SET_SIZE,
|
|
147
|
+
FD_FILESTAT_SET_TIMES,
|
|
148
|
+
PATH_SYMLINK,
|
|
149
|
+
PATH_REMOVE_DIRECTORY,
|
|
150
|
+
PATH_UNLINK_FILE,
|
|
151
|
+
POLL_FD_READWRITE,
|
|
152
|
+
SOCK_SHUTDOWN,
|
|
153
|
+
SOCK_ACCEPT
|
|
123
154
|
};
|
|
124
155
|
export var WasiWhence;
|
|
125
156
|
(function (WasiWhence) {
|