Re: [promises] Guidance on the usage of promises for API developers

On 1/14/14 7:33 AM, Arthur Barstow wrote:
> [2]:
> https://github.com/domenic/promises-unwrapping/blob/master/docs/writing-specifications-with-promises.md

One issue I just realized, as I was considering how to implement some of 
this stuff in automated ways.  All the terms in the "Creating Promises" 
are implicitly assuming operation in a particular realm [1].  Same for 
the ones in "Aggregating Promises" and the definition of "Transforming p 
with onFulfilled and onRejected".  Same thing for the "Promise Arguments 
Should Be Cast" guidance.

They need to either explicitly specify which realm is used somehow or 
all consumers (that is, specs using this terminology) need to do it.

This is particularly relevant when functions from one realm are invoked 
on a this object or arguments from another realm (and possible from 
multiple other realms); the algorithm defining the behavior of the 
function may need to think carefully about what realms are used for 
which operations in that situation...

-Boris

[1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-code-realms

Received on Thursday, 16 January 2014 18:24:05 UTC