Permalink
Browse files

Remove unused onNativeException delegate method

Reviewed By: mhorowitz

Differential Revision: D4597914

fbshipit-source-id: 82a109d1e6d8b0c93380840c22ec74dc75ab1a45
  • Loading branch information...
javache authored and facebook-github-bot committed Mar 17, 2017
1 parent d7b37c4 commit 73e81b87d3df80c406bec4ad0ad40e36531b7594
@@ -132,7 +132,6 @@ @interface RCTCxxBridge ()
- (instancetype)initWithParentBridge:(RCTBridge *)bridge;
- (void)partialBatchDidFlush;
- (void)batchDidComplete;
- (void)handleError:(NSError *)error;
@end
@@ -146,9 +145,6 @@ void onBatchComplete() override {
}
void incrementPendingJSCalls() override {}
void decrementPendingJSCalls() override {}
void onNativeException(const std::string &what) override {
[bridge_ handleError:RCTErrorWithMessage(@(what.c_str()))];
}
ExecutorToken createExecutorToken() override {
return ExecutorToken(std::make_shared<PlatformExecutorToken>());
}
@@ -168,14 +168,6 @@ public void decrementPendingJSCalls() {
impl.decrementPendingJSCalls();
}
}
@Override
public void onNativeException(Exception e) {
CatalystInstanceImpl impl = mOuter.get();
if (impl != null) {
impl.onNativeException(e);
}
}
}
private native void initializeBridge(
@@ -21,7 +21,4 @@
@DoNotStrip
void decrementPendingJSCalls();
@DoNotStrip
void onNativeException(Exception e);
}
@@ -71,16 +71,6 @@ class JInstanceCallback : public InstanceCallback {
method(jobj_);
}
void onNativeException(const std::string& what) override {
static auto exCtor =
Exception::javaClassStatic()->getConstructor<Exception::javaobject(jstring)>();
static auto method =
ReactCallback::javaClassStatic()->getMethod<void(Exception::javaobject)>("onNativeException");
method(jobj_, Exception::javaClassStatic()->newObject(
exCtor, jni::make_jstring(what).get()).get());
}
ExecutorToken createExecutorToken() override {
auto jobj = JExecutorToken::newObjectCxxArgs();
return jobj->cthis()->getExecutorToken(jobj);
@@ -133,7 +133,6 @@ void CxxNativeModule::invoke(ExecutorToken token, unsigned int reactMethodId, fo
try {
method.func(std::move(params), first, second);
} catch (const facebook::xplat::JsArgumentException& ex) {
// This ends up passed to the onNativeException callback.
throw;
} catch (...) {
// This means some C++ code is buggy. As above, we fail hard so the C++
@@ -19,7 +19,6 @@ struct InstanceCallback {
virtual void onBatchComplete() = 0;
virtual void incrementPendingJSCalls() = 0;
virtual void decrementPendingJSCalls() = 0;
virtual void onNativeException(const std::string& what) = 0;
virtual ExecutorToken createExecutorToken() = 0;
virtual void onExecutorStopped(ExecutorToken) = 0;
};

0 comments on commit 73e81b8

Please sign in to comment.