mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
898f73deef
Summary: In the Codegen, we need to answer the following questions: *Question:* What are all the calls into TurboModuleRegistry? *Answer:* Find all CallExpressions that represent TurboModuleRegistry.get<Spec>() or TurboModuleRegisty.getEnforcing<Spec>(). *Question:* Is this a component spec? *Answer:* Does this spec have a CallExpression where the callee is 'codegenNativeComponent'? *Question:* Is this a module spec? *Answer:* Does this spec have an interface that extends TurboModule? All these answers can be implemented using the visitor pattern. Hence, this diff introduces the `visit` utility, and uses it to answer these questions. **Motivation:** Cleaner code. Changelog: [Internal] Reviewed By: hramos Differential Revision: D25162617 fbshipit-source-id: 66ec95fc07ecb29aa9bf9993cb826204af283d03