Java Doc for JsValueSaf.java in » Ajax » GWT » com » google » gwt » dev » shell » mac » Java Source Code / Java DocumentationJava Source Code and Java Documentation
Represents a Safari JavaScript value.
The basic rule is that any JSValue passed to Java code from native code will
always be GC-protected in the native code and Java will always unprotect it
when the value is finalized. It should always be stored in a JsValue object
immediately to make sure it is cleaned up properly when it is no longer
needed. This approach is required to avoid a race condition where the value
is allocated in JNI code but could be garbage collected before Java takes
ownership of the value. Java values passed into JavaScript store a GlobalRef
of a WebKitDispatchAdapter or MethodDispatch objects, which are freed when
the JS value is finalized.
Constructor Summary
public
JsValueSaf() Create a Java wrapper around an undefined JSValue.
public
JsValueSaf(int jsval) Create a Java wrapper around the underlying JSValue.