1
0
Fork 0
mirror of https://github.com/rubyjs/mini_racer synced 2023-03-27 23:21:28 -04:00
mini_racer/lib/mini_racer.rb

26 lines
420 B
Ruby
Raw Normal View History

2016-05-04 02:54:51 -04:00
require "mini_racer/version"
require "mini_racer_extension"
module MiniRacer
class JavaScriptError < StandardError; end
2016-05-06 03:08:06 -04:00
# eval is defined in the C class
class Context
def initialize(options = nil)
2016-05-08 06:59:10 -04:00
@functions = {}
2016-05-06 03:08:06 -04:00
if options
@timeout = options[:timeout]
end
end
2016-05-08 06:59:10 -04:00
def attach(name, callback)
@functions[name.to_s] = callback
notify(name.to_s)
end
2016-05-06 03:08:06 -04:00
end
2016-05-04 02:54:51 -04:00
end