W3C home > Mailing lists > Public > www-tag@w3.org > January 2014

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 16 Jan 2014 13:23:34 -0500
Message-ID: <52D823A6.5030407@mit.edu>
To: "www-tag@w3.org" <www-tag@w3.org>, public-webapps <public-webapps@w3.org>
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:06 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:33:24 UTC