diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 00f6e951f..abbdf6ee2 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -291,9 +291,9 @@ fooProm = fooProm.caught((error: any) => { fooProm = fooProm.catch((reason: any) => { //handle multiple valid return types simultaneously - if (true) { + if (foo === null) { return; - } else if (false) { + } else if (!reason) { return voidProm; } else if (foo) { return foo; diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index d501635d8..7a53d4e07 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -407,8 +407,8 @@ interface Promise extends PromiseLike, Promise.Inspection { /** * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. */ - done(onFulfilled: (value: T) => PromiseLike, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; - done(onFulfilled: (value: T) => U, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; + done(onFulfilled?: (value: T) => PromiseLike, onRejected?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; + done(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; /** * Like `.finally()`, but not called for rejections. @@ -459,7 +459,7 @@ interface Promise extends PromiseLike, Promise.Inspection { /** * Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors. */ - fork(onFulfilled: (value: T) => U | PromiseLike, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): Promise; + fork(onFulfilled?: (value: T) => U | PromiseLike, onRejected?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): Promise; /** * Create an uncancellable promise based on this promise.