W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2014

[Bug 25048] consider whether an IDL attribute of type Promise<T> should catch exceptions and wrap them up as a rejected Promise like they are for operations

From: <bugzilla@jessica.w3.org>
Date: Fri, 14 Mar 2014 03:26:54 +0000
To: public-script-coord@w3.org
Message-ID: <bug-25048-3890-DYF1Tz65j0@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=25048

--- Comment #7 from Boris Zbarsky <bzbarsky@mit.edu> ---
OK, I guess if you only have one promise representing your state then it makes
sense to make it an attribute. But then I'm not sure it makes sense to have
that attribute create-and-return promises when called with the wrong this
object.

Put another way, I strongly feel like for attribute getters we should preserve
the invariant that getter.call(obj) == getter.call(obj) tests true.

So I would argue we should require that getters that return promises not throw
normally and allow them to throw if invoked on an object that's the wrong type.
 In practice, I don't expect anyone to be doing that sort of thing anyway.

As far as setters, if we have no use cases, let's not add complexity and just
disallow them.  WebIDL already has too many unused (and never will be used!)
things that just make it more complex than it should be.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Friday, 14 March 2014 03:26:56 UTC

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