From d7e38fd2cdb0a0fa7882f3c39eca27aa78d37326 Mon Sep 17 00:00:00 2001 From: Hein Rutjes Date: Mon, 30 Mar 2020 12:28:32 +0200 Subject: [PATCH] [ios] Fix PerfMonitor crash on iOS 13.4 --- React/Profiler/RCTPerfMonitor.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/React/Profiler/RCTPerfMonitor.m b/React/Profiler/RCTPerfMonitor.m index 1db32322a33b78..7b943c8a0f2bd9 100644 --- a/React/Profiler/RCTPerfMonitor.m +++ b/React/Profiler/RCTPerfMonitor.m @@ -40,6 +40,14 @@ static BOOL RCTJSCSetOption(const char *option) static RCTJSCSetOptionType setOption; static dispatch_once_t onceToken; + // As of iOS 13.4, it is no longer possible to change the JavaScriptCore + // options at runtime. The options are protected and will cause an + // exception when you try to change them after the VM has been initialized. + // https://github.com/facebook/react-native/issues/28414 + if (@available(iOS 13.4, *)) { + return NO; + } + dispatch_once(&onceToken, ^{ /** * JSC private C++ static method to toggle options at runtime