diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-10 17:54:56 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-10 17:54:56 -0800 |
commit | a78a13dc7bee141afc6be2a68e6b19912f2a260c (patch) | |
tree | be6840c31fd039b74c88e297a22c0ce0eb02083f /src | |
parent | b1f86a1fb9323c9106d5d99a6afc52e1f6a1145e (diff) |
allow Module.stdin,out,err to provide defaults for streams
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js index 86897f11..598838a0 100644 --- a/src/library.js +++ b/src/library.js @@ -309,6 +309,11 @@ LibraryManager.library = { FS.ensureRoot(); + // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here + input = input || Module['stdin']; + output = output || Module['stdout']; + error = error || Module['stderr']; + // Default handlers. if (!input) input = function() { if (!input.cache || !input.cache.length) { |