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 closure compiler type casts #5947

Merged
merged 7 commits into from
Apr 26, 2019
Merged

Commits on Apr 26, 2019

  1. Fix closure compiler type casts

    This fixes casts when they are followed by a closing parenthesis, eg:
    
    ```js
    foo( /** @type {!Array} */(arrOrString).length );
    ```
    
    The old code would see the `CallExpresion`'s closing `)` and assume the typecast belonged to the `MemberExpression`, not the `arrOrString` `Identifier`.
    
    This would be easier to accomplish if every AST would tell us if the expression were parenthesized. If they did, we could check that the node were parenthesized and either it or an ancestor has a typecast, stopping when we find an ancestor is itself parenthesized.
    jridgewell committed Apr 26, 2019
    Configuration menu
    Copy the full SHA
    2a9f1ec View commit details
    Browse the repository at this point in the history
  2. More tests, and changelog

    jridgewell committed Apr 26, 2019
    Configuration menu
    Copy the full SHA
    faae650 View commit details
    Browse the repository at this point in the history
  3. Fix while loop

    jridgewell committed Apr 26, 2019
    Configuration menu
    Copy the full SHA
    4efc7de View commit details
    Browse the repository at this point in the history
  4. Update changelog

    jridgewell committed Apr 26, 2019
    Configuration menu
    Copy the full SHA
    d04d22c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    63cee41 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bdab9f8 View commit details
    Browse the repository at this point in the history
  7. Cleanup call

    jridgewell committed Apr 26, 2019
    Configuration menu
    Copy the full SHA
    b337a54 View commit details
    Browse the repository at this point in the history