Skip to content

Updated ES6 declarations for Promise, updated baselines#2982

Merged
rbuckton merged 10 commits into
masterfrom
fixPromiseDeclaration
May 2, 2015
Merged

Updated ES6 declarations for Promise, updated baselines#2982
rbuckton merged 10 commits into
masterfrom
fixPromiseDeclaration

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

@rbuckton rbuckton commented May 1, 2015

Updated typings for Promise in ES6. Fixes #2934

Comment thread src/lib/es6.d.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be Thenable<T>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have not done the "I" prefix before.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the Promise/A+ specification, a "thenable" is any object with a callable "then". A "promise" is a "thenable" that conforms to the Promise/A+ specification. In the async functions prototype, I use the Thenable interface for type checking a thing that is not a promise.

I think a better interface name is PromiseLike, similar to our ArrayLike.

rbuckton added a commit that referenced this pull request May 2, 2015
Updated ES6 declarations for Promise, updated baselines
@rbuckton rbuckton merged commit 1625a6c into master May 2, 2015
@rbuckton rbuckton deleted the fixPromiseDeclaration branch May 2, 2015 00:11
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promise typing incompatible between ES5 and ES6 emit

3 participants