1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/lib/v8/conversion
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
..
array.rb call JavaScript functions from Ruby. 2012-06-12 07:06:25 -05:00
class.rb formatting nit. 2012-07-24 23:29:23 +03:00
code.rb only use 'ref' gem for MRI 2012-08-11 14:22:22 -05:00
fixnum.rb Conversion trick for 64-bit Fixnums, with fixed tests 2012-08-01 21:16:48 +07:00
fundamental.rb Embed lambdas and procs into V8::Context 2015-08-12 21:02:39 +03:00
hash.rb factor out v8 conversions into separate modules 2012-06-11 01:58:12 -05:00
method.rb only use 'ref' gem for MRI 2012-08-11 14:22:22 -05:00
object.rb extract default object conversion 2012-06-19 04:42:04 -05:00
proc.rb extract proc conversion into generic 'code' conversion 2012-06-16 04:56:49 -05:00
reference.rb extract default object conversion 2012-06-19 04:42:04 -05:00
string.rb factor out v8 conversions into separate modules 2012-06-11 01:58:12 -05:00
symbol.rb factor out v8 conversions into separate modules 2012-06-11 01:58:12 -05:00
time.rb factor out v8 conversions into separate modules 2012-06-11 01:58:12 -05:00