diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library_browser.js | 12 | ||||
-rw-r--r-- | src/library_fs.js | 3 | ||||
-rw-r--r-- | src/postamble.js | 2 | ||||
-rw-r--r-- | src/shell.js | 1 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index fff9387e..a3e68209 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -216,6 +216,12 @@ mergeInto(LibraryManager.library, { // Canvas event setup var canvas = Module['canvas']; + function pointerLockChange() { + Browser.pointerLock = document['pointerLockElement'] === canvas || + document['mozPointerLockElement'] === canvas || + document['webkitPointerLockElement'] === canvas || + document['msPointerLockElement'] === canvas; + } if (canvas) { // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module // Module['forcedAspectRatio'] = 4 / 3; @@ -232,12 +238,6 @@ mergeInto(LibraryManager.library, { function(){}; // no-op if function does not exist canvas.exitPointerLock = canvas.exitPointerLock.bind(document); - function pointerLockChange() { - Browser.pointerLock = document['pointerLockElement'] === canvas || - document['mozPointerLockElement'] === canvas || - document['webkitPointerLockElement'] === canvas || - document['msPointerLockElement'] === canvas; - } document.addEventListener('pointerlockchange', pointerLockChange, false); document.addEventListener('mozpointerlockchange', pointerLockChange, false); diff --git a/src/library_fs.js b/src/library_fs.js index d825892c..a75dab97 100644 --- a/src/library_fs.js +++ b/src/library_fs.js @@ -932,6 +932,9 @@ mergeInto(LibraryManager.library, { }); }, open: function(path, flags, mode, fd_start, fd_end) { + if (path === "") { + throw new FS.ErrnoError(ERRNO_CODES.ENOENT); + } flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags; mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode; if ((flags & {{{ cDefine('O_CREAT') }}})) { diff --git a/src/postamble.js b/src/postamble.js index b90049bc..94b88d4e 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -56,7 +56,7 @@ Module['callMain'] = Module.callMain = function callMain(args) { argv.push(0); } } - var argv = [allocate(intArrayFromString("/bin/this.program"), 'i8', ALLOC_NORMAL) ]; + var argv = [allocate(intArrayFromString(Module['thisProgram'] || '/bin/this.program'), 'i8', ALLOC_NORMAL) ]; pad(); for (var i = 0; i < argc-1; i = i + 1) { argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL)); diff --git a/src/shell.js b/src/shell.js index 279a3461..85b13337 100644 --- a/src/shell.js +++ b/src/shell.js @@ -70,6 +70,7 @@ if (ENVIRONMENT_IS_NODE) { globalEval(read(f)); }; + Module['thisProgram'] = process['argv'][1]; Module['arguments'] = process['argv'].slice(2); module['exports'] = Module; |