Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix when.defer() usage #3152

Merged
merged 1 commit into from
Oct 30, 2015
Merged

Fix when.defer() usage #3152

merged 1 commit into from
Oct 30, 2015

Conversation

mramato
Copy link
Contributor

@mramato mramato commented Oct 30, 2015

It turns out that there are a bunch of places in our code where we use when.defer() and return the deferred instance instead of its promise property. This works in most cases because when's deferred
promises are thenable, however they don't have all of when's API, like always. This change makes sure we correctly return deferred.promise everywhere.

It's probably a quirk of the version of when we are using that defers aren't always-able and always isn't part of the A+ spec, so there's no reason to add additional tests for these.

It turns out that there are a bunch of places in our code where we
use `when.defer()` and return the deferred instance instead of its
`promise` property.  This works in most cases because when's deferred
promises are thenable, however they don't have all of when's API, like
`always`.  This change makes sure we correctly return `deferred.promise`
everywhere.

It's probably a quirk of the version of when we are using
that defers aren't always-able and always isn't part of the A+ spec,
so there's no reason to add additional tests for these.
@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 30, 2015

Do you want this in 1.15? I'm OK either way.

@mramato
Copy link
Contributor Author

mramato commented Oct 30, 2015

There's no reason not to take it, but since you are doing the release, it's your call.

@tfili ran into this for the website model converter updates, but it's trivial to work around too.

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 30, 2015

Looks good.

pjcozzi added a commit that referenced this pull request Oct 30, 2015
@pjcozzi pjcozzi merged commit b407181 into master Oct 30, 2015
@pjcozzi pjcozzi deleted the maybe-not-always branch October 30, 2015 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants