diff --git a/src/core/helpers/promise.js b/src/core/helpers/promise.js index 3a9fad8bf702610a5ced01e50efe46bb6a5b8fc0..59f1087f563eeac8dfa198a79977d121e6a02a57 100644 --- a/src/core/helpers/promise.js +++ b/src/core/helpers/promise.js @@ -56,16 +56,18 @@ export function promisify (name, api) { success: resolve, fail: reject }), ...params) - /* eslint-disable no-extend-native */ - Promise.prototype.finally = function (callback) { - const promise = this.constructor - return this.then( - value => promise.resolve(callback()).then(() => value), - reason => promise.resolve(callback()).then(() => { - throw reason - }) - ) - } + /* eslint-disable no-extend-native */ + try { + Promise.prototype.finally = function (callback) { + const promise = this.constructor + return this.then( + value => promise.resolve(callback()).then(() => value), + reason => promise.resolve(callback()).then(() => { + throw reason + }) + ) + } + } catch (e) {} })) } }