1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Undefine global process

Node specific global should be normalized across environments
This commit is contained in:
Joshua Peek 2016-06-05 15:49:07 -07:00
parent 4f2fc87a55
commit af43a575f8
No known key found for this signature in database
GPG key ID: 2852ABCC729F67DA
2 changed files with 5 additions and 1 deletions

View file

@ -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) { }, function(program) {
var output, print = function(string) { var output, print = function(string) {
process.stdout.write('' + string); process.stdout.write('' + string);

View file

@ -237,6 +237,10 @@ class TestExecJS < Test
assert ExecJS.eval("typeof global == 'undefined'") assert ExecJS.eval("typeof global == 'undefined'")
end end
def test_node_process_is_undefined
assert ExecJS.eval("typeof process == 'undefined'")
end
def test_commonjs_vars_are_undefined def test_commonjs_vars_are_undefined
assert ExecJS.eval("typeof module == 'undefined'") assert ExecJS.eval("typeof module == 'undefined'")
assert ExecJS.eval("typeof exports == 'undefined'") assert ExecJS.eval("typeof exports == 'undefined'")