[RCTConvert] Sort mapping keys alphabetically in RCTLogError

Summary:

Closes https://github.com/facebook/react-native/pull/1679
Github Author: Christopher Dro <hello@blick-labs.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
Christopher Dro 2015-06-24 09:47:48 -07:00
parent 3c72250a1a
commit 5614a04cba
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ NSNumber *RCTConvertEnumValue(const char *typeName, NSDictionary *mapping, NSNum
}
id value = mapping[json];
if (!value && [json description].length > 0) {
RCTLogError(@"Invalid %s '%@'. should be one of: %@", typeName, json, [mapping allKeys]);
RCTLogError(@"Invalid %s '%@'. should be one of: %@", typeName, json, [[mapping allKeys] sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)]);
}
return value ?: defaultValue;
}