Skip to content
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): the unused binding is not in the correct scope #5066

Commits on Aug 23, 2024

  1. fix(transformer-optional-catch-binding): the unused binding is not …

    …in the correct scope (#5066)
    
    Blocked by #5008
    
    In the SemanticBuilder, we insert all CatchClause parameters in the BlockStatement scope, a child-scope of CatchClause
    
    https://github.com/oxc-project/oxc/blob/858f510d59cb9ea29cca36c31fdf037b0d627f2c/crates/oxc_semantic/src/builder.rs#L709-L718
    
    So we should do the same thing in this plugin, but because CatchClause has no parameters, SemanticBuilder doesn't create scope for `CatchClause`. This cause we cannot find the `BlockStatement` scope_id.
    
    This PR has changed to the correct logic. Just to wait #5008 solved
    Dunqing committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    47e69a8 View commit details
    Browse the repository at this point in the history