32
edits
m (→Overview) |
|||
| Line 59: | Line 59: | ||
=== nsIScriptContext === | === nsIScriptContext === | ||
* The ownership model of the | * The ownership model of the <tt>void *</tt> objects returned from <tt>nsIScriptContext</tt> must be clarified and made more explicit. The "WrapNative" process, which is used to locate a language native object "bound" to a DOM object pointer is tied up with this. | ||
* Existing JSObject replaced with void | * Existing <tt>JSObject</tt> replaced with <tt>void</tt> | ||
* Existing | * Existing <tt>char *version</tt> replaced with <tt>PRUint32 version</tt>. New method on <tt>nsILanguageRuntime</tt> to convert a <tt>char * version</tt> string into the flags. | ||
* | * New <tt>FinalizeClasses</tt> method - JS implementation does the <tt>ClearScope/ClearWatchpointsForObject/ClearRegExpStatistics</tt> dance. | ||
* | * <tt>nsIArray</tt> to be used in place of <tt>jsval</tt> argc/argv used now. <tt>CompileEventHandler</tt> needs to pass an array of event arg names (currently limited to 1), and support for onerror must be added (which is the only known event to not have a single param). There is a new <tt>nsJSArgArray</tt> object that "wraps" a <tt>jsval argv</tt> object into an <tt>nsIArray</tt> - but also supports a private interface for getting the original <tt>jsval</tt> array. Thus, js->js calls do not convert elements in the array - objects are only converted when <tt>nsIArray</tt> methods are directly used (eg, when another language sees the array) | ||
* | * <tt>CompileEventHandler</tt> now takes an array of arg names - this is because the <tt>onerror</tt> event takes 3 params. <tt>nsContentUtils::GetEventArgName()</tt> renamed to <tt>GetEventArgNames()</tt> with params changed accordingly, and returns 3 names for 'onerror'. | ||
* | * A new <tt>SetProperty</tt> method has been added, currently used only to set <tt>window.arguments</tt>. Note that <tt>BindCompiledEventHandler()</tt> changes make these 2 functions almost identical in concept, so these could possibly be merged. Alternatively, now we use <tt>nsIArray</tt> for window arguments, we could possibly add <tt>arguments</tt> as an XPCOM property on the DOM object itself, meaning <tt>SetProperty()</tt> could go away. | ||
* SetTerminationFunction needs thinking through - this does *not* seem to be a per-language thing. | * <tt>SetTerminationFunction</tt> needs thinking through - this does *not* seem to be a per-language thing, but is used only for JS GC, so that the script global is notified when the JS global object is collected. This needs more thinking through, or possibly just moved privately inside the JS implementation. | ||
* New method | * New method <tt>void *GetNativeGlobal()</tt> to return the "global object" used by <tt>nsIScriptGlobalWindow</tt> (previously stored in <tt>mJSObject</tt>) for this context. <tt>nsIScriptGlobalObject</tt> calls this method during language init to setup its environment. | ||
* New Serialize and Deserialize methods added. | * New <tt>Serialize</tt> and <tt>Deserialize</tt> methods added with <tt>nsXULPrototypeScript</tt> delegating to the context. | ||
=== nsIScriptGlobalObject and nsGlobalWindow === | === nsIScriptGlobalObject and nsGlobalWindow === | ||
edits