Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not bring this up to the parent scope and use it in the other places below that are now manually calling
common.mustNotCall()?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
But give it a better name... maybe
mustNotCallor if your thight with chardontCallor evendoNotUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mscdex Happy to do that if there's consensus that it would be an improvement. I didn't do it because:
It's not needed as an identifier in the other scopes. (It's needed here because of the
assert.deepStrictEqual()comparisons.)Fewer global identifiers shared across different block scopes helps make those things easily cut-and-paste-able into separate test files for refactoring, etc. It also helps limit the possibility of side effects. (For example, if another test attaches a property to the
noopfunction for some reason, that property will be set for all the other tests.)But this isn't far off from a tabs-vs-spaces discussion, so I'm happy to just do it if everyone else thinks differently than me. :-D