Permalink
Browse files

Replace valueForKey with subscript access in RCTJavascriptLoader

Reviewed By: shergin

Differential Revision: D4559391

fbshipit-source-id: 44cb4900f93f2ac60dae3a461ed5344e1af08f3b
  • Loading branch information...
javache authored and facebook-github-bot committed Feb 15, 2017
1 parent a965f15 commit a2000d120069f9a9ee60e4a92ab8fc209333e584
Showing with 6 additions and 7 deletions.
  1. +6 −7 React/Base/RCTJavaScriptLoader.mm
@@ -230,7 +230,7 @@ static void attemptAsynchronousLoadOfBundleAtURL(NSURL *scriptURL, RCTSourceLoad
// For multipart responses packager sets X-Http-Status header in case HTTP status code
// is different from 200 OK
NSString *statusCodeHeader = [headers valueForKey:@"X-Http-Status"];
NSString *statusCodeHeader = headers[@"X-Http-Status"];
if (statusCodeHeader) {
statusCode = [statusCodeHeader integerValue];
}
@@ -263,9 +263,9 @@ static void attemptAsynchronousLoadOfBundleAtURL(NSURL *scriptURL, RCTSourceLoad
}
RCTLoadingProgress *progress = [RCTLoadingProgress new];
progress.status = [info valueForKey:@"status"];
progress.done = [info valueForKey:@"done"];
progress.total = [info valueForKey:@"total"];
progress.status = info[@"status"];
progress.done = info[@"done"];
progress.total = info[@"total"];
return progress;
}
@@ -281,12 +281,11 @@ static void attemptAsynchronousLoadOfBundleAtURL(NSURL *scriptURL, RCTSourceLoad
}
NSMutableArray<NSDictionary *> *fakeStack = [NSMutableArray new];
for (NSDictionary *err in errors) {
[fakeStack addObject:
@{
[fakeStack addObject: @{
@"methodName": err[@"description"] ?: @"",
@"file": err[@"filename"] ?: @"",
@"lineNumber": err[@"lineNumber"] ?: @0
}];
}];
}
return @{NSLocalizedDescriptionKey: parsedResponse[@"message"] ?: @"No message provided", @"stack": [fakeStack copy]};
}

0 comments on commit a2000d1

Please sign in to comment.