Re: Cross-process JS wrappers
Benjamin Smedberg <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
On 8/31/09 7:44 AM, Boris Zbarsky wrote: > Benjamin Smedberg wrote: >> Determining when a >> particular script has run to "completion" is oddly complicated given >> the way >> we can walk through binary<->JS for a script. > > nsJSContext::ScriptEvaluated tells you when the script is done. Combined > with a new function indicating when it starts, we might have something > good enough for this... Doesn't that fire when a JS DOM event listener is done, even if an outer script triggered the event? e.g.: 1) element.addEventListener(foo, func); 2) element.appendChild(foo) 3) XPCOM 4) func() 5) // Wouldn't ScriptEvaluated fire here for "func"? we don't want to unlock at this point > The hard part is what happens if the script spins the event loop. ;) If the script spins the event loop it doesn't have any useful atomic run-to-completion semantics anyway, right? --BDS