Test fix.

This commit is contained in:
Bruce Hill 2017-10-09 04:37:16 -07:00
parent 286b421f0e
commit 2f1c0284fe
2 changed files with 2 additions and 0 deletions

View File

@ -339,6 +339,7 @@ do
if max_operations then if max_operations then
local timeout local timeout
timeout = function() timeout = function()
debug.sethook()
return self:error("Execution quota exceeded. Your code took too long.") return self:error("Execution quota exceeded. Your code took too long.")
end end
debug.sethook(timeout, "", max_operations) debug.sethook(timeout, "", max_operations)

View File

@ -277,6 +277,7 @@ class NomsuCompiler
run: (src, filename, max_operations=nil)=> run: (src, filename, max_operations=nil)=>
if max_operations if max_operations
timeout = -> timeout = ->
debug.sethook!
@error "Execution quota exceeded. Your code took too long." @error "Execution quota exceeded. Your code took too long."
debug.sethook timeout, "", max_operations debug.sethook timeout, "", max_operations
tree = @parse(src, filename) tree = @parse(src, filename)