32
edits
| Line 83: | Line 83: | ||
http://lxr.mozilla.org/seamonkey/source/dom/public/nsIScriptGlobalObject.h | http://lxr.mozilla.org/seamonkey/source/dom/public/nsIScriptGlobalObject.h | ||
nsGlobalWindow is the main implemention of nsIScriptGlobalObject, but XUL and XBL have a few. | <tt>nsGlobalWindow</tt> is the main implemention of <tt>nsIScriptGlobalObject</tt>, but XUL and XBL have a few. | ||
* nsIScriptGlobalObject remains a single object (ie, not per language). It | * <tt>nsIScriptGlobalObject</tt> remains a single object (ie, not per language). It keeps an array of <tt>nsIScriptContext</tt> objects and <tt>void *</tt> globals for each supported language. Methods <tt>GetContext</tt> and <tt>GetGlobalJSObject</tt> have been replaced with <tt>GetLanguageContext</tt> and <tt>GetLanguageGlobal</tt>, both of which take the language ID as a param. The places still tied to JS explicitly pass <tt>nsIProgrammingLanguage::JAVASCRIPT</tt> when necessary. | ||
GetContext | |||
* New method EnsureScriptEnvironment(PRUint32 langID) to ensure the nsIScriptGlobal is initialized for a specific language. This may be called at any time - whenever someone needs to run a script in a language. | * New method <tt>EnsureScriptEnvironment(PRUint32 langID)</tt> to ensure the nsIScriptGlobal is initialized for a specific language. This may be called at any time - whenever someone needs to run a script in a language. | ||
* New method to set and get "properties" - nsGlobalWindow does this for JS. Setting a property should presumably set it in all languages (via the global attached to the context). Getting is tricker - what if the property is in a different language? Or in multiple languages? | * New method to set and get "properties" - nsGlobalWindow does this for JS. Setting a property should presumably set it in all languages (via the global attached to the context). Getting is tricker - what if the property is in a different language? Or in multiple languages? | ||
edits