From e195bf9495c5f2cb4d35b2b9f777dcd2464ec5b9 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 28 Apr 2016 06:58:21 -0700 Subject: [PATCH] Fix RCTJavaScriptContextCreatedNotification Summary: The notification was previously sent from a block that only existed if RCT_DEV. This makes us always send this notification. Reviewed By: majak Differential Revision: D3235070 fb-gh-sync-id: bf3488d439bc2253fd12cbb10f670f54bb37eb6e fbshipit-source-id: bf3488d439bc2253fd12cbb10f670f54bb37eb6e --- React/Executors/RCTJSCExecutor.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/React/Executors/RCTJSCExecutor.mm b/React/Executors/RCTJSCExecutor.mm index 276820dfb..b12579a61 100644 --- a/React/Executors/RCTJSCExecutor.mm +++ b/React/Executors/RCTJSCExecutor.mm @@ -270,6 +270,9 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) if (!_context) { JSContext *context = [JSContext new]; _context = [[RCTJavaScriptContext alloc] initWithJSContext:context onThread:_javaScriptThread]; + + [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptContextCreatedNotification + object:context]; } return _context; @@ -413,9 +416,6 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) JSContext *context = strongSelf.context.context; RCTInstallJSCProfiler(_bridge, context.JSGlobalContextRef); - - [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptContextCreatedNotification - object:context]; }]; for (NSString *event in @[RCTProfileDidStartProfiling, RCTProfileDidEndProfiling]) {