ES3.1 Object static methods rationale document

Allen Wirfs-Brock Allen.Wirfs-Brock at microsoft.com
Wed Jul 16 23:07:13 PDT 2008


The fixture question is a good one, but takes some thought to answer well so I'm not going to tackle it until tomorrow.

The other questions are easy:

1) as currently specified, unrecognized properties of a property descriptor are ignored.
2) no, in your example, the value of the o1 property of the created object would be an object that looks like a property descriptor.

From: Garrett Smith [mailto:dhtmlkitchen at gmail.com]
Sent: Wednesday, July 16, 2008 9:17 PM
To: Allen Wirfs-Brock
Cc: es4-discuss at mozilla.org
Subject: Re: ES3.1 Object static methods rationale document


2008/7/15 Allen Wirfs-Brock <Allen.Wirfs-Brock at microsoft.com<mailto:Allen.Wirfs-Brock at microsoft.com>>:
> I've up loaded to the wiki a new document titled:  "Proposed ECMAScript 3.1
> Static Object Functions: Use Cases and Rationale"
>
>

A couple of questions for you:

My first question: How does an ES3.1 "sealed" object relate to fixtures?

______________| ES 3.1 ______| ES4___________
Sealed object | Object.seal  | fixture (var)

My second question is about Object.create. Object.create() mixes adding a prototype to an object with a
specialized context where the (verbose) object literal contains certain property names, such as "value", take on contextual meaning to the property.

1. What happens when an unrecognized property is in the descriptor? (1)
2. Is it only possible to define attributes on the top level? (2)

(1)
Object.create(myProto, {
 method3: {
   enumerable: false, writable: false,
   novalue : true // no [[value]] + custom attribute
 },
 ,method2: undefined
});

(2) Object.create(myProto, {
 o1: {
   enumerable: true, writable: false,
   value : {
     enumerable : false,
     value : undefined
   }
 }
});

Garrett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20080716/547a1ef5/attachment-0002.html 


More information about the Es4-discuss mailing list