Repository navigation
Commit ebc180e
authored
Stop naming C++ TurboModule invokers with reserved identifiers
## Summary:
The C++ spec header generated for a C++ TurboModule names each method's static invoker `__<method>` and registers it under that name in `methodMap_`. Names starting with a double underscore are reserved in C++, so a library that builds with `-Wreserved-identifier` under `-Werror` can't include its own generated `<Module>JSI.h`. The invokers are now named `invoke_<method>`. They are private to the spec class, and the `methodMap_` keys, arity and calls into the module stay the same.
Fixes #59843
## Changelog:
[GENERAL] [FIXED] - C++ TurboModule codegen no longer names method invokers with reserved identifiers
## Test Plan:
Updated the `GenerateModuleH` snapshots; `jest packages/react-native-codegen` passes. clang++ with `-Werror -Wreserved-identifier` rejects `__add` and accepts `invoke_add`.
Differential Revision: D132179193
Pull Request resolved: #598441 parent 333a401 commit ebc180e
3 files changed
Lines changed: 540 additions & 540 deletions
File tree
- packages/react-native-codegen
- e2e/deep_imports/__tests__/modules/__snapshots__
- src/generators/modules
- __tests__/__snapshots__
0 commit comments