Fix .description(): do not set command description if undefined is provided in the first parameter#1966
Closed
aweebit wants to merge 1 commit intotj:developfrom
Closed
Fix .description(): do not set command description if undefined is provided in the first parameter#1966aweebit wants to merge 1 commit intotj:developfrom
.description(): do not set command description if undefined is provided in the first parameter#1966aweebit wants to merge 1 commit intotj:developfrom
Conversation
aweebit
commented
Aug 13, 2023
| @@ -1837,7 +1837,9 @@ Expecting one of '${allowedValues.join("', '")}'`); | |||
| */ | |||
| description(str, argsDescription) { | |||
| if (str === undefined && argsDescription === undefined) return this._description; | |||
Contributor
Author
There was a problem hiding this comment.
Alternative solution not allowing to change only the arguments description:
Suggested change
| if (str === undefined && argsDescription === undefined) return this._description; | |
| if (str === undefined) return this._description; |
(and leave the next line untouched)
Collaborator
There was a problem hiding this comment.
I actually like this alternative solution better, and argsDescription is deprecated. But it would technically be a breaking change. I think simpler just to leave it alone (and one day get rid of argsDescription).
Closed
Collaborator
|
Can revisit this if/when it gets in the way of adding more strict checks to the JavaScript. |
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
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.
This is a ridiculously unimportant change, but it fixes one of the errors revealed by a run of the TypeScript check fixed in #1960.
I've learnt my lesson, and since the change is technically visible to the outside world, I am making a separate PR for it.
Peer PRs
Changes are to be merged into…