diff options
-rw-r--r-- | src/compiler.js | 4 | ||||
-rw-r--r-- | src/shell.js | 4 | ||||
-rw-r--r-- | tests/hello_world.js | 4 | ||||
-rw-r--r-- | tools/js-optimizer.js | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler.js b/src/compiler.js index 134ac5bd..2e95552d 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -50,9 +50,9 @@ if (ENVIRONMENT_IS_NODE) { this['read'] = function(f) { snarf(f) }; } - if (!this['arguments']) { + if (typeof scriptArgs != 'undefined') { arguments_ = scriptArgs; - } else { + } else if (typeof arguments != 'undefined') { arguments_ = arguments; } diff --git a/src/shell.js b/src/shell.js index bc527192..1648218a 100644 --- a/src/shell.js +++ b/src/shell.js @@ -42,9 +42,9 @@ if (ENVIRONMENT_IS_NODE) { this['read'] = function(f) { snarf(f) }; } - if (!this['arguments']) { + if (typeof scriptArgs != 'undefined') { arguments_ = scriptArgs; - } else { + } else if (typeof arguments != 'undefined') { arguments_ = arguments; } diff --git a/tests/hello_world.js b/tests/hello_world.js index 766e848e..01082eb4 100644 --- a/tests/hello_world.js +++ b/tests/hello_world.js @@ -39,9 +39,9 @@ if (ENVIRONMENT_IS_NODE) { this['read'] = function(f) { snarf(f) }; } - if (!this['arguments']) { + if (typeof scriptArgs != 'undefined') { arguments_ = scriptArgs; - } else { + } else if (typeof arguments != 'undefined') { arguments_ = arguments; } diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 213e2257..7094cdfc 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -46,9 +46,9 @@ if (ENVIRONMENT_IS_NODE) { this['read'] = function(f) { snarf(f) }; } - if (!this['arguments']) { + if (typeof scriptArgs != 'undefined') { arguments_ = scriptArgs; - } else { + } else if (typeof arguments != 'undefined') { arguments_ = arguments; } |