aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-14 17:16:26 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-14 17:16:26 -0700
commit672f2ab151e09de7d62e51ec5a6d029e8b5d02da (patch)
treede9b3cdec5b1653c42bdab026159298981abac10
parent93198c609f9909d7a3a89578961227624cb0124b (diff)
do not fail if no read() in the shell, which is the case with jsc
-rw-r--r--src/shell.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/shell.js b/src/shell.js
index bac4eaa3..f91aa96a 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -74,7 +74,12 @@ else if (ENVIRONMENT_IS_SHELL) {
Module['print'] = print;
if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm
- Module['read'] = read;
+ if (typeof read != 'undefined') {
+ Module['read'] = read;
+ } else {
+ Module['read'] = function() { throw 'no read() available (jsc?)' };
+ }
+
Module['readBinary'] = function(f) {
return read(f, 'binary');
};