-
Notifications
You must be signed in to change notification settings - Fork 25k
fix(codegen): ensure unique c++ variable names to avoid collision for properties with the same name #53852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
${properyName}_${idx} pattern for naming variables to avoid using same variable for different properties
...gen/e2e/deep_imports/__tests__/components/__snapshots__/GenerateEventEmitterCpp-test.js.snap
Outdated
Show resolved
Hide resolved
|
Thanks for the fix! Could we make this even more explicit by using variable names such as |
cc @mfazekas |
Just to clarify if name is |
796d4cb to
6ce639b
Compare
Summary:
Fixes: #53839
Codegen uses object propertyNames as variable names. This breaks if the same property names appears at multiple levels. Also breaks if a property is called
payloadas payload is a variable name already used.Before the fix codegen could generate code like this:
Changelog:
[GENERAL] [FIXED] - Fix Codegen to use unique variable names to avoid name collisions in corner cases
Test Plan: