Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" (#376)

This commit is contained in:
Henry Zhu
2017-02-23 09:50:25 -05:00
committed by GitHub
parent 9ed026df08
commit b0f8405b52
7 changed files with 1 additions and 25 deletions

View File

@@ -766,13 +766,8 @@ pp.parseClassBody = function (node) {
};
pp.parseClassProperty = function (node) {
const noPluginMsg = "You can only use Class Properties when the 'classProperties' plugin is enabled.";
if (!node.typeAnnotation && !this.hasPlugin("classProperties")) {
this.raise(node.start, noPluginMsg);
}
if (this.match(tt.eq)) {
if (!this.hasPlugin("classProperties")) this.raise(this.state.start, noPluginMsg);
if (!this.hasPlugin("classProperties")) this.unexpected();
this.next();
node.value = this.parseMaybeAssign();
} else {