mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-21 02:26:18 +08:00
Remove unused onNativeException delegate method
Reviewed By: mhorowitz Differential Revision: D4597914 fbshipit-source-id: 82a109d1e6d8b0c93380840c22ec74dc75ab1a45
This commit is contained in:
committed by
Facebook Github Bot
parent
d7b37c4050
commit
73e81b87d3
@@ -132,7 +132,6 @@ private:
|
||||
- (instancetype)initWithParentBridge:(RCTBridge *)bridge;
|
||||
- (void)partialBatchDidFlush;
|
||||
- (void)batchDidComplete;
|
||||
- (void)handleError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
@@ -146,9 +145,6 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||
}
|
||||
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 class CatalystInstanceImpl implements CatalystInstance {
|
||||
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 @@ import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user