if(!nodeTypeIn(funcNode,[exactMatch(nodeTypes.FUNCTIONDEFINITION),exactMatch(nodeTypes.MODIFIERDEFINITION)]))thrownewError('staticAnalysisCommon.js: not a FunctionDefinition or ModifierDefinition Node')
returnfuncNode.parameters
}
@ -415,7 +396,7 @@ function getFunctionCallTypeParameterType (func: FunctionCallAstNode): string |
t.throws(()=>common.getEffectedVariableName(inlineAssembly),Error,'staticAnalysisCommon.js: not an effect Node or inline assembly, get from inline assembly should throw')
t.ok(common.getEffectedVariableName(assignment)==='a','get right name for assignment')
t.throws(()=>common.getEffectedVariableName(externalDirect),Error,'should throw on all other nodes')
t.throws(()=>common.getEffectedVariableName(inlineAssembly),newRegExp('staticAnalysisCommon.js: wrong node type'),'staticAnalysisCommon.js: not an effect Node or inline assembly, get from inline assembly should throw')
t.throws(()=>common.getEffectedVariableName(externalDirect),newRegExp('staticAnalysisCommon.js: not an effect Node'),'should throw on all other nodes')
t.ok(common.getThisLocalCallName(thisLocalCall)==='f','get this Local call name from node')
t.throws(()=>common.getThisLocalCallName(externalDirect),Error,'throws on other nodes')
t.throws(()=>common.getThisLocalCallName(localCall),Error,'throws on other nodes')
t.throws(()=>common.getThisLocalCallName(externalDirect),newRegExp('staticAnalysisCommon.js: not a this local call Node'),'throws on externalDirect nodes')
t.throws(()=>common.getThisLocalCallName(localCall),newRegExp('staticAnalysisCommon.js: not a this local call Node'),'throws on localCall nodes')
t.ok(common.getExternalDirectCallContractName(externalDirect)==='c','external direct call contract name from node')
t.throws(()=>common.getExternalDirectCallContractName(thisLocalCall),Error,'throws on other nodes')
t.throws(()=>common.getExternalDirectCallContractName(localCall),Error,'throws on other nodes')
t.throws(()=>common.getExternalDirectCallContractName(thisLocalCall),newRegExp('staticAnalysisCommon.js: not an external direct call Node'),'throws on other nodes')
t.throws(()=>common.getExternalDirectCallContractName(localCall),newRegExp('staticAnalysisCommon.js: not an external direct call Node'),'throws on other nodes')
t.ok(common.getThisLocalCallContractName(thisLocalCall)==='C','this local call contract name from node')
t.throws(()=>common.getThisLocalCallContractName(localCall),Error,'throws on other nodes')
t.throws(()=>common.getThisLocalCallContractName(externalDirect),Error,'throws on other nodes')
t.throws(()=>common.getThisLocalCallContractName(localCall),newRegExp('staticAnalysisCommon.js: not a this local call Node'),'throws on other nodes')
t.throws(()=>common.getThisLocalCallContractName(externalDirect),newRegExp('staticAnalysisCommon.js: not a this local call Node'),'throws on other nodes')
t.ok(common.getExternalDirectCallMemberName(externalDirect)==='f','external direct call name from node')
t.throws(()=>common.getExternalDirectCallMemberName(thisLocalCall),Error,'throws on other nodes')
t.throws(()=>common.getExternalDirectCallMemberName(localCall),Error,'throws on other nodes')
t.throws(()=>common.getExternalDirectCallMemberName(thisLocalCall),newRegExp('staticAnalysisCommon.js: not an external direct call Node'),'throws on other nodes')
t.throws(()=>common.getExternalDirectCallMemberName(localCall),newRegExp('staticAnalysisCommon.js: not an external direct call Node'),'throws on other nodes')
t.ok(common.getFunctionDefinitionName(functionDefinition)==='f','returns right function name')
t.throws(()=>common.getFunctionDefinitionName(inheritance),newRegExp('staticAnalysisCommon.js: not a FunctionDefinition Node'),'throws on other nodes')
t.ok(common.getInheritsFromName(inheritance)==='A','returns right contract name')
t.throws(()=>common.getInheritsFromName(functionDefinition),newRegExp('staticAnalysisCommon.js: not an InheritanceSpecifier Node'),'throws on other nodes')
t.ok(common.helpers.nodeType(common.getFunctionOrModifierDefinitionParameterPart(functionDefinition),'ParameterList'),'should return a parameterList')
t.throws(()=>common.getFunctionOrModifierDefinitionParameterPart(contractDefinition),newRegExp('staticAnalysisCommon.js: not a FunctionDefinition or ModifierDefinition Node'),'throws on other nodes')
t.throws(()=>common.getFunctionCallTypeParameterType(thisLocalCall.expression),newRegExp('staticAnalysisCommon.js: cannot extract parameter types from function call'),'throws on wrong type')
t.throws(()=>common.getLibraryCallContractName(contractDefinition),newRegExp('staticAnalysisCommon.js: not a library call Node'),'should throw on wrong node')
t.equal(common.getLibraryCallMemberName(libCall),'insert','should return correct member name')
t.throws(()=>common.getLibraryCallMemberName(thisLocalCall),newRegExp('staticAnalysisCommon.js: not a library call Node'),'should throw on wrong node')
t.throws(()=>common.getFullQualifiedFunctionCallIdent(contractDefinition,assignment),newRegExp('staticAnalysisCommon.js: Can not get function name from non function call node'),'throws on wrong type')
t.ok(common.getFullQuallyfiedFuncDefinitionIdent(contractDefinition,functionDefinition,['uint256','bool'])==='C.f(uint256,bool)','creates right signature')
t.throws(()=>common.getFullQuallyfiedFuncDefinitionIdent(contractDefinition,parameterFunctionCall,['uint256','bool']),newRegExp('staticAnalysisCommon.js: not a FunctionDefinition Node'),'throws on wrong nodes')
t.throws(()=>common.getFullQuallyfiedFuncDefinitionIdent(parameterFunctionCall,functionDefinition,['uint256','bool']),newRegExp('staticAnalysisCommon.js: not a ContractDefinition Node'),'throws on wrong nodes')
t.ok(!reports.some((mod: AnalysisReport)=>mod.report.some((rep: AnalysisReportObj)=>rep.warning.includes('INTERNAL ERROR')),'Should not have internal errors'))
t.ok(!reports.some((mod: AnalysisReport)=>mod.report.some((rep: AnalysisReportObj)=>rep.warning.includes('INTERNAL ERROR')),'Should not have internal errors'))