mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 12:25:59 +08:00
Added RCTInspectorDevServerHelper call in FBReactJSExecutor. Added UTF8StringForSourceURL
Reviewed By: javache Differential Revision: D5246399 fbshipit-source-id: 179ff0b69886c4ff71911fc7b1d3491ff4d5967d
This commit is contained in:
committed by
Facebook Github Bot
parent
c9a39b3bd3
commit
879edf0d05
@@ -48,5 +48,6 @@ struct ValueEncoder<NSArray *> {
|
||||
};
|
||||
|
||||
NSError *tryAndReturnError(const std::function<void()>& func);
|
||||
NSString *deriveSourceURL(NSURL *url);
|
||||
|
||||
} }
|
||||
|
||||
@@ -133,4 +133,16 @@ NSError *tryAndReturnError(const std::function<void()>& func) {
|
||||
}
|
||||
}
|
||||
|
||||
NSString *deriveSourceURL(NSURL *url) {
|
||||
NSString *sourceUrl;
|
||||
if (url.isFileURL) {
|
||||
// Url will contain only path to resource (i.g. file:// will be removed)
|
||||
sourceUrl = url.path;
|
||||
} else {
|
||||
// Url will include protocol (e.g. http://)
|
||||
sourceUrl = url.absoluteString;
|
||||
}
|
||||
return sourceUrl ?: @"";
|
||||
}
|
||||
|
||||
} }
|
||||
|
||||
Reference in New Issue
Block a user