mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
Add 'file://' prefix to sourceURL when loading a script from a file.
Reviewed By: svcscm Differential Revision: D2922108 Pulled By: androidtrunkagent fb-gh-sync-id: d9c98af31e844e3fed2f57a3a4250a6ef5e735a8 shipit-source-id: d9c98af31e844e3fed2f57a3a4250a6ef5e735a8
This commit is contained in:
parent
d96a4ba94d
commit
f2a60a202f
@ -31,7 +31,7 @@ public abstract class JSBundleLoader {
|
||||
if (fileName.startsWith("assets://")) {
|
||||
bridge.loadScriptFromAssets(context.getAssets(), fileName.replaceFirst("assets://", ""));
|
||||
} else {
|
||||
bridge.loadScriptFromFile(fileName, fileName);
|
||||
bridge.loadScriptFromFile(fileName, "file://" + fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -700,9 +700,9 @@ static void loadScriptFromAssets(JNIEnv* env, jobject obj, jobject assetManager,
|
||||
|
||||
env->CallStaticVoidMethod(markerClass, gLogMarkerMethod, env->NewStringUTF("loadScriptFromAssets_read"));
|
||||
if (JniJSModulesUnbundle::isUnbundle(manager, assetNameStr)) {
|
||||
loadApplicationUnbundle(bridge, manager, script, assetNameStr);
|
||||
loadApplicationUnbundle(bridge, manager, script, "file://" + assetNameStr);
|
||||
} else {
|
||||
executeApplicationScript(bridge, script, assetNameStr);
|
||||
executeApplicationScript(bridge, script, "file://" + assetNameStr);
|
||||
}
|
||||
if (env->ExceptionCheck()) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user