File tree 2 files changed +24
-1821
lines changed
2 files changed +24
-1821
lines changed Original file line number Diff line number Diff line change @@ -96,16 +96,25 @@ export const installRDTHook = (
96
96
let hasRanHack = false ;
97
97
objectDefineProperty ( window , 'hasOwnProperty' , {
98
98
value : function ( this : unknown ) {
99
- // biome-ignore lint/style/noArguments: perf
100
- if ( ! hasRanHack && arguments [ 0 ] === '__REACT_DEVTOOLS_GLOBAL_HOOK__' ) {
101
- globalThis . __REACT_DEVTOOLS_GLOBAL_HOOK__ = undefined ;
102
- // special falsy value to know that we've already installed before
103
- hasRanHack = true ;
104
- return - 0 ;
99
+ try {
100
+ if (
101
+ ! hasRanHack &&
102
+ // biome-ignore lint/style/noArguments: perf
103
+ arguments [ 0 ] === '__REACT_DEVTOOLS_GLOBAL_HOOK__'
104
+ ) {
105
+ globalThis . __REACT_DEVTOOLS_GLOBAL_HOOK__ = undefined ;
106
+ // special falsy value to know that we've already installed before
107
+ hasRanHack = true ;
108
+ return - 0 ;
109
+ }
110
+ // biome-ignore lint/suspicious/noExplicitAny: perf
111
+ // biome-ignore lint/style/noArguments: perf
112
+ return originalWindowHasOwnProperty . apply ( this , arguments as any ) ;
113
+ } catch {
114
+ // biome-ignore lint/suspicious/noExplicitAny: perf
115
+ // biome-ignore lint/style/noArguments: perf
116
+ return originalWindowHasOwnProperty . apply ( this , arguments as any ) ;
105
117
}
106
- // biome-ignore lint/suspicious/noExplicitAny: perf
107
- // biome-ignore lint/style/noArguments: perf
108
- return originalWindowHasOwnProperty . apply ( this , arguments as any ) ;
109
118
} ,
110
119
configurable : true ,
111
120
writable : true ,
You can’t perform that action at this time.
0 commit comments