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

src: remove throws in set/getHiddenValue #16544

Closed
wants to merge 2 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Oct 27, 2017

setHiddenValue() and getHiddenValue() are internal only utility functions, CHECK instead of throw

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

util

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. util Issues and PRs related to the built-in util module. labels Oct 27, 2017
@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Oct 27, 2017
@@ -287,7 +287,8 @@ function REPLServer(prompt,
const top = replMap.get(self);
const pstrace = Error.prepareStackTrace;
Error.prepareStackTrace = prepareStackTrace(pstrace);
internalUtil.decorateErrorStack(e);
if (typeof e === 'object')
Copy link
Member Author

Choose a reason for hiding this comment

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

to protect against the odd random non-object being emitted on the domain error event. If e is not an object, it will trigger the CHECK

@nodejs nodejs deleted a comment from salmanwaheed Oct 27, 2017
@nodejs nodejs deleted a comment from salmanwaheed Oct 27, 2017
assert.throws(getHiddenValue(85, 'foo'), errMessageObj);
assert.throws(getHiddenValue({}), errMessageIndex);
assert.throws(getHiddenValue({}, null), errMessageIndex);
assert.throws(getHiddenValue({}, []), errMessageIndex);
assert.deepStrictEqual(
Copy link
Member

Choose a reason for hiding this comment

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

Nit: not sure why this uses deepStrictEqual. I think it should be strictEqual.

@jasnell
Copy link
Member Author

jasnell commented Oct 30, 2017

ping @nodejs/tsc

These are internal only utility functions, CHECK instead of throw
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@jasnell
Copy link
Member Author

jasnell commented Nov 2, 2017

@jasnell
Copy link
Member Author

jasnell commented Nov 2, 2017

Failures in CI are entirely unrelated.

jasnell added a commit that referenced this pull request Nov 2, 2017
These are internal only utility functions, CHECK instead of throw

PR-URL: #16544
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@jasnell
Copy link
Member Author

jasnell commented Nov 2, 2017

Landed in 3d20190

@jasnell jasnell closed this Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. semver-major PRs that contain breaking changes and should be released in the next major version. 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