Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Commit

Permalink
add a lot more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Jun 1, 2015
1 parent 147cbcd commit c054b4c
Show file tree
Hide file tree
Showing 2 changed files with 599 additions and 10 deletions.
16 changes: 13 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function monkeypatch() {
var propertyType = propertyTypes[visitorValue];
var nodeProperty = node[visitorValue];
// check if property or type is defined
if (!propertyType || !nodeProperty) {
if (propertyType == null || nodeProperty == null) {
continue;
}
if (propertyType.type === "loop") {
Expand Down Expand Up @@ -196,8 +196,8 @@ function monkeypatch() {
visitTypeAnnotation.call(this, node.typeAnnotation);
} else if (node.type === "Identifier") {
this.visit(node);
} else if (node.id && node.id.type === "Identifier") {
this.visit(node.id);
} else {
visitTypeAnnotation.call(this, node);
}
}

Expand All @@ -215,6 +215,16 @@ function monkeypatch() {
checkIdentifierOrVisit.call(this, i);
}.bind(this));
}
if (node.typeParameters) {
node.typeParameters.params.forEach(function(p) {
checkIdentifierOrVisit.call(this, p);
}.bind(this));
}
if (node.superTypeParameters) {
node.superTypeParameters.params.forEach(function(p) {
checkIdentifierOrVisit.call(this, p);
}.bind(this));
}
visitClass.call(this, node);
};
// visit decorators that are in: Property / MethodDefinition
Expand Down
Loading

0 comments on commit c054b4c

Please sign in to comment.