Skip to content

Commit 73e81b8

Browse files
javachefacebook-github-bot
authored andcommitted
Remove unused onNativeException delegate method
Reviewed By: mhorowitz Differential Revision: D4597914 fbshipit-source-id: 82a109d1e6d8b0c93380840c22ec74dc75ab1a45
1 parent d7b37c4 commit 73e81b8

File tree

6 files changed

+0
-27
lines changed

6 files changed

+0
-27
lines changed

React/CxxBridge/RCTCxxBridge.mm

-4
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ @interface RCTCxxBridge ()
132132
- (instancetype)initWithParentBridge:(RCTBridge *)bridge;
133133
- (void)partialBatchDidFlush;
134134
- (void)batchDidComplete;
135-
- (void)handleError:(NSError *)error;
136135

137136
@end
138137

@@ -146,9 +145,6 @@ void onBatchComplete() override {
146145
}
147146
void incrementPendingJSCalls() override {}
148147
void decrementPendingJSCalls() override {}
149-
void onNativeException(const std::string &what) override {
150-
[bridge_ handleError:RCTErrorWithMessage(@(what.c_str()))];
151-
}
152148
ExecutorToken createExecutorToken() override {
153149
return ExecutorToken(std::make_shared<PlatformExecutorToken>());
154150
}

ReactAndroid/src/main/java/com/facebook/react/cxxbridge/CatalystInstanceImpl.java

-8
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,6 @@ public void decrementPendingJSCalls() {
168168
impl.decrementPendingJSCalls();
169169
}
170170
}
171-
172-
@Override
173-
public void onNativeException(Exception e) {
174-
CatalystInstanceImpl impl = mOuter.get();
175-
if (impl != null) {
176-
impl.onNativeException(e);
177-
}
178-
}
179171
}
180172

181173
private native void initializeBridge(

ReactAndroid/src/main/java/com/facebook/react/cxxbridge/ReactCallback.java

-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,4 @@
2121

2222
@DoNotStrip
2323
void decrementPendingJSCalls();
24-
25-
@DoNotStrip
26-
void onNativeException(Exception e);
2724
}

ReactAndroid/src/main/jni/xreact/jni/CatalystInstanceImpl.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,6 @@ class JInstanceCallback : public InstanceCallback {
7171
method(jobj_);
7272
}
7373

74-
void onNativeException(const std::string& what) override {
75-
static auto exCtor =
76-
Exception::javaClassStatic()->getConstructor<Exception::javaobject(jstring)>();
77-
static auto method =
78-
ReactCallback::javaClassStatic()->getMethod<void(Exception::javaobject)>("onNativeException");
79-
80-
method(jobj_, Exception::javaClassStatic()->newObject(
81-
exCtor, jni::make_jstring(what).get()).get());
82-
}
83-
8474
ExecutorToken createExecutorToken() override {
8575
auto jobj = JExecutorToken::newObjectCxxArgs();
8676
return jobj->cthis()->getExecutorToken(jobj);

ReactCommon/cxxreact/CxxNativeModule.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ void CxxNativeModule::invoke(ExecutorToken token, unsigned int reactMethodId, fo
133133
try {
134134
method.func(std::move(params), first, second);
135135
} catch (const facebook::xplat::JsArgumentException& ex) {
136-
// This ends up passed to the onNativeException callback.
137136
throw;
138137
} catch (...) {
139138
// This means some C++ code is buggy. As above, we fail hard so the C++

ReactCommon/cxxreact/Instance.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ struct InstanceCallback {
1919
virtual void onBatchComplete() = 0;
2020
virtual void incrementPendingJSCalls() = 0;
2121
virtual void decrementPendingJSCalls() = 0;
22-
virtual void onNativeException(const std::string& what) = 0;
2322
virtual ExecutorToken createExecutorToken() = 0;
2423
virtual void onExecutorStopped(ExecutorToken) = 0;
2524
};

0 commit comments

Comments
 (0)