From f53c95c743f32d786560a1ceee7c25c239ae4ffa Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Tue, 28 Jul 2015 05:58:01 -0700 Subject: [PATCH] [ReactNative] Proxy bundleURL on RCTBatchedBridge Summary: Fixes #2126 `RCTBatchedBridge` didn't implement `bundleURL`, that was available on the public bridge interface, so it'd always be `nil`, and setting it would just be ignored. --- React/Base/RCTBatchedBridge.m | 10 ++++++++++ React/Base/RCTBridge.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index f04acd298..7c9549b22 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -146,6 +146,16 @@ RCT_NOT_IMPLEMENTED(-initWithBundleURL:(__unused NSURL *)bundleURL _parentBridge.executorClass = executorClass; } +- (NSURL *)bundleURL +{ + return _parentBridge.bundleURL; +} + +- (void)setBundleURL:(NSURL *)bundleURL +{ + _parentBridge.bundleURL = bundleURL; +} + - (BOOL)isLoading { return _loading; diff --git a/React/Base/RCTBridge.h b/React/Base/RCTBridge.h index f12f26158..72f34ae70 100644 --- a/React/Base/RCTBridge.h +++ b/React/Base/RCTBridge.h @@ -93,7 +93,7 @@ RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass); /** * URL of the script that was loaded into the bridge. */ -@property (nonatomic, copy) NSURL *bundleURL; +@property (nonatomic, strong) NSURL *bundleURL; @property (nonatomic, strong) Class executorClass;