Skip to content

assert: support symbols as assertion messages - #20693

Merged
cjihrig merged 1 commit into
nodejs:masterfrom
cjihrig:assert
May 15, 2018
Merged

assert: support symbols as assertion messages#20693
cjihrig merged 1 commit into
nodejs:masterfrom
cjihrig:assert

Conversation

@cjihrig

Copy link
Copy Markdown
Contributor

Currently, assertion messages are implicitly converted to strings, which causes symbols to throw. This commit adds an explicit string conversion.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added the assert Issues and PRs related to the assert subsystem. label May 13, 2018
@lpinca

lpinca commented May 13, 2018

Copy link
Copy Markdown
Member

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

EDIT (cjihrig): For future reference, CI was green.

@lpincalpinca added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 13, 2018
@BridgeAR

Copy link
Copy Markdown
Member

@cjihrig did you run into this and have a actual use case for it? Just curious because I try to find some ways to improve the messages in general a bit more.

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

did you run into this and have a actual use case for it?

I did run into it accidentally. I don't personally have a use case for it, but it seems like a bug for symbols to throw here.

Currently, assertion messages are implicitly converted to strings,
which causes symbols to throw. This commit adds an explicit
string conversion.
PR-URL: nodejs#20693
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@cjihrig
cjihrig merged commit 810af50 into nodejs:masterMay 15, 2018
@cjihrig
cjihrig deleted the assert branch May 15, 2018 03:45
MylesBorins pushed a commit that referenced this pull request May 22, 2018
Currently, assertion messages are implicitly converted to strings,
which causes symbols to throw. This commit adds an explicit
string conversion.
PR-URL: #20693
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleaxaddaleax mentioned this pull request May 22, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assertIssues and PRs related to the assert subsystem.author readyPRs that have at least one approval, no pending requests for changes, and a CI started.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@cjihrig@lpinca@BridgeAR@danbev@jasnell@trivikr@nodejs-github-bot