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

[v8.x] backport some assert commits #23223

Closed
wants to merge 8 commits into from

Commits on Oct 2, 2018

  1. assert: add strict functionality export

    Requireing the strict version will allow to use `assert.equal`,
    `assert.deepEqual` and there negated counterparts to be used with
    strict comparison instead of using e.g. `assert.strictEqual`.
    
    The API is identical to the regular assert export and only differs
    in the way that all functions use strict compairson.
    
    PR-URL: nodejs#17002
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    BridgeAR committed Oct 2, 2018
    Copy the full SHA
    9886376 View commit details
    Browse the repository at this point in the history
  2. assert: fix .throws operator

    assert.throws and assert.doesNotThrow set the operator to a
    internal function. That was by accident and originally the operator
    was undefined. This changes it to show "throws" or "doesNotThrow".
    
    PR-URL: nodejs#17575
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    BridgeAR committed Oct 2, 2018
    Copy the full SHA
    14ee8be View commit details
    Browse the repository at this point in the history
  3. assert: use object argument in innerFail

    Right now it is difficult to know what argument stands for what
    property. By refactoring the arguments into a object it is clear
    what stands for what.
    
    PR-URL: nodejs#17582
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Jon Moss <me@jonathanmoss.me>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    BridgeAR committed Oct 2, 2018
    Copy the full SHA
    c947fe7 View commit details
    Browse the repository at this point in the history
  4. assert: fix throws and doesNotThrow stack frames

    The stack frames from .throws and .doesNotThrow got included
    even though that was not intended.
    
    PR-URL: nodejs#17703
    Reviewed-By: Timothy Gu <timothygu99@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    BridgeAR committed Oct 2, 2018
    Copy the full SHA
    a262ffa View commit details
    Browse the repository at this point in the history
  5. assert: improve assert.throws

    Throw a TypeError in case a error message is provided in the second
    argument and a third argument is present as well.
    This is clearly a mistake and should not be done.
    
    PR-URL: nodejs#17585
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
    Reviewed-By: Evan Lucas <evanlucas@me.com>
    BridgeAR committed Oct 2, 2018
    Copy the full SHA
    ac8c99a View commit details
    Browse the repository at this point in the history
  6. assert: .throws accept objects

    From now on it is possible to use a validation object in throws
    instead of the other possibilites.
    
    PR-URL: nodejs#17584
    Refs: nodejs#17557
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Ron Korving <ron@ronkorving.nl>
    Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
    BridgeAR committed Oct 2, 2018
    Copy the full SHA
    f656075 View commit details
    Browse the repository at this point in the history
  7. assert: fix strict regression

    Using `assert()` or `assert.ok()` resulted in a error since a
    refactoring.
    
    Refs: nodejs#17582
    
    PR-URL: nodejs#17903
    Refs: nodejs#17582
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Tobias Nießen <tniessen@tnie.de>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    BridgeAR committed Oct 2, 2018
    Copy the full SHA
    025d7de View commit details
    Browse the repository at this point in the history
  8. assert: fix throws trace

    The current stack trace thrown in case `assert.throws(fn, object)`
    is used did not filter the stack trace. This fixes it.
    
    PR-URL: nodejs#18595
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    BridgeAR committed Oct 2, 2018
    Copy the full SHA
    dcfda69 View commit details
    Browse the repository at this point in the history