Breaking the grip JS has on the DOM: Difference between revisions

revert
(revert)
Line 24: Line 24:
Below are specific implementation notes:
Below are specific implementation notes:


Magedansen = Raks sharki
=== Array and Variant object model changes ===
 
* <tt>nsIArray</tt> to be used in place of <tt>jsval</tt> argc/argv used now.  There is a new <tt>nsJSArgArray</tt> object that "wraps" a <tt>jsval *argv/int argc</tt> pair into an <tt>nsIArray</tt> - but also support a private interface for getting the original <tt>jsval</tt> based array.  Thus, js->js calls do not convert elements in the array - (offering both performance and no conversion issues), but they are converted when <tt>nsIArray</tt> methods are directly used (eg, when another language sees the array).
 
* Each of these <tt>nsIArray</tt> elements params are expected to hold either an <tt>nsIVariant</tt> or an <tt>nsISupportsPrimitive</tt>.
 
* Result values from calling scripts are now nsIVariant.  This is currently used only for the "return value" of an event handler, and only boolean and string result values are handled.  If may be more efficient to convert this to use <tt>nsISupportsPrimitive</tt> (but xpconnect already provided <tt>nsIVariant</tt> converters).


=== new interface nsILanguageRuntime ===
=== new interface nsILanguageRuntime ===
Confirmed users
161

edits