How to call a AS function from C++?
akelkar at ea.com
Thu Jun 19 07:10:17 PDT 2008
Just to be clear, I am not doing any reentrancy work here, I am just
trying to create a ScriptObject and call AS method in that object from
C++. Even I am not sure how to setup the namespaces/domains etc for
execution of methods. I am doing it by trial and error.
So far from C++
- I am able to find a globally defined object (instance of a class) - I
call it as a factory object.
- call an AS method on factory from C++. This method internally create a
new object instance of another AS class and returns it to C++.
And now I am trying call method on the newly created object and having
problem with namespace. Somehow calling method on factory object from
C++ did not create any problem for namespace.
From: David Mandelin [mailto:dmandelin at mozilla.com]
Sent: Thursday, June 19, 2008 9:42 AM
To: tamarin-devel at mozilla.org
Cc: Kelkar, Anand
Subject: Re: How to call a AS function from C++?
Kelkar, Anand wrote:
> Hello All,
> I am trying to call an AS method on an AS object from C++ by using
> Toplevel->callproperty() function. But the problem is that when
> callproperty() tries to find the function inside the traits of that
> object, it cannot find it because the namespace sets that is passed
> thru Multiname to callproprty() function are not matching with ones
> saved inside traits table. Right now I am using publicNamespace to
> generate my multiname for function but that seems not to be correct.
> How do I find the correct namespace to be passed to multiname?
Is it possible to do this? I thought the interpreter was not reentrant.
I'm interested in a full answer as well. I'm working on some stuff where
I need to understand in detail how method calls and such work and what
can be done in the existing infrastructure.
More information about the Tamarin-devel