Removed debug code from release builds

This commit is contained in:
Nick Lockwood
2015-04-21 09:48:29 -07:00
parent 25ae5485da
commit ee898c24c7
17 changed files with 226 additions and 121 deletions

View File

@@ -7,6 +7,10 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTDefines.h"
#if RCT_DEV // Debug executors are only supported in dev mode
#import <UIKit/UIKit.h>
#import "RCTJavaScriptExecutor.h"
@@ -40,3 +44,5 @@
- (UIWebView *)invalidateAndReclaimWebView;
@end
#endif

View File

@@ -7,6 +7,10 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTDefines.h"
#if RCT_DEV // Debug executors are only supported in dev mode
#import "RCTWebViewExecutor.h"
#import <objc/runtime.h>
@@ -188,9 +192,14 @@ static void RCTReportError(RCTJavaScriptCallback callback, NSString *fmt, ...)
asGlobalObjectNamed:(NSString *)objectName
callback:(RCTJavaScriptCompleteBlock)onComplete
{
RCTAssert(!_objectsToInject[objectName],
@"already injected object named %@", _objectsToInject[objectName]);
if (RCT_DEBUG) {
RCTAssert(!_objectsToInject[objectName],
@"already injected object named %@", _objectsToInject[objectName]);
}
_objectsToInject[objectName] = script;
onComplete(nil);
}
@end
#endif