mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
Add info on calling js functions to README
This commit is contained in:
parent
9482e5b00b
commit
57beb23528
1 changed files with 6 additions and 1 deletions
|
@ -31,6 +31,11 @@ evaluate some simple JavaScript
|
||||||
cxt = V8::Context.new
|
cxt = V8::Context.new
|
||||||
cxt.eval('7 * 6') #=> 42
|
cxt.eval('7 * 6') #=> 42
|
||||||
|
|
||||||
|
call JavaScript functions
|
||||||
|
|
||||||
|
cxt.eval "function isTruthy(arg) { return !!arg }"
|
||||||
|
cxt.scope.isTruthy(0) #=> false
|
||||||
|
|
||||||
embed values into the scope of your context
|
embed values into the scope of your context
|
||||||
|
|
||||||
cxt['foo'] = "bar"
|
cxt['foo'] = "bar"
|
||||||
|
|
Loading…
Add table
Reference in a new issue