File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -519,8 +519,12 @@ var WasiLibrary = {
519
519
FS . isLink ( stream . mode ) ? { { { cDefs . __WASI_FILETYPE_SYMBOLIC_LINK } } } :
520
520
{ { { cDefs . __WASI_FILETYPE_REGULAR_FILE } } } ;
521
521
#else
522
- // hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0
523
- var type = fd == 0 || fd == 1 || fd == 2 ? { { { cDefs . __WASI_FILETYPE_CHARACTER_DEVICE } } } : abort ( ) ;
522
+ // Hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0. We support at
523
+ // least stdin, stdout, stderr in a simple way.
524
+ #if ASSERTIONS
525
+ assert ( fd = = 0 || fd == 1 || fd == 2 ) ;
526
+ #endif
527
+ var type = { { { cDefs . __WASI_FILETYPE_CHARACTER_DEVICE } } } ;
524
528
if ( fd == 0 ) {
525
529
rightsBase = { { { cDefs . __WASI_RIGHTS_FD_READ } } } ;
526
530
} else if ( fd == 1 || fd == 2 ) {
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ mergeInto(LibraryManager.library, {
71
71
_wasmfs_opfs_init_root_directory : async function ( ctx ) {
72
72
// allocated.length starts off as 1 since 0 is a reserved handle
73
73
if ( wasmfsOPFSDirectoryHandles . allocated . length == 1 ) {
74
+ // Closure compiler errors on this as it does not recognize the OPFS
75
+ // API yet, it seems. Unfortunately an existing annotation for this is in
76
+ // the closure compiler codebase, and cannot be overridden in user code
77
+ // (it complains on a duplicate type annotation), so just suppress it.
78
+ /** @suppress {checkTypes} */
74
79
let root = await navigator . storage . getDirectory ( ) ;
75
80
wasmfsOPFSDirectoryHandles . allocated . push ( root ) ;
76
81
}
You can’t perform that action at this time.
0 commit comments