Subj : Re: Reinitialize standard classes To : solarflare@yahoo.com From : Brendan Eich Date : Thu Apr 10 2003 10:32 am Solar wrote: > Hi! > > There is a function JS_ResolveStandardClass() in jsapi.c, but the API > reference does not describe it. I found when the argument 'id' that > present a standard class name, this class will be initialized. I insert > some code in the funtion for debugging, and found the standard classes > were reinitialized many many times in the Mozilla environment. Is that > right? > What do you mean "reinitialized many many times"? Before this API, all DOM windows were initialized before each document load via JS_InitStandardClasses. That creates *all* of the standard class objects (Date, parseInt, RegExp, ...). With JS_ResolveStandardClass hooked up via the DOM's window class resolve hook, only those that *a particular document* uses from script are created, and only for those windows that load documents with scripts. Are you sure you're understanding what you see in the debugger? If you do see some kind of bug where for a given window, for a single document that uses, say, the Date constructor, js_InitDateClass is called more than once, then please file a bug. /be .