diff --git a/lib/execjs/support/node_runner.js b/lib/execjs/support/node_runner.js index ab0c6ec..3dc4757 100644 --- a/lib/execjs/support/node_runner.js +++ b/lib/execjs/support/node_runner.js @@ -1,4 +1,4 @@ -(function(program, execJS) { execJS(program) })(function(global, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source} +(function(program, execJS) { execJS(program) })(function(global, process, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source} }, function(program) { var output, print = function(string) { process.stdout.write('' + string); diff --git a/test/test_execjs.rb b/test/test_execjs.rb index 7fd967f..061be48 100644 --- a/test/test_execjs.rb +++ b/test/test_execjs.rb @@ -237,6 +237,10 @@ class TestExecJS < Test assert ExecJS.eval("typeof global == 'undefined'") end + def test_node_process_is_undefined + assert ExecJS.eval("typeof process == 'undefined'") + end + def test_commonjs_vars_are_undefined assert ExecJS.eval("typeof module == 'undefined'") assert ExecJS.eval("typeof exports == 'undefined'")