Bind methods instead of using eval

Reviewed By: astreet

Differential Revision: D3417452

fbshipit-source-id: 437daa2dfcd01efb749465a94c1a72ce8a2cb315
This commit is contained in:
Alexander Blom
2016-06-21 10:08:31 -07:00
committed by Facebook Github Bot 0
parent cd542f0656
commit d63d4f0e9c
9 changed files with 101 additions and 49 deletions

View File

@@ -11,6 +11,9 @@ package com.facebook.react.cxxbridge;
import android.content.Context;
import com.facebook.react.devsupport.DebugServerException;
import com.facebook.react.devsupport.DevServerHelper;
/**
* A class that stores JS bundle information and allows {@link CatalystInstance} to load a correct
* bundle through {@link ReactBridge}.
@@ -55,7 +58,11 @@ public abstract class JSBundleLoader {
return new JSBundleLoader() {
@Override
public void loadScript(CatalystInstanceImpl instance) {
instance.loadScriptFromFile(cachedFileLocation, sourceURL);
try {
instance.loadScriptFromFile(cachedFileLocation, sourceURL);
} catch (Exception e) {
throw DebugServerException.makeGeneric(e.getMessage(), e);
}
}
@Override