Proposal: Object gather in parameters lists

Simo Costa andrysimo1997 at
Sun Dec 16 18:55:55 UTC 2018

This is a proposal to allow gathering one ore more specified arguments into
one or more objects when a function is invoked.
This proposal totally replace the previous: "faster this assignments in
constructor functions".
Simple example:
constructor(...this{par1, par2, par3}) {
  // constructor body

I'm not going to explain here all the details about this proposal. You can
find them on GitHub following this link where the proposal is
widely discussed. There you will find all the nitty gritty details, with a
suggestion for the transpilations.


* Currently this type of gather is not allowed in JavaScript.
* It allows us to directly map function arguments to object properties in a
programmed order.
* It provides a fast and unequivocal way to construct object using
parameters that could be easily optimized by the engine.
* It provides a fast and clean way to create common constructor functions.
* Current solutions imply one or more of the following: changes to the
function signature, useless objects creations, annoying identifiers
repetitions or an additional function call.

The involvement of a TC39 champion would be really appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list