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
fix(transformer): optional-catch-binding unused variable side effect #2822
fix(transformer): optional-catch-binding unused variable side effect #2822
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #2822 will not alter performanceComparing Summary
|
…fix_transformer_fix_optional-catch-binding_unsued_variable_side_effect
There are no snapshots updated? |
No the tests on eslint don't consider this so it was passing anyway. |
@Dunqing I can add the appropriate tests to the eslint if you find it relative to oxc. |
I prefer to add the test here. But this is babel repo 😅 https://github.com/babel/babel/blob/f856fc22d05bf886d1a58c5c91490e1af8f90c44/packages/babel-plugin-transform-optional-catch-binding/test/fixtures/optional-catch-bindings |
I agree, We may want to add our set of unit tests on top of esbuild compatibility checks. However, I would add a try-catch-shadow case there when I get the time. Even if we don't rely on it, It would be net positive. |
…ses (#2835) Related to: #2822 (comment) Although `babel` has a lot of test cases, we still need to add edge cases that `babel` doesn't have. This PR will allow us to add out test cases to `/root/oxc/tasks/transform_conformance/tests`. The directory structure is consistent with `babel` For example ```shell # cd /root/oxc/tasks/transform_conformance/tests - babel-transform-plugin–optional-catch-binding - test - fixtures - your tests # add test cases here ```
Before this PR for this given case:
We would've generated this:
This is incorrect, This PR aims to use the
CreateVars
trait in order to ensure the variable uniqueness.Now it would output this: