To answer Garrent's questions I was going to directly quote the specification in the July 15 draft ES3.1 specification, but I found that that version had some issue in following the specification conventions. So here is what the definition of Object.create should be:
15.2.3.6 Object.create ( O [, Properties] ) The create method creates a new object with a specified prototype. When the static create method is called, the following steps are taken: 1. If Type(O) is not Object throw a TypeError exception. 2. Create a new object as if by the expression new Object() where Object is the standard built-in constructor with that name 3. Set the internal [[Prototype]] property of Result(2) to O. 4. Call the standard built-in function Object.defineProperties with arguments Result(2) and Properties. 5. Return Result(2). The length property of the Object.create function is 1. > -----Original Message----- > From: Garrett Smith [mailto:[EMAIL PROTECTED] > Sent: Friday, July 18, 2008 6:21 PM > To: Allen Wirfs-Brock > Cc: es4-discuss@mozilla.org > Subject: Re: ES3.1 Object static methods rationale document > > On Fri, Jul 18, 2008 at 2:02 PM, Allen Wirfs-Brock > <[EMAIL PROTECTED]> wrote: > >> -----Original Message----- > >> From: [EMAIL PROTECTED] [mailto:es4-discuss- > >> [EMAIL PROTECTED] On Behalf Of Garrett Smith > >> Sent: Friday, July 18, 2008 12:28 PM > > ... > >> You're prev response seems to have come from the discussion of > >> Object.create. Object.create, with only one argument, is the same as > >> beget. The beget function makes a new object that inherits members > >> from an existing object. The rationale doc fails to make mention of > >> this. > > > > See the first complete paragraph on page 13 > > > "Note that Object.create without its optional second argument is > essentially the same operation as > the beget function that was been widely promoted. We (perhaps not > surprisingly) agree with the > utility of this function but felt that the word "beget" is probably > confusing to many non-native English > speakers." > > Does object.create add an object to the first argument's prototype > chain? That's not explicitly stated, and one has to hunt down Doug's > begetObject. (below) > > Does the propertyDescriptor describe an object added to the front of > the object's prototype chain? > > ========================================================= > Object.prototype.begetObject = function () { > function F() {} > F.prototype = this; > return new F(); > }; > > Lasse Reichstein Nielsen's "clone" function, c. 2003:- > Object.prototype.clone = function () { > function myConstructor = function(){}; > myConstructor.prototype = this; > return new myConstructor(); > } > ========================================================= > http://groups.google.com/group/comp.lang.javascript/browse_thread/threa > d/0c1cc7f1cb314f8e/5d06e72e55d5bf11?#5d06e72e55d5bf11 > > Garrett _______________________________________________ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss