Extended Object Literals to review

Faisal Vali faisalv at gmail.com
Sun Mar 13 14:10:24 PDT 2011

> Allen Wirfs-Brock worte:
> ....
> I've updated all of the Harmony extended object literal proposals
> http://wiki.ecmascript.org/doku.php?id=strawman:object_initialiser_extensions
> based upon discussions at the last several TC39 meetings.
> ...
> These items are on the agenda for the next TC39 meeting but discussion here is certainly
> welcome.

Very useful proposals.  Thank you!

Upon my preliminary read, one question (or rather discussion point)
does come to mind.

In the context of the proposals(*), are the following syntactic
constructs valid within object initialisers - and what are their
   1) var toString : const() { ... }
   2) var toString : function() {... }
   3) var toString : #() {... }

My initial thoughts are that if valid, (1) would behave the same as 'method'.
(2) would be a property that is not enumerable, but can be
over-written (by data or another function).
(3) would be the same as (2), but with 'pounder' semantics (re: this,
return, tco etc...).

But are they valid?  (Or is var confined only to data properties) And
if not, what was the argument for disallowing the use of 'var' to
annotate a property name that could be bound to a function.

Thanks again!
Faisal Vali

(*) http://wiki.ecmascript.org/doku.php?id=strawman:obj_initialiser_const:

More information about the es-discuss mailing list