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] test: remove common.noop #14174

Closed
wants to merge 1 commit into from

Commits on Jul 11, 2017

  1. test: remove common.noop

    This change removes `common.noop` from the Node.js internal testing
    common module.
    
    Over the last few weeks, I've grown to dislike the `common.noop`
    abstraction.
    
    First, new (and experienced) contributors are unaware of it and so it
    results in a large number of low-value nits on PRs. It also increases
    the number of things newcomers and infrequent contributors have to be
    aware of to be effective on the project.
    
    Second, it is confusing. Is it a singleton/property or a getter? Which
    should be expected? This can lead to subtle and hard-to-find bugs. (To
    my knowledge, none have landed on master. But I also think it's only a
    matter of time.)
    
    Third, the abstraction is low-value in my opinion. What does it really
    get us? A case could me made that it is without value at all.
    
    Lastly, and this is minor, but the abstraction is wordier than not using
    the abstraction. `common.noop` doesn't save anything over `() => {}`.
    
    So, I propose removing it.
    
    PR-URL: nodejs#12822
    Reviewed-By: Teddy Katz <[email protected]>
    Reviewed-By: Timothy Gu <[email protected]>
    Reviewed-By: Benjamin Gruenbaum <[email protected]>
    Reviewed-By: Gibson Fahnestock <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Refael Ackermann <[email protected]>
    Trott committed Jul 11, 2017
    Configuration menu
    Copy the full SHA
    29505c7 View commit details
    Browse the repository at this point in the history