1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/lib
Charles Lowell 250b8e7d50 Embed lambdas and procs into V8::Context
This adds the ability embed basic Ruby code blocks into a javascript
context and invoke it.

  cxt = V8::Context.new
  cxt['twice'] = lambda {|str| "#{str}#{str}"}
  cxt.eval('twice("hi")') #=> "hihi"

Note that error handling is not accounted for yet. If an exception
happens inside the called proc, it will cause terrible, awful things
to happen because portions of the C++ stack will not be unwound leaving
the Isolate in an indeterminate state.
2015-08-12 21:02:39 +03:00
..
v8 Embed lambdas and procs into V8::Context 2015-08-12 21:02:39 +03:00
therubyracer.rb Make it possible to require "therubyracer". 2013-02-04 23:41:50 -05:00
v8.rb add back in the memory map + documentation 2015-07-31 14:48:26 +03:00