Skip to main content

Bug Tracker

Side navigation

#11395 closed enhancement (wontfix)

Opened February 26, 2012 10:33PM UTC

Closed February 27, 2012 02:00AM UTC

Last modified January 19, 2013 04:58AM UTC

Promises should use the term "fulfilled" instead of "resolved"

Reported by: trevorburnham@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc: jaubourg
Blocked by: Blocking:
Description

I had a discussion with Promises/A spec co-creator Kris Kowal recently, who blames himself for misusing the words "resolved" and "rejected" in a way that later came to be adopted by jQuery.

Currently, jQuery Promises transition from their initial *pending* state into either a *resolved* state (when the Deferred's resolve() method is called) or a *rejected* state (when the Deferred's rejected() method is called). There's no good term for a Promise that's been either resolved or rejected ("non-pending"?).

In the Promises/A spec and its implementations, what jQuery calls the *resolved* state is instead called *fulfilled*, and a Promise is said to be "resolved" when it's either fulfilled or rejected.

I would suggest that jQuery move in this direction by deprecating the resolve() method in favor of an alias named fulfill(), just as complete() was renamed to always(). Since this wouldn't affect backward-compatibility, it could be done immediately. In 1.8, the string returned by the state() method could be changed from "resolved" to "fulfilled", and the documentation could be updated to use the new terminology.

This would, in my view, greatly reduce confusion in the long term. I don't really care about jQuery deviating from the Promises/A spec (notably with then(); see #11010), but I do care about good terminology. To my mind, it makes a lot of sense to have two dichotomies: fulfilled vs. rejected, and pending vs. resolved.

Attachments (0)
Change History (6)

Changed February 27, 2012 02:00AM UTC by rwaldron comment:1

resolution: → wontfix
status: newclosed

This is just more surface area that is unnec. I'm going to close this as wont fix - if @jaubourg deems it highly important, he can re-open it.

Changed February 27, 2012 03:18AM UTC by dmethvin comment:2

When the co-creator of Unix, Ken Thompson, was once asked what he would change about the OS, he supposedly said, "I would spell creat() with an 'e'." So Kris Kowal is in great company.

To me, #11010 is *very* important because we need to interoperate with other implementations.

Changed February 27, 2012 03:22PM UTC by dmethvin comment:3

cc: → jaubourg

Changed April 25, 2012 11:55PM UTC by domenic@domenicdenicola.com comment:4

+1, this is getting confusing with other libraries.

Changed January 19, 2013 12:16AM UTC by anonymous comment:5

+1 it make more sense to fulfil a promise. How soon can this bug be resolved?

Changed January 19, 2013 04:58AM UTC by mikesherov comment:6

Thanks for contributing, but bumping doesn't change the resolution. It's not going to be resolved. That's why it's marked as wontfix :-)