From df59d9f5b956d2ed2aa36e4d2c081f6567143b54 Mon Sep 17 00:00:00 2001 From: kimu_shu Date: Sat, 1 Jul 2017 12:23:19 +0900 Subject: [PATCH] Accept PromiseLike object --- types/promise.prototype.finally/index.d.ts | 2 +- .../promise.prototype.finally-tests.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/promise.prototype.finally/index.d.ts b/types/promise.prototype.finally/index.d.ts index 9df993ce93..cc50669344 100644 --- a/types/promise.prototype.finally/index.d.ts +++ b/types/promise.prototype.finally/index.d.ts @@ -5,7 +5,7 @@ declare global { interface Promise { - finally(onFinally?: () => U | Promise): Promise; + finally(onFinally?: () => U | PromiseLike): Promise; } } diff --git a/types/promise.prototype.finally/promise.prototype.finally-tests.ts b/types/promise.prototype.finally/promise.prototype.finally-tests.ts index b7f5848606..b28a64b10d 100644 --- a/types/promise.prototype.finally/promise.prototype.finally-tests.ts +++ b/types/promise.prototype.finally/promise.prototype.finally-tests.ts @@ -7,6 +7,7 @@ var promise = new Promise((resolve, reject) => { }); promise.finally(() => {}); +promise.finally(() => >Promise.resolve()); promise.then(() => {}, () => {}).finally(() => {}); promise.catch(() => {}).finally(() => {});