From 8d852210cf8378ac5fe11380b5d1d17f2e5b0968 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 15 Jan 2016 09:48:12 -0800 Subject: [PATCH 1/2] fix bluebird.d.ts promise.delay() typing: ms is first arg. see http://bluebirdjs.com/docs/api/promise.delay.html --- bluebird/bluebird.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 023eab7aa..2dfdcf854 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -106,8 +106,8 @@ interface PromiseConstructor { * Returns a promise that will be fulfilled with `value` (or `undefined`) after given `ms` milliseconds. If `value` is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the `value` promise. */ // TODO enable more overloads - delay(value: PromiseLike, ms: number): Promise; - delay(value: T, ms: number): Promise; + delay(ms: number, value: PromiseLike): Promise; + delay(ms: number, value: T): Promise; delay(ms: number): Promise; /** From 82a2b628a36a0d66d1c8623a51cca07899f1a187 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 15 Jan 2016 10:13:52 -0800 Subject: [PATCH 2/2] fix bluebird test file for proper Promise.delay() parameter order. --- bluebird/bluebird-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index b1829c52e..00f6e951f 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -754,8 +754,8 @@ Promise.longStackTraces(); //TODO enable delay -fooProm = Promise.delay(fooThen, num); -fooProm = Promise.delay(foo, num); +fooProm = Promise.delay(num, fooThen); +fooProm = Promise.delay(num, foo); voidProm = Promise.delay(num); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -