Skip to content

Commit 66f6285

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
Remove unused exception parameter from ../xplat/js/react-native-github/packages/react-native/React/CxxModule/RCTCxxUtils.mm (facebook#54573)
Summary: Pull Request resolved: facebook#54573 `-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it. This: ``` try { ... } catch (exception& e) { // no use of e } ``` should instead be written as ``` } catch (exception&) { ``` If the code compiles, this is safe to land. Reviewed By: dtolnay Differential Revision: D87273133 fbshipit-source-id: eb27f9e0be8e5b6a41aa4a9d0af88ef64381fe15
1 parent 4bf8204 commit 66f6285

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/react-native/React/CxxModule/RCTCxxUtils.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
return nil;
6969
} @catch (NSException *exception) {
7070
return RCTErrorWithNSException(exception);
71-
} @catch (id exception) {
71+
} @catch (id) {
7272
// This will catch any other ObjC exception, but no C++ exceptions
7373
return RCTErrorWithMessage(@"non-std ObjC Exception");
7474
}

packages/react-native/ReactAndroid/src/main/jni/react/tracing/PerformanceTracerCxxInterop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ jint PerformanceTracerCxxInterop::subscribeToTracingStateChanges(
200200
onTracingStateChangedMethod(
201201
callback, static_cast<jboolean>(isTracing));
202202
});
203-
} catch (const std::exception& e) {
203+
} catch (const std::exception&) {
204204
}
205205
}
206206
});

packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ TEST_P(JSITest, MicrotasksTest) {
14551455
EXPECT_EQ(
14561456
rt.global().getProperty(rt, "globalValue").asString(rt).utf8(rt),
14571457
"hello world");
1458-
} catch (const JSINativeException& ex) {
1458+
} catch (const JSINativeException&) {
14591459
// queueMicrotask() is unimplemented by some runtimes, ignore such failures.
14601460
}
14611461
}
@@ -1550,7 +1550,7 @@ TEST_P(JSITest, ArrayBufferSizeTest) {
15501550
try {
15511551
// Ensure we can safely write some data to the buffer.
15521552
memset(ab.data(rt), 0xab, 10);
1553-
} catch (const JSINativeException& ex) {
1553+
} catch (const JSINativeException&) {
15541554
// data() is unimplemented by some runtimes, ignore such failures.
15551555
}
15561556

0 commit comments

Comments
 (0)