From 9ac400f97d44e6eab2738d76023a07511cbdf4ce Mon Sep 17 00:00:00 2001 From: Chris Dunder Date: Fri, 20 Oct 2017 13:52:34 -0700 Subject: [PATCH] Update tern (0.13 to 0.20) --- closure.js | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/closure.js b/closure.js index 1b5a3e5..f2ed770 100644 --- a/closure.js +++ b/closure.js @@ -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; } diff --git a/package.json b/package.json index 3208a16..5224090 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "doctrine": "^0.5.2" }, "peerDependencies": { - "tern": "^0.13.0" + "tern": "^0.20.0" }, "devDependencies": { "chai": "^1.9.1",