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

Merge pull request #178 from sstephenson/shadow-node-global

Normalize global
This commit is contained in:
Joshua Peek 2015-02-03 13:41:32 -08:00
commit e31d86e82a
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) { }, function(program) {
var output, print = function(string) { var output, print = function(string) {
process.stdout.write('' + string); process.stdout.write('' + string);

View file

@ -221,6 +221,7 @@ class TestExecJS < Test
end end
def test_commonjs_vars_are_undefined def test_commonjs_vars_are_undefined
assert ExecJS.eval("typeof global == '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'")
assert ExecJS.eval("typeof require == 'undefined'") assert ExecJS.eval("typeof require == 'undefined'")