Hi, all!

When i create/set up a new JS class (e.g. a Function/ctor object), can
i then add *that instance* of the ctor to objects from any context, or
is *that* instance of the ctor only usable in the Context under which
it was constructed?

Background: i've found that when wrapping classes, the classes are
difficult to "reach" from external code which doesn't have access to
the actual native wrappings. i would like to provide shared instances
of my wrappers so that external code (e.g. plugins) can get native-
side access to those wrappers. The primary reason for this is so that
i can pass arguments around between various plugins which have
knowledge of the base native types but no direct knowledge of the
actual bindings code. This is probably best explained with an example:

Let's say we've got PluginOne which has this function:

function doSomethingOne( OneType );

Now we have PluginTwo with:

function doSomethingTwo( TwoType );


i would like to be able to do, from PluginTwo:

function doSomethingThree( OneType, TwoType );

The native implementation would need to be able to convert both types,
and the OneType is provided by a different plugin. Obviously,
PluginTwo would need to be linked to the same base classes used with
PluginOne, but PluginTwo may not have direct access to the
FunctionTemplate from which PluginOne's type(s) (e.g. OneType) are
created.

i have the basic framework for that in place (the conversions to/from
native/js), but what i'm trying to do will only work (i think) for
this particular case if i can use shared instances of my class
wrappers (or at least the FunctionTemplate ctors) across different
Contexts.

:-?
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to