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

Re: WebIDL generated TypeErrors and promises

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Fri, 28 Jun 2013 14:47:28 +0000
To: Marcos Caceres <w3c@marcosc.com>
CC: public-script-coord <public-script-coord@w3.org>
Message-ID: <EFC64959-8333-467B-B167-8C764E7AB987@domenicdenicola.com>
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`.

On Jun 28, 2013, at 7:45, "Marcos Caceres" <w3c@marcosc.com> wrote:

> Hi,   
> I'm sure this has been discussed, so apologies in advanced for not finding the right threadů  
> 
> When using a method that vends a promise, it's not clear to me what should happen when WebIDL says to throw a TypeError.  
> 
> Like, given:
> 
> interface Foo{
> Promise bar(object obj);  
> };
> 
> //Does this throw a TypeError
> //or is boo called with the TypeError?
> fooInstance.bar(123).then(yay,boo);  
> 
> 
> 
> --  
> Marcos Caceres
> 
> 
> 
> 
Received on Friday, 28 June 2013 14:48:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC