Subj : Re: finilize & construct: call disbalance To : netscape.public.mozilla.jseng From : Brendan Eich Date : Fri Jul 09 2004 02:29 pm Brendan Eich wrote: >> So my reading is that by default prototype should be set to new >> Object. Am I wrong? Eric Lippert from Microsoft seems to think so too >> (url: >> http://blogs.msdn.com/ericlippert/archive/2003/11/06/53352.aspx ) As I said, ECMA-262 does not govern host objects, and it does not preclude other "native objects" (its term) being added to the language over time. So consider what Option is in the DOM level 0, or what your "native [as in, implemented using SpiderMonkey's JS API in C or C++] class" MyClass is: they are instances of new [[Class]] internal property values. When you declare a constructor function in JS, it gets a prototype of [[Class]] "Object", because that function is scripted. When you define a *native [C or C++]* constructor function, you can choose to make its prototype an instance of a new [[Class]] that you are defining. SpiderMonkey supports this, the DOM requires it. Now, you might want to be able, *in JS*, to write a constructor function whose prototype is an instance of the "class" you're trying to define in JS. But you can't. JS 1.x is not class-ical, and it's not strong and symmetric enough to support such a "user-level" class definition. Ok, having written all this, I've reviewed ECMA-262 again, and alas, it does specify that even native (its sense of that word) constructors such as RegExp have a prototype property whose value is an object whose [[Class]] is "Object". Dammit, I missed that years ago during standardization. Someone please file a bug. /be .