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://")) {
|
if (fileName.startsWith("assets://")) {
|
||||||
bridge.loadScriptFromAssets(context.getAssets(), fileName.replaceFirst("assets://", ""));
|
bridge.loadScriptFromAssets(context.getAssets(), fileName.replaceFirst("assets://", ""));
|
||||||
} else {
|
} 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"));
|
env->CallStaticVoidMethod(markerClass, gLogMarkerMethod, env->NewStringUTF("loadScriptFromAssets_read"));
|
||||||
if (JniJSModulesUnbundle::isUnbundle(manager, assetNameStr)) {
|
if (JniJSModulesUnbundle::isUnbundle(manager, assetNameStr)) {
|
||||||
loadApplicationUnbundle(bridge, manager, script, assetNameStr);
|
loadApplicationUnbundle(bridge, manager, script, "file://" + assetNameStr);
|
||||||
} else {
|
} else {
|
||||||
executeApplicationScript(bridge, script, assetNameStr);
|
executeApplicationScript(bridge, script, "file://" + assetNameStr);
|
||||||
}
|
}
|
||||||
if (env->ExceptionCheck()) {
|
if (env->ExceptionCheck()) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue