ES4 stable draft: object initializers

Jon Zeppieri jaz at bu.edu
Fri Apr 18 09:38:44 PDT 2008


On 4/10/08, Lars Hansen <lhansen at adobe.com> wrote:
> Here is the third draft, which I have tentatively labeled as stable.
>
>  Please note the OPEN ISSUES, the input of everyone on these would be
>  appreciated.


> * There is no way to seal the object created by an object
>    initializer, as a prefix 'const' annotation only distributes
>    across the fields of the object and does not imply anything about
>    the object as a whole.

With catchalls, an object could be sealed like this:

{ const x: X, const y: Y, set *(id) { throw ... } }

If the "a prefix 'const' annotation... distributes across the fields"
rule were relaxed to say that the annotation distributes across all
non-catchall (and maybe all non-getter/setter [?]) properties, then
the above could be abbreviated:

const { x: X, y: Y, set *(id) { throw ... } }

-Jon



More information about the Es4-discuss mailing list