diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index ade461074..440743c03 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -150,6 +150,7 @@ var BlueBird: typeof Promise; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - var nodeCallbackFunc = (callback: (err: any, result: string) => void) => {} +var nodeCallbackFuncErrorOnly = (callback: (err: any) => void) => {} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -678,6 +679,7 @@ func = Promise.promisify(f, obj); obj = Promise.promisifyAll(obj); anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback)); +anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback)); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 878e1051e..67067dc5b 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -426,7 +426,7 @@ declare class Promise implements Promise.Thenable, Promise.Inspection { /** * Returns a promise that is resolved by a node style callback function. */ - static fromNode(resolver: (callback: (err: any, result: any) => void) => void): Promise; + static fromNode(resolver: (callback: (err: any, result?: any) => void) => void): Promise; /** * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch.