Test fix.
This commit is contained in:
parent
286b421f0e
commit
2f1c0284fe
@ -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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user