Repository navigation
Remove an random accessor from object literal grammar checking - #65469
Open
Jake Bailey (jakebailey) wants to merge 1 commit into
Open
Jake Bailey (jakebailey) wants to merge 1 commit into
Jake Bailey (jakebailey) wants to merge 1 commit into
Conversation
Shorthand properties have no class-like data, and the discarded accessor result does not participate in grammar checking. Remove the stray call while retaining the named-member checks. Exercise valid shorthand properties and their optional, assertion, initializer, and duplicate-name grammar diagnostics.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change removing the unused accessor call.
No open issues 🎉
What changed in this PR
Removes a side-effect-free ClassLikeData() call from the native TypeScript compiler’s object-literal grammar checker, preserving existing validation behavior.
Changes:
- Removes the unused accessor call when checking shorthand properties.
- Adds coverage for valid shorthand properties, optional and definite-assignment markers, initializers, and duplicate names.
- Records expected diagnostics, JavaScript output, types, and symbols.
| File | Description |
|---|---|
tsc/testdata/tests/cases/compiler/objectShorthandGrammar.ts |
Adds valid and invalid object-property test cases. |
tsc/testdata/baselines/reference/compiler/objectShorthandGrammar.types |
Records inferred types, including error recovery. |
tsc/testdata/baselines/reference/compiler/objectShorthandGrammar.symbols |
Records property symbols and declaration associations. |
tsc/testdata/baselines/reference/compiler/objectShorthandGrammar.js |
Records JavaScript emit for the test cases. |
tsc/testdata/baselines/reference/compiler/objectShorthandGrammar.errors.txt |
Records the four expected grammar diagnostics. |
tsc/internal/checker/grammarchecks.go |
Removes the unused ClassLikeData() call. |
Review effort: Balanced
This branch has not been deployed
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.
No idea what this is doing here.