-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating the Emscripten file system to support the new MODULARIZE arg…
…ument. Now, you pass in the FS/PATH/ERRNO_CODES objects of the module you want to use with the file system to the EmscriptenFS constructor. If none specified, it uses the globals.
- Loading branch information
John Vilk
committed
Feb 9, 2015
1 parent
6fdd660
commit aa9a840
Showing
2 changed files
with
85 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aa9a840
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks stuff. Take a look at this compiled JavaScript:
this.FS
is needed atthis.node_ops = new BFSEmscriptenNodeOps(this);
, but it is only initialized afterwards. As a resultnode_ops.FS
is undefined and attempts to do operations on the file system fail. Reverting this commit makes things work.aa9a840
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, good catch! Field initializers run before the constructor in TypeScript. I'll fix it now.
aa9a840
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated the release:
https://github.com/jvilk/BrowserFS/releases/tag/v0.3.7
I tested it w/ a non-modular Emscripten build, and it works fine!
aa9a840
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It works for me now with Em-DOSBox.
aa9a840
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Let me know how it goes w/ a modular build!
aa9a840
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to access
FS
,PATH
andERRNO_CODES
from apreRun
function in a modular build. They are needed by theEmscriptenFS
constructor. If I hack things to provide access to those, I can use BrowserFS with Em-DOSBox compiled with-s MODULARIZE=1 -s "EXPORT_NAME='mkDOSBox'"
.BTW. The Emscripten instructions in
README.md
need a change. Emscripten creates/home
, and an attempt to create that directory again will cause an error.aa9a840
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't export those somehow on
Module
? I'm not familiar with the newMODULARIZE
command; I made the change because some folks in #jsmess suggested it. Maybe we should ask the Emscripten devs to provide access to them in some official manner?I'll update that now; thanks!