react-native
react-native copied to clipboard
Lift console method bodies out of installConsoleHandler
Summary: Changelog: [Internal]
The bodies of all console methods are currently written as lambdas within installConsoleHandler but actually capture nothing meaningful from that scope. This diff rewrites them as free functions instead.
To enable the "forwarding console methods" to be written as free functions, we also replace the runtime loop over kForwardingConsoleMethods with a compile-time equivalent using macros. (This technique is inspired by the Hermes source code, which uses it heavily for compile-time code generation.)
Differential Revision: D56679956
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 19,428,570 | -16,370 |
| android | hermes | armeabi-v7a | n/a | -- |
| android | hermes | x86 | n/a | -- |
| android | hermes | x86_64 | n/a | -- |
| android | jsc | arm64-v8a | 22,801,481 | -16,388 |
| android | jsc | armeabi-v7a | n/a | -- |
| android | jsc | x86 | n/a | -- |
| android | jsc | x86_64 | n/a | -- |
Base commit: 8689f563ed8ed8c25b73f980927e323909e6673a Branch: main