[webkit-help] can I get an ExecState from a JSGlobalData?

Per Bothner per.bothner at oracle.com
Fri May 20 19:53:36 PDT 2011


What I'm really trying to do is create a Java wrapper object that
wraps both the underlying Node reference and the JSNode reference.
(The reason to to make a Java API that is a easier to use.)
I'm hoping to create the JSNode lazily, when needed.  Can I
from the Node create a JSNode?  The C++ toJS API function requires
an ExecState.  From the Node I get get to the Document, and from
the Document I can get to JSGlobalData.  So the missing step
from from JSGlobalData to ExecState.  Can I get/create a suitable
global ExecState from a JSGlobalData.

The other alternative is to always store a JSGlobalContextRef
(which is an ExecState) in the Java wrapper object.  I started down this 
path,
but it looks painful to find and change all the places when I need
to pass around the JSGlobalContextRef.  But if that's the right
approach, it's probably not that bad.
-- 
	--Per Bothner
per.bothner at oracle.com   per at bothner.com   http://per.bothner.com/


More information about the webkit-help mailing list