File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,13 +87,21 @@ export class ReactNativeErrorHandlers implements Integration {
8787
8888 If the global promise is the same as the imported promise (expected in RN <0.63), we do nothing.
8989 */
90+ const _onHandle = Promise . _onHandle ?? Promise . _Y ;
91+ const _onReject = Promise . _onReject ?? Promise . _Z ;
92+
9093 if (
9194 Promise !== _global . Promise &&
92- "_Y" in _global . Promise &&
93- "_Z" in _global . Promise
95+ typeof _onHandle !== "undefined" &&
96+ typeof _onReject !== "undefined"
9497 ) {
95- _global . Promise . _Y = Promise . _Y ;
96- _global . Promise . _Z = Promise . _Z ;
98+ if ( "_onHandle" in _global . Promise && "_onReject" in _global . Promise ) {
99+ _global . Promise . _onHandle = _onHandle ;
100+ _global . Promise . _onReject = _onReject ;
101+ } else if ( "_Y" in _global . Promise && "_Z" in _global . Promise ) {
102+ _global . Promise . _Y = _onHandle ;
103+ _global . Promise . _Z = _onReject ;
104+ }
97105 }
98106 /* eslint-enable
99107 @typescript -eslint/no-var-requires,
You can’t perform that action at this time.
0 commit comments