This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22357 - Don't special case callable 'then'
Summary: Don't special case callable 'then'
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-13 20:36 UTC by Olli Pettay
Modified: 2013-09-10 12:43 UTC (History)
4 users (show)

See Also:


Attachments

Description Olli Pettay 2013-06-13 20:36:17 UTC
http://dom.spec.whatwg.org/#promises-model would be simpler if
"If JavaScript IsCallable(then) is true, run these substeps and then terminate these steps:" wasn't there, but if 'then' isn't callable, just throw and handle that the same way what would happen if 'then' was callable and throws an exception.
Comment 1 Anne 2013-06-14 06:29:08 UTC
Why would we try to invoke 'then' if it's not callable though? It seems this design might change slightly anyway :/
Comment 2 Anne 2013-09-10 12:43:52 UTC
The reason for doing [[Get]] and checking if it's callable and then [[Call]] rather than just doing [[Invoke]] is because a lot of JavaScript does it that way. We might change some of this though: https://github.com/domenic/promises-unwrapping/issues/25

In any event, this is now out of scope for DOM as the text has moved (temporarily).