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

feat: mangle Infinity #1385

Merged
merged 5 commits into from
Jun 24, 2021
Merged

feat: mangle Infinity #1385

merged 5 commits into from
Jun 24, 2021

Commits on Jun 19, 2021

  1. feat: mangle Infinity

    This change will shave some bytes when the code is using `Infinity`. The ECMA definition of divide can return (-)Infinity based of the second value in specif when it's zero. And based on the first value it will be positive or negative. See: https://tc39.es/ecma262/#sec-numeric-types-number-divide
    
    It should be a small change and not break any code. And any existing code should play along nice 
    
    Simplified
    ```js
    Infinity**2
    1/0**2
    ```
    Hereby ** has priority over the `/` and could break the code, but now it's nice about `1` and `0` they won't change at all, doesn't matter which expressions you try to use with which numbers.
    
    And `1` could be set to 0 with
    ```js
    0 * 1/0
    0 * Infinity
    ```
    But in both cases printed NaN like it should behave. 
    
    Regards,
    Gusted
    Gusted committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    b626064 View commit details
    Browse the repository at this point in the history
  2. Add example code in Changelog.MD

    Gusted committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    5f4b5fe View commit details
    Browse the repository at this point in the history
  3. Update CHANGELOG.md

    Co-authored-by: Darien Maillet Valentine <[email protected]>
    Gusted and bathos authored Jun 19, 2021
    Configuration menu
    Copy the full SHA
    046fafd View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2021

  1. Configuration menu
    Copy the full SHA
    5cada16 View commit details
    Browse the repository at this point in the history
  2. fix correctness issues

    evanw committed Jun 24, 2021
    Configuration menu
    Copy the full SHA
    7764a2a View commit details
    Browse the repository at this point in the history