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

Normalize global

This commit is contained in:
Joshua Peek 2015-02-03 13:37:58 -08:00
parent 1816df22d1
commit afe05cdf2e
2 changed files with 2 additions and 1 deletions

View file

@ -1,4 +1,4 @@
(function(program, execJS) { execJS(program) })(function(module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source}
(function(program, execJS) { execJS(program) })(function(global, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source}
}, function(program) {
var output, print = function(string) {
process.stdout.write('' + string);

View file

@ -221,6 +221,7 @@ class TestExecJS < Test
end
def test_commonjs_vars_are_undefined
assert ExecJS.eval("typeof global == 'undefined'")
assert ExecJS.eval("typeof module == 'undefined'")
assert ExecJS.eval("typeof exports == 'undefined'")
assert ExecJS.eval("typeof require == 'undefined'")