Personally, I don't that the internal [[Prototype]] "property" should reify as an actual property of the object. It's really a more fundamental aspect of "objectness" than regular properties. From that perspective, if you want to control access to it, it should probably be done as a flag on the object itself, much as the ES3.1 proposal does with the [[Extensible]] property.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ingvar von Schoultz Sent: Wednesday, July 16, 2008 10:29 AM To: [EMAIL PROTECTED]; [email protected] Subject: A read/write __proto__ that can vanish Some people yearn hotly for __proto__, preferrably writable if at all possible, while others point to problems with security and software privacy. I get the impression that this could be solved by adding a fourth flag among the property flags Enumerable, Writable and Flexible. There might be a flag called Visible, so you could make __proto__ apparently vanish by setting Visible to false. As an added bonus, this solution would let code hide the prototype property on constructors if desired. Personally I'd love to see it defined in such a way that I could set prototype inheritance in a simple, straightforward way at the beginning of a constructor function: function $MyConstructor() { this.proto = MySuperInstance; // Here you can hide proto if desired. ... } If a visible proto is standardized, the name should be proto, not __proto__, in my opinion. The underscores indicate nonstandard. -- Ingvar von Schoultz ------- (My quirky use of capitals in code comes from my opinion that reserved and predefined words should all start with lowercase, and user-defined should all start with uppercase, because this will easily and elegantly prevent a host of name-collision problems when things like programming languages are upgraded with new labels.) _______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss _______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
