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

assert: fix single assert first line #21626

Closed
wants to merge 1 commit into from

Commits on Jul 13, 2018

  1. assert: improve simple assert

    1) If simple assert is called in the very first line of a file and
    it causes an error, it used to report the wrong code. The reason
    is that the column that is reported is faulty. This is fixed by
    subtracting the offset from now on in such cases.
    
    2) The actual code read is now limited to the part that is actually
    required to visualize the call site. All other code in e.g. minified
    files will not cause a significant overhead anymore.
    
    3) The number of allocations is now significantly lower than it used
    to be. The buffer is reused until the correct line in the code is
    found. In general the algorithm tries to safe operations where
    possible.
    
    4) The indentation is now corrected depending on where the statement
    actually beginns.
    
    5) It is now possible to handle `.call()` and `.apply()` properly.
    
    6) The user defined function name will now always be used instead of
    only choosing either `assert.ok()` or `assert()`.
    BridgeAR committed Jul 13, 2018
    Configuration menu
    Copy the full SHA
    b8fb486 View commit details
    Browse the repository at this point in the history