Commit 8ac56711 authored by aniket-engg's avatar aniket-engg Committed by Aniket

all tests fixed

parent 155611c7
...@@ -335,7 +335,6 @@ function extractFunctionDefinitions (ast, astWalker) { ...@@ -335,7 +335,6 @@ function extractFunctionDefinitions (ast, astWalker) {
function addParams (parameterList, tree, scopeId, states, contractName, sourceLocation, stackLength, stackPosition, dir) { function addParams (parameterList, tree, scopeId, states, contractName, sourceLocation, stackLength, stackPosition, dir) {
let params = [] let params = []
for (let inputParam in parameterList.parameters) { for (let inputParam in parameterList.parameters) {
console.log('parameterList.parameters------>', parameterList.parameters)
const param = parameterList.parameters[inputParam] const param = parameterList.parameters[inputParam]
const stackDepth = stackLength + (dir * stackPosition) const stackDepth = stackLength + (dir * stackPosition)
if (stackDepth >= 0) { if (stackDepth >= 0) {
......
...@@ -21,9 +21,12 @@ AstWalker.prototype.walk = function (ast, callback) { ...@@ -21,9 +21,12 @@ AstWalker.prototype.walk = function (ast, callback) {
if (!('*' in callback)) { if (!('*' in callback)) {
callback['*'] = function () { return true } callback['*'] = function () { return true }
} }
if (manageCallBack(ast, callback) && ast.nodes && ast.nodes.length > 0) { const nodes = ast.nodes || (ast.body && ast.body.statements) || ast.declarations
for (let k in ast.nodes) { if(ast.body && ast.initializationExpression) // 'for' loop handling
const child = ast.nodes[k] nodes.push(ast.initializationExpression)
if (manageCallBack(ast, callback) && nodes && nodes.length > 0) {
for (let k in nodes) {
const child = nodes[k]
this.walk(child, callback) this.walk(child, callback)
} }
} }
......
...@@ -65,7 +65,6 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu ...@@ -65,7 +65,6 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu
st.equals(scopeStarts[136], '3') st.equals(scopeStarts[136], '3')
st.equals(scopeStarts[153], '4') st.equals(scopeStarts[153], '4')
st.equals(scopeStarts[166], '4.1') st.equals(scopeStarts[166], '4.1')
console.log('----------->', scopes[''])
st.equals(scopes[''].locals['ui8'].type.typeName, 'uint8') st.equals(scopes[''].locals['ui8'].type.typeName, 'uint8')
st.equals(scopes[''].locals['ui16'].type.typeName, 'uint16') st.equals(scopes[''].locals['ui16'].type.typeName, 'uint16')
st.equals(scopes[''].locals['ui32'].type.typeName, 'uint32') st.equals(scopes[''].locals['ui32'].type.typeName, 'uint32')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment