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

🏗 Refactor transform-log-asserts #24028

Merged
merged 1 commit into from
Aug 19, 2019

Commits on Aug 17, 2019

  1. Refactor transform-log-asserts

    The only big change here is now we'll try to statically analyze assertions.
    
    - If we're asserting a type and we know that the argument is not of that type, we rewrite to a throw expression
    - Else if we're assertiong truthiness and the argument is falsey, we rewrite to a throw expression
    
    This is to better support stubbed out methods, eg, layers:
    
    ```js
    class Resources {
      layersStuff() {
        devAssert(this.layersEnabled_);
        // lots of code that can be DCE'd when layers is statically disabled
      }
    }
    ```
    jridgewell committed Aug 17, 2019
    Configuration menu
    Copy the full SHA
    cbde1a9 View commit details
    Browse the repository at this point in the history