Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
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
5 changes: 0 additions & 5 deletions babylon-to-espree/toAST.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,6 @@ var astTransformVisitor = {
}
}

// remove class property keys (or patch in escope)
if (path.isClassProperty()) {
delete node.key;
}

// async function as generator
if (path.isFunction()) {
if (node.async) node.generator = true;
Expand Down
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ function monkeypatch() {
// visit decorators that are in: ClassDeclaration / ClassExpression
var visitClass = referencer.prototype.visitClass;
referencer.prototype.visitClass = function(node) {
var classBody = node.body.body;
for (var a = 0; a < classBody.length; a++) {
if (classBody[a].type === "ClassProperty") {
createScopeVariable.call(this, classBody[a], classBody[a].key);
}
}

visitDecorators.call(this, node);
var typeParamScope;
if (node.typeParameters) {
Expand Down