aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-10-09 04:37:16 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-10-09 04:37:16 -0700
commit2f1c0284fe81446a603ad0e00fcf5137596156cf (patch)
treeff7ab9ae8978fb77353ba6d6cb2647d2c1428a60
parent286b421f0e2ec4cfa713f1c3698ed465509dfeb1 (diff)
Test fix.
-rw-r--r--nomsu.lua1
-rwxr-xr-xnomsu.moon1
2 files changed, 2 insertions, 0 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 0dd9d5f..496cd28 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -339,6 +339,7 @@ do
if max_operations then
local timeout
timeout = function()
+ debug.sethook()
return self:error("Execution quota exceeded. Your code took too long.")
end
debug.sethook(timeout, "", max_operations)
diff --git a/nomsu.moon b/nomsu.moon
index 4728c91..bf5c979 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -277,6 +277,7 @@ class NomsuCompiler
run: (src, filename, max_operations=nil)=>
if max_operations
timeout = ->
+ debug.sethook!
@error "Execution quota exceeded. Your code took too long."
debug.sethook timeout, "", max_operations
tree = @parse(src, filename)