You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to therub...@googlegroups.com
I am having a problem with the following code:
ctx = V8::Context.new
ctx[:sample]=lambda {|name| "Hello #{name}"}
ctx.eval("sample('world')")
=> "Hello [object global]"
Could someone shed some light on why it's not returning "Hello world"?
Thanks,
Aaron
Charles Lowell
unread,
Apr 11, 2012, 3:46:40 PM4/11/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to The Ruby Racer
Yes, the first argument to your lambda is always the JavaScript `this`
object, whatever that happens to be. In this case, it is the context's
global object. What you want is: