From 5f6054452b52cc7c76a126486fa5e082f529472d Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 13 May 2019 12:18:07 +0800 Subject: [PATCH] fix #380 --- src/core/helpers/promise.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/helpers/promise.js b/src/core/helpers/promise.js index 368bed232..59f1087f5 100644 --- a/src/core/helpers/promise.js +++ b/src/core/helpers/promise.js @@ -55,9 +55,9 @@ export function promisify (name, api) { api(Object.assign({}, options, { success: resolve, fail: reject - }), ...params) - if (!Promise.prototype.finally) { - /* eslint-disable no-extend-native */ + }), ...params) + /* eslint-disable no-extend-native */ + try { Promise.prototype.finally = function (callback) { const promise = this.constructor return this.then( @@ -67,7 +67,7 @@ export function promisify (name, api) { }) ) } - } + } catch (e) {} })) } } -- GitLab