Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 59508cc

Browse files
committed
Merge remote-tracking branch 'bronson/patch-1'
2 parents 309ea6d + 40b64b8 commit 59508cc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ evaluate some simple JavaScript
3131
cxt = V8::Context.new
3232
cxt.eval('7 * 6') #=> 42
3333

34+
call JavaScript functions
35+
36+
cxt.eval "function isTruthy(arg) { return !!arg }"
37+
cxt[:isTruthy].call(' ') #=> true
38+
cxt.scope.isTruthy(0) #=> false
39+
3440
embed values into the scope of your context
3541

3642
cxt['foo'] = "bar"

0 commit comments

Comments
 (0)