Skip to content

Commit 58d39a5

Browse files
authored
Use cDefs in library_wasmfs_node.js. NFC (#21998)
1 parent e2a0472 commit 58d39a5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/library_wasmfs_node.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,14 @@ addToLibrary({
7878
let sp = stackSave();
7979
let name = stringToUTF8OnStack(entry.name);
8080
let type;
81-
// TODO: Figure out how to use `cDefine` here.
8281
if (entry.isFile()) {
83-
type = 1;
82+
type = {{{ cDefine('File::DataFileKind') }}};
8483
} else if (entry.isDirectory()) {
85-
type = 2;
84+
type = {{{ cDefine('File::DirectoryKind') }}};
8685
} else if (entry.isSymbolicLink()) {
87-
type = 3;
86+
type = {{{ cDefine('File::SymlinkKind') }}};
8887
} else {
89-
type = 0;
88+
type = {{{ cDefine('File::UnknownKind') }}};
9089
}
9190
__wasmfs_node_record_dirent(vec, name, type);
9291
stackRestore(sp);

0 commit comments

Comments
 (0)