ES4 stable draft: object initializers

Lars Hansen lhansen at
Fri Apr 18 07:12:56 PDT 2008

I introduced the syntax for catchalls in object initializers based on a
comment by David "liorian" Andersson.  I am not aware of any prior
agreement to have catchalls in object initializers.
I suspect the simple solution here is to allow meta::get etc to be used
as property names in an object initializer with a required "const"
attribute, and to spec __proto__ as a contextual keyword to set the
  { const meta::get: function (id) ...,
    __proto__: ... }
It removes extra syntax by allowing existing syntax to state the obvious
and is backward compatible with Firefox.


	From: Jeff Dyer 
	Sent: 18. april 2008 06:34
	To: Brendan Eich
	Cc: Lars Hansen; es4-discuss at
	Subject: Re: ES4 stable draft: object initializers
	On 4/17/08 2:13 PM, Brendan Eich wrote:

		These are wanted by Ajax library hackers, jresig and
shaver testify. Rather than cut a long-standing proposal because a
recent evolution of its *syntax* (not its substance) led to something
problematic, why not return to the original syntax:
		obj = {get *(id) ..., set *(id, value) ...};

	I'm trying to recover the notes that record this long standing
agreement. The "meta::get" syntax showed up on the latest proposal
based, I'm guessing, on a discussion at the March F2F. But I don't see
any mention of catchalls in object intialisers in the notes or proposals
on the wiki, or the es4-discuss archives.

		If on the other hand, the syntax is heavy either way,
but the substance is valuable because the use-cases are compelling
enough to serve, then we can stick with meta::get, etc.

	I prefer 'get' to 'meta::get' as a "keyword" and so I suggest we
return to the original syntax. I'll make a specific proposal for this
change once I see what the original syntax is.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Es4-discuss mailing list