Closed rainkinz closed 11 months ago
After looking at: https://github.com/cowboyd/therubyracer/issues/238. That made me thing that perhaps having the Context initialized in the initializer itself is the problem. Sure enough:
require 'v8'
# or if using bundler (as with Rails), add the following to your Gemfile
gem "therubyracer", :require => 'v8'
class Window
def initialize
# @ctx = V8::Context.new(:with => self)
end
def eval
ctx.eval('7*8')
end
def ctx
@ctx ||= V8::Context.new(:with => self)
end
end
puts Window.new.eval
=> 56
So I'm not sure if this is an issue with therubyracer or maybe just a doc issue, to say: don't do that.
Thanks
The following segfaults on my machine: