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:
parent
4f2fc87a55
commit
af43a575f8
2 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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'")
|
||||
|
|
Loading…
Reference in a new issue