Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Commit

Permalink
Revert "Don't parse class properties without initializers when classP…
Browse files Browse the repository at this point in the history
…roperties plugin is disabled, and Flow is enabled" (#376)
  • Loading branch information
hzoo authored Feb 23, 2017
1 parent 9ed026d commit b0f8405
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 25 deletions.
7 changes: 1 addition & 6 deletions src/parser/statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit b0f8405

Please sign in to comment.