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

Backport #585 #586

Merged
merged 1 commit into from
Jun 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/plugins/estree.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,14 @@ export default function (instance) {
};
});

instance.extend("parseClassMethod", function (inner) {
return function (classBody, ...args) {
inner.call(this, classBody, ...args);

const body = classBody.body;
body[body.length - 1].type = "MethodDefinition";
instance.extend("parseClassMethod", function () {
return function (classBody, method, isGenerator, isAsync) {
this.parseMethod(method, isGenerator, isAsync);
if (method.typeParameters) {
method.value.typeParameters = method.typeParameters;
delete method.typeParameters;
}
classBody.body.push(this.finishNode(method, "MethodDefinition"));
};
});

Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/estree/class-method/flow/actual.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class NodeUtils extends UtilParser {
finishNodeAt<T : NodeType>(node: T): T {
return node;
}
}
Loading