meta-property proposal

Andrea Giammarchi andrea.giammarchi at
Thu May 14 22:44:43 UTC 2015

Alexander ES6 "is out" as it is, here the proposal is to make reachable
that argument because indeed, since about ever, in JS you can ignore
arguments, but you can also always reach them through the argument object.

When it comes to generators, arguments object would be a misleading place
to give you any sent value 'cause that's rather how you initialize the
generator, hence the function.nect proposal, and I must say I like it in
all its weird glory.

Like you said, Python throws, meaning devs coming from Python won't ever
make such mistake of sending values a tthe very first `.next` invoke, so JS
early adopters know thanks to all bounce of early articles regarding the
early specs :D

My only concern, is that the "famous" Promise based generator wrap needs an update:

function async(makeGenerator){
  return function (value) { // <= here
    var generator = makeGenerator.apply(this, arguments);

    function handle(result){
      // result => { done: [Boolean], value: [Object] }
      if (result.done) return Promise.resolve(result.value);

      return Promise.resolve(result.value).then(function (res){
        return handle(;
      }, function (err){
        return handle(generator.throw(err));

    try {
      return handle(; // <= here
    } catch (ex) {
      return Promise.reject(ex);

Best Regards

On Thu, May 14, 2015 at 11:25 PM, Alexander Jones <alex at> wrote:

> I don't think that's a good enough reason by itself to make this
> observable. You can pass arbitrary numbers of arguments to any function in
> JS, and they are generally ignored.
> On Thursday, 14 May 2015, Kevin Smith <zenparsing at> wrote:
>> Alexander, ES6 generators accept any arbitrary values for the first
>> invocation of "next".  That's not going to change.
>> On Thu, May 14, 2015 at 3:49 PM Alexander Jones <alex at> wrote:
>>> In Python, sending a value other than `None` into the first invocation
>>> of `send` raises an error. That seems like a reasonable behaviour to me,
>>> without introducing too much weirdness.
>>>     TypeError: can't send non-None value to a just-started generator
>>> On Thursday, May 14, 2015, Allen Wirfs-Brock <allen at>
>>> wrote:
>>>> At the March TC39 meeting we agreed that the `` metapropty
>>>> should be made into a standalone stage 1 proposal.
>>>> That proposal is now available at:
>>>> Allen
>>> _______________________________________________
>>> es-discuss mailing list
>>> es-discuss at
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list