Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How can i call a JavaScript object's method from C++'?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
袁涛  
View profile  
 More options Nov 1 2012, 4:41 am
From: 袁涛 <rolin8...@gmail.com>
Date: Thu, 1 Nov 2012 01:41:52 -0700 (PDT)
Local: Thurs, Nov 1 2012 4:41 am
Subject: How can i call a JavaScript object's method from C++'?

like this
class MyClass
{
     //setter
     //gettter
     public:
     void TestA()
     {

     }

}

Then set FunctionTemplate to js
js can use this: var a = MyClass(); a.fn= function() {}

my question is : in TestA how can i invoke a.fn?
TestA is not call by js , no args , mybe it's a async method
how can i get the Local<object>?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yang Guo  
View profile  
 More options Nov 5 2012, 3:28 am
From: Yang Guo <yang...@chromium.org>
Date: Mon, 5 Nov 2012 00:28:57 -0800 (PST)
Local: Mon, Nov 5 2012 3:28 am
Subject: Re: How can i call a JavaScript object's method from C++'?

You can use the context to get the global object, use the global object to
get to object a (a is a property of the global object), use a to get to
function fn (fn is a property of a), then cast it to v8::Function and use
its Call method. Take a look at test/cctest/test-api.cc and search for
FunctionCall.

Yang


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »