Merge pull request #19624 from k7sleeper/fix-bluebird

bluebird: Replaced Thenable by PromiseLike
This commit is contained in:
Nathan Shively-Sanders
2017-09-08 08:55:15 -07:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -590,9 +590,9 @@ Promise.props(Promise.props({ num: 1, str: Promise.resolve('a') })).then(val =>
var propsMapValue: Map<number, string>;
Promise.resolve(new Map<number, string>()).props().then(val => { propsMapValue = val });
Promise.resolve(new Map<number, Promise.Thenable<string>>()).props().then(val => { propsMapValue = val });
Promise.resolve(new Map<number, PromiseLike<string>>()).props().then(val => { propsMapValue = val });
Promise.props(new Map<number, string>()).then(val => { propsMapValue = val });
Promise.props(new Map<number, Promise.Thenable<string>>()).then(val => { propsMapValue = val });
Promise.props(new Map<number, PromiseLike<string>>()).then(val => { propsMapValue = val });
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@@ -46,7 +46,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
* Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
*/
// Based on PromiseLike.then, but returns a Bluebird instance.
then<U>(onFulfill?: (value: R) => U | Bluebird.Thenable<U>, onReject?: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U>; // For simpler signature help.
then<U>(onFulfill?: (value: R) => U | PromiseLike<U>, onReject?: (error: any) => U | PromiseLike<U>): Bluebird<U>; // For simpler signature help.
then<TResult1 = R, TResult2 = never>(onfulfilled?: ((value: R) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Bluebird<TResult1 | TResult2>;
/**
@@ -620,7 +620,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
/**
* Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
props<K, V>(this: PromiseLike<Map<K, Bluebird.Thenable<V> | V>>): Bluebird<Map<K, V>>;
props<K, V>(this: PromiseLike<Map<K, PromiseLike<V> | V>>): Bluebird<Map<K, V>>;
props<T>(this: PromiseLike<Bluebird.ResolvableProps<T>>): Bluebird<T>;
/**