W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

Re: WebIDL generated TypeErrors and promises

From: Marcos Caceres <w3c@marcosc.com>
Date: Fri, 28 Jun 2013 16:01:28 +0100
To: Domenic Denicola <domenic@domenicdenicola.com>
Cc: public-script-coord <public-script-coord@w3.org>
Message-ID: <A7E13B8AA00549D9BA0F45F38052A9B5@marcosc.com>

On Friday, June 28, 2013 at 3:47 PM, Domenic Denicola wrote:

> I don't think this has been discussed, but it's a good thing to bring up.
> I feel somewhat strongly that functions should present an only-sync or only-async interface. Thus I would say `boo` gets called with the `TypeError`.

Ok, but this potentially breaks WebIDL… maybe kinda… I think most specs assume that WebIDL does its thing, then algorithmic prose runs.  

This would mean that specs that use promises need to be written as:

When the foo(V) method is invoked:  

1. do type conversion on V as per WebIDL, and let error be any exception thrown. If an exception is thrown, run the promise's resolver's internal reject algorithm with error as value.


Or some such. 
Received on Friday, 28 June 2013 15:01:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:13 UTC