Remove needless weakSelf from executeApplicationScript

Reviewed By: javache

Differential Revision: D3542798

fbshipit-source-id: bf3fe15c78b55691176aecf209210a6f35f98862
This commit is contained in:
Adam Ernst 2016-07-11 13:14:21 -07:00 committed by Facebook Github Bot 8
parent 8fb6111fa5
commit 5e89baa7a0
1 changed files with 5 additions and 7 deletions

View File

@ -690,25 +690,23 @@ static void installBasicSynchronousHooksOnContext(JSContext *context)
script = nullTerminatedScript; script = nullTerminatedScript;
} }
__weak RCTJSCExecutor *weakSelf = self;
[self executeBlockOnJavaScriptQueue:RCTProfileBlock((^{ [self executeBlockOnJavaScriptQueue:RCTProfileBlock((^{
RCTJSCExecutor *strongSelf = weakSelf; if (!self.isValid) {
if (!strongSelf || !strongSelf.isValid) {
return; return;
} }
[strongSelf->_performanceLogger markStartForTag:RCTPLScriptExecution]; [self->_performanceLogger markStartForTag:RCTPLScriptExecution];
JSValueRef jsError = NULL; JSValueRef jsError = NULL;
RCTJSCWrapper *jscWrapper = strongSelf->_jscWrapper; RCTJSCWrapper *jscWrapper = self->_jscWrapper;
JSStringRef execJSString = jscWrapper->JSStringCreateWithUTF8CString((const char *)script.bytes); JSStringRef execJSString = jscWrapper->JSStringCreateWithUTF8CString((const char *)script.bytes);
JSStringRef bundleURL = jscWrapper->JSStringCreateWithUTF8CString(sourceURL.absoluteString.UTF8String); JSStringRef bundleURL = jscWrapper->JSStringCreateWithUTF8CString(sourceURL.absoluteString.UTF8String);
JSGlobalContextRef ctx = strongSelf->_context.context.JSGlobalContextRef; JSGlobalContextRef ctx = self->_context.context.JSGlobalContextRef;
JSValueRef result = jscWrapper->JSEvaluateScript(ctx, execJSString, NULL, bundleURL, 0, &jsError); JSValueRef result = jscWrapper->JSEvaluateScript(ctx, execJSString, NULL, bundleURL, 0, &jsError);
jscWrapper->JSStringRelease(bundleURL); jscWrapper->JSStringRelease(bundleURL);
jscWrapper->JSStringRelease(execJSString); jscWrapper->JSStringRelease(execJSString);
[strongSelf->_performanceLogger markStopForTag:RCTPLScriptExecution]; [self->_performanceLogger markStopForTag:RCTPLScriptExecution];
if (onComplete) { if (onComplete) {
NSError *error; NSError *error;