From 6ef718c47977978e228467a8124cf678fccc88c3 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 22 Dec 2014 18:34:44 -0800 Subject: [PATCH] Test timers are undefined --- test/test_execjs.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test_execjs.rb b/test/test_execjs.rb index becda22..d093d8f 100644 --- a/test/test_execjs.rb +++ b/test/test_execjs.rb @@ -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")