Skip to content

Commit af43a57

Browse files
committed
Undefine global process
Node specific global should be normalized across environments
1 parent 4f2fc87 commit af43a57

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/execjs/support/node_runner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function(program, execJS) { execJS(program) })(function(global, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source}
1+
(function(program, execJS) { execJS(program) })(function(global, process, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source}
22
}, function(program) {
33
var output, print = function(string) {
44
process.stdout.write('' + string);

test/test_execjs.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ def test_node_global_is_undefined
237237
assert ExecJS.eval("typeof global == 'undefined'")
238238
end
239239

240+
def test_node_process_is_undefined
241+
assert ExecJS.eval("typeof process == 'undefined'")
242+
end
243+
240244
def test_commonjs_vars_are_undefined
241245
assert ExecJS.eval("typeof module == 'undefined'")
242246
assert ExecJS.eval("typeof exports == 'undefined'")

0 commit comments

Comments
 (0)