Syntax Proposal: Allow Java-like Object Literals after constructor calls to set properties on created objects.
lists at scratchdisk.com
Thu Jul 1 14:31:58 PDT 2010
Brendan, just to clarify:
> the Rhino your-constructor-call-with-args+object-initialiser-for-extra-properties
Rhino does not use the object literal following a constructor call as an initialiser for extra properties. It just passes it to the constructor by adding it to the end of the list of arguments already passed to it. The proposal to use it as an initialiser comes from me tinkering with it on the Rhino proxy object level by making it automatically initialise the created instances. I came to the conclusion that such a use of it is very handy without realising this was proposed years ago already, as you pointed out in your previous email.
Do you think something along these lines, or the mentioned 'merge / mixin' operator could be discussed to become a future standard?
More information about the es-discuss