MissingDeclaration is only ever a Statement#23485
Merged
1 commit merged intoApr 18, 2018
Merged
Conversation
a391167 to
b3583a0
Compare
mhegazy
reviewed
Apr 17, 2018
| || kind === SyntaxKind.SetAccessor | ||
| || kind === SyntaxKind.IndexSignature | ||
| || kind === SyntaxKind.SemicolonClassElement | ||
| || kind === SyntaxKind.MissingDeclaration; |
Contributor
There was a problem hiding this comment.
the parser can still add it in a class element context.. we have not changed the parser not to do that.. e.g. ; in a class body would be parsed as MissingDeclaration.
Author
There was a problem hiding this comment.
Looks like that is a SemicolonClassElement:
import ts = require("typescript");
const sourceFile = ts.createSourceFile("foo.ts", "class C { ; }", ts.ScriptTarget.ESNext);
const member = (sourceFile.statements[0] as ts.ClassDeclaration).members[0];
console.log(ts.SyntaxKind[member.kind]); // SemicolonClassElement
Contributor
There was a problem hiding this comment.
u are right.. sorry about that.
mhegazy
approved these changes
Apr 17, 2018
rbuckton
approved these changes
Apr 18, 2018
This pull request was closed.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The only time we create one of these is in
parseDeclarationWorker, which returns aStatement. InparseClassElementandparseTypeMember, we'll parse a property declaration if all we see is a name. InparseObjectLiteralElementwe'll parse a shorthand property assignment.