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

Test timers are undefined

This commit is contained in:
Joshua Peek 2014-12-22 18:34:44 -08:00
parent 898dc5e32e
commit 6ef718c479

View file

@ -230,6 +230,15 @@ class TestExecJS < Test
assert ExecJS.eval("typeof console == 'undefined'")
end
def test_timers_are_undefined
assert ExecJS.eval("typeof setTimeout == 'undefined'")
assert ExecJS.eval("typeof setInterval == 'undefined'")
assert ExecJS.eval("typeof clearTimeout == 'undefined'")
assert ExecJS.eval("typeof clearInterval == 'undefined'")
assert ExecJS.eval("typeof setImmediate == 'undefined'")
assert ExecJS.eval("typeof clearImmediate == 'undefined'")
end
def test_compile_large_scripts
body = "var foo = 'bar';\n" * 100_000
assert ExecJS.exec("function foo() {\n#{body}\n};\nreturn true")