Skip to content

Parse class member with a missing identifier in the presence of a modifier#3515

Merged
JsonFreeman merged 1 commit into
release-1.5from
classMemberWithMissingIdentifier
Jun 17, 2015
Merged

Parse class member with a missing identifier in the presence of a modifier#3515
JsonFreeman merged 1 commit into
release-1.5from
classMemberWithMissingIdentifier

Conversation

@JsonFreeman
Copy link
Copy Markdown
Contributor

Fixes #3504.

class C { 
    public {};
}

Our parser function isClassMemberStart treats public {} as a class member because it starts with the word "public". Starting with a modifier is enough evidence to consider it a class member. However, parseClassElement is not so forgiving. It expects to see an identifier after the word "public". It does have a special case for a decorator with no identifier after it, so I'm piggy backing on this fallback logic for modifiers as well.

@JsonFreeman
Copy link
Copy Markdown
Contributor Author

@CyrusNajmabadi want to take a look?

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

👍

JsonFreeman added a commit that referenced this pull request Jun 17, 2015
Parse class member with a missing identifier in the presence of a modifier
@JsonFreeman JsonFreeman merged commit 27cccdd into release-1.5 Jun 17, 2015
@JsonFreeman JsonFreeman deleted the classMemberWithMissingIdentifier branch June 17, 2015 22:05
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants