Re: WebIDL generated TypeErrors and promises

On Friday, June 28, 2013 at 4:10 PM, Domenic Denicola wrote:

> From: Marcos Caceres [mailto:w3c@marcosc.com]  
>  
> > Ok, but this potentially breaks WebIDL… maybe kinda… I think most specs assume that WebIDL does its thing, then algorithmic prose runs.
>  
> I mean, presumably WebIDL can be made to incorporate this automatically. Add a step at the end with "If return type is Promise, and an exception has been thrown, instead return a rejected promise with that exception." WebIDL is meant to serve us, not constrain us, right? ;)

Absolutely :) I guess if Promises are part of ES, then one can safely assume they are part of the platform.... Still, I'm not sure exactly what the best solution is here as I can see the argument for both approaches: one keeps consistency with how type checking is done on the platform VS special-casing Promises wrt error handling to avoid confusion…. hmmm.  
  
--  
Marcos Caceres

Received on Friday, 28 June 2013 15:32:15 UTC