[DevTools] Check if Proxy exists before creating DispatcherProxy (#25278)

This commit is contained in:
Tianyu Yao
2022-09-16 11:24:03 -07:00
committed by GitHub
parent 8951c5fc9d
commit 6e3bc8a2e8
+5 -1
View File
@@ -367,7 +367,11 @@ const DispatcherProxyHandler = {
},
};
const DispatcherProxy = new Proxy(Dispatcher, DispatcherProxyHandler);
// `Proxy` may not exist on some platforms
const DispatcherProxy =
typeof Proxy === 'undefined'
? Dispatcher
: new Proxy(Dispatcher, DispatcherProxyHandler);
// Inspect