Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Fix: Add parameter type annotations to the AST (refs #105) #111

Merged
merged 1 commit into from
Nov 4, 2016
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
8 changes: 6 additions & 2 deletions lib/ast-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ module.exports = function(ast, extra) {
} else { // class

/**
* Unlinke in object literal methods, class method params can have decorators
* Unlike in object literal methods, class method params can have decorators
*/
method.params = node.parameters.map(function(param) {
var convertedParam = convertChild(param);
Expand Down Expand Up @@ -1408,7 +1408,11 @@ module.exports = function(ast, extra) {
right: convertChild(node.initializer)
});
} else {
return convert(node.name, parent);
var convertedParameter = convert(node.name, parent);
if (node.type) {
convertedParameter.typeAnnotation = convertTypeAnnotation(node.type);
}
return convertedParameter;
}

break;
Expand Down
Loading