Refactor _getInputParams

pull/1/head
ninabreznik 7 years ago
parent e45e416148
commit ccdd941295
  1. 23
      src/app/editor/contextualListener.js

@ -172,29 +172,22 @@ class ContextualListener {
} }
_getInputParams (node) { _getInputParams (node) {
var params var params = []
var list = []
for (var i in node.children) { for (var i in node.children) {
if (node.children[i].name === 'ParameterList') { if (node.children[i].name === 'ParameterList') {
list.push(node.children[i]) var target = node.children[i]
break break
} }
} }
debugger if (target) {
for (var j in list) { var children = target.children
if (list[j].children.length) { for (var j in children) {
var children = list[j].children if (children[j].name === 'VariableDeclaration') {
for (var k in children) { params.push(children[j].attributes.type.split(' ')[0])
if (children[k].name === 'VariableDeclaration') {
params = children[k].attributes.type
break
}
} }
} else {
params = ''
} }
} }
return '(' + params + ')' return '(' + params.toString() + ')'
} }
} }

Loading…
Cancel
Save