From 34619706687ebad0d6a48c082f94a9e3a4d1babc Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 14 Jan 2020 17:08:18 -0500 Subject: [PATCH 1/2] remove node.kind check since this is not necessarily present in ast trees and nodeType is sufficient --- remix-tests/src/testRunner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-tests/src/testRunner.ts b/remix-tests/src/testRunner.ts index 1815ac9238..82b3381814 100644 --- a/remix-tests/src/testRunner.ts +++ b/remix-tests/src/testRunner.ts @@ -35,7 +35,7 @@ function getAvailableFunctions (fileAST: AstNode, testContractName: string) { if(fileAST.nodes && fileAST.nodes.length > 0) { const contractAST: AstNode[] = fileAST.nodes.filter(node => node.name === testContractName && node.nodeType === 'ContractDefinition') if(contractAST.length > 0 && contractAST[0].nodes) { - const funcNodes: AstNode[] = contractAST[0].nodes.filter(node => node.kind === 'function' && node.nodeType === "FunctionDefinition") + const funcNodes: AstNode[] = contractAST[0].nodes.filter(node => node.nodeType === "FunctionDefinition") funcList = funcNodes.map(node => node.name) } } From 91920dbcb03afc00486ebfac20c21162533b1477 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 15 Jan 2020 15:45:52 -0500 Subject: [PATCH 2/2] if node.kind exists, ensure it's function and the the ndoeType is is FunctionDefinition --- remix-tests/src/testRunner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-tests/src/testRunner.ts b/remix-tests/src/testRunner.ts index 82b3381814..876645f883 100644 --- a/remix-tests/src/testRunner.ts +++ b/remix-tests/src/testRunner.ts @@ -35,7 +35,7 @@ function getAvailableFunctions (fileAST: AstNode, testContractName: string) { if(fileAST.nodes && fileAST.nodes.length > 0) { const contractAST: AstNode[] = fileAST.nodes.filter(node => node.name === testContractName && node.nodeType === 'ContractDefinition') if(contractAST.length > 0 && contractAST[0].nodes) { - const funcNodes: AstNode[] = contractAST[0].nodes.filter(node => node.nodeType === "FunctionDefinition") + const funcNodes: AstNode[] = contractAST[0].nodes.filter(node => ((node.kind === "function" && node.nodeType === "FunctionDefinition") || (node.nodeType === "FunctionDefinition"))) funcList = funcNodes.map(node => node.name) } }