Skip to content

Commit

Permalink
feat: onUnhandledRejection 支持core-js promise polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
mackwang committed Jan 17, 2025
1 parent dc25d11 commit 56fe10d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/platform/env/index.ios.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFunction, isNumber } from '@mpxjs/utils'
import { isFunction, isNumber, isString } from '@mpxjs/utils'
import { createI18n } from '../builtInMixins/i18nMixin'

export function init (Mpx) {
Expand Down Expand Up @@ -37,7 +37,7 @@ function initGlobalErrorHandling () {
cb(event)
})
} else {
console.warn(`UNHANDLED PROMISE REJECTION ${isNumber(event.id) ? '(id:' + event.id + ')' : ''}: ${event.reason}\n`)
console.warn(`UNHANDLED PROMISE REJECTION ${(isNumber(event.id) || isString(event.id)) ? '(id:' + event.id + ')' : ''}: ${event.reason}\n`)
}
}
const rejectionTrackingOptions = {
Expand Down

0 comments on commit 56fe10d

Please sign in to comment.