On Mon, Mar 2, 2015 at 9:30 AM, John Lenz <[email protected]> wrote:

> I was recently discussion Promise optimizations (specifically, that in any
> "then" chain at least one Promise object is created that goes unused), this
> could be solved by some metadata that indicated whether the result of the
> function would be consumed:
>
> Promise.prototype.then = function(a, b) {
>    ...
>    if (function.called_from_void_result_context) {
>      return undefined;
>    }
>    /* current behavior */
>    ...
> };
>

More controversially, we might consider


    if (function.called_from_void_result_context) {
      /* proposed .done behavior */


I'm not sure what I think of this. It is kinda scary, but it might be the
right thing.




>
>
> // example
>
> somePromise.then(); // no chaining promise created by then
>
> var x = somePromise.then(); // chaining promise created
> x.then(); // no chaining promise created
>
> I'm not really sure what impact this would have on the VMs but I found it
> an interesting idea.
>
>
>
>
>
>
>
>
>
> On Thu, Feb 26, 2015 at 2:47 PM, Allen Wirfs-Brock <[email protected]>
> wrote:
>
>> Here is a new proposal for some additional meta properties that should be
>> considered for ES7
>> https://github.com/allenwb/ESideas/blob/master/ES7MetaProps.md
>>
>> I've added this to the agenda for next months TC39 meeting but
>> pre-meeting discussion is always welcomed right here.
>>
>> Allen
>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> [email protected]
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>


-- 
Text by me above is hereby placed in the public domain

  Cheers,
  --MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to