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 .throws operator #17575

Closed
wants to merge 1 commit into from

Conversation

BridgeAR
Copy link
Member

@BridgeAR BridgeAR commented Dec 9, 2017

assert.throws and assert.doesNotThrow set the operator to a
internal function. That was actually not intended as the operator
is not defined at all in those cases.

CI https://ci.nodejs.org/job/node-test-pull-request/12003/

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

assert

@nodejs-github-bot nodejs-github-bot added the assert Issues and PRs related to the assert subsystem. label Dec 9, 2017
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI is OK

@BridgeAR
Copy link
Member Author

While thinking about it again and before I merge it - one alternative would be to use throws or doesNotThrow as operator here. Even though it strictly does not have the same meaning as the other operators and it would be semver-minor in that case as the property did not exist before.
@Trott @cjihrig what do you think?

@Trott
Copy link
Member

Trott commented Dec 13, 2017

@Trott @cjihrig what do you think?

Offhand, I have no strong opinion. @cjihrig ?

@cjihrig
Copy link
Contributor

cjihrig commented Dec 13, 2017

No strong opinion.

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".
@BridgeAR BridgeAR force-pushed the fix-assert-operator branch from 20878e3 to b3da103 Compare December 15, 2017 20:33
@BridgeAR
Copy link
Member Author

I decided to add the operator. In case a error is caught it is immediately clear what function triggered the error by looking the operator in that case.

@BridgeAR
Copy link
Member Author

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 15, 2017
@BridgeAR
Copy link
Member Author

Landed in a6788b4

@BridgeAR BridgeAR closed this Dec 15, 2017
BridgeAR added a commit to BridgeAR/node that referenced this pull request Dec 15, 2017
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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 29, 2017
MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
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: #17575
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
@MylesBorins
Copy link
Contributor

should this be backported? My gut is saying no, but I'm not 100%

@MylesBorins

This comment has been minimized.

@MylesBorins
Copy link
Contributor

ping re: backport

@MylesBorins
Copy link
Contributor

ping @BridgeAR

BridgeAR added a commit to BridgeAR/node that referenced this pull request Oct 2, 2018
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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 31, 2018
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".

Backport-PR-URL: #23223
PR-URL: #17575
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
@BethGriggs BethGriggs mentioned this pull request Nov 12, 2018
@BridgeAR BridgeAR deleted the fix-assert-operator branch April 1, 2019 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants