FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

util: use assert for unreachable code by Trott · Pull Request #37249 · nodejs/node · GitHub

/ node Public

util: use assert for unreachable code - #37249

Merged
Trott merged 1 commit into
nodejs:masterfrom
Trott:add-assert
Feb 8, 2021
Merged

util: use assert for unreachable code#37249
Trott merged 1 commit into
nodejs:masterfrom
Trott:add-assert

Conversation

Trott commented Feb 6, 2021

Copy link
Copy Markdown
Member

Great effort is taken to keep util.inspect() from throwing while
inspecting a linked list or other items that require recursion. It is
likely still possible at this time to cause a throw with prototype
pollution, but that will change soon when the code is modified to use
primordials.

This commit instructs our coverage to not be concerned about not being
able to reach the throwing-an-error code and changes the throw there to
an assert so users will be instructed to open a bug with Node.js should
they manage to cause the code to throw.

nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Feb 6, 2021

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Great effort is taken to keep `util.inspect()` from throwing while
inspecting a linked list or other items that require recursion. It is
likely still possible at this time to cause a throw with prototype
pollution, but that will change soon when the code is modified to use
primordials.

This commit instructs our coverage to not be concerned about not being
able to reach the throwing-an-error code and changes the throw there to
an assert so users will be instructed to open a bug with Node.js should
they manage to cause the code to throw.

PR-URL: nodejs#37249
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>

Trott commented Feb 8, 2021

Copy link
Copy Markdown
Member Author

Landed in 04bef7a

Trott merged commit 04bef7a into nodejs:master Feb 8, 2021
Trott deleted the add-assert branch February 8, 2021 17:53
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
Great effort is taken to keep `util.inspect()` from throwing while
inspecting a linked list or other items that require recursion. It is
likely still possible at this time to cause a throw with prototype
pollution, but that will change soon when the code is modified to use
primordials.

This commit instructs our coverage to not be concerned about not being
able to reach the throwing-an-error code and changes the throw there to
an assert so users will be instructed to open a bug with Node.js should
they manage to cause the code to throw.

PR-URL: #37249
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This was referenced Feb 16, 2021
targos pushed a commit that referenced this pull request May 1, 2021
Great effort is taken to keep `util.inspect()` from throwing while
inspecting a linked list or other items that require recursion. It is
likely still possible at this time to cause a throw with prototype
pollution, but that will change soon when the code is modified to use
primordials.

This commit instructs our coverage to not be concerned about not being
able to reach the throwing-an-error code and changes the throw there to
an assert so users will be instructed to open a bug with Node.js should
they manage to cause the code to throw.

PR-URL: #37249
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
danielleadams mentioned this pull request May 3, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL