Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.
Open
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: 4 additions & 4 deletions closure.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,16 @@ function getFnType(node) {
if (node.type == 'VariableDeclaration') {
var decl = node.declarations[0];
if (decl.init && decl.init.type == 'FunctionExpression') {
return decl.init.body.scope.fnType;
return decl.init.scope.fnType;
}
} else if (node.type == 'FunctionDeclaration') {
return node.body.scope.fnType;
return node.scope.fnType;
} else if (node.type == 'AssignmentExpression' &&
node.right.type == 'FunctionExpression') {
return node.right.body.scope.fnType;
return node.right.scope.fnType;
} else if (node.value && node.value.type == 'FunctionExpression') {
// Object property.
return node.value.body.scope.fnType;
return node.value.scope.fnType;
}
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"doctrine": "^0.5.2"
},
"peerDependencies": {
"tern": "^0.13.0"
"tern": "^0.20.0"
},
"devDependencies": {
"chai": "^1.9.1",
Expand Down