never allow any js that takes longer than 5 seconds to run.

This commit is contained in:
Sam 2013-12-09 12:43:48 +11:00
parent eb956a909f
commit 6ebc2dcf5c
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ module PrettyText
end
def self.create_new_context
ctx = V8::Context.new
# timeout any eval that takes longer that 5 seconds
ctx = V8::Context.new(timeout: 5000)
ctx["helpers"] = Helpers.new