summaryrefslogtreecommitdiff
path: root/src/www/syntax-editor/ast.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/www/syntax-editor/ast.js')
-rw-r--r--src/www/syntax-editor/ast.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/www/syntax-editor/ast.js b/src/www/syntax-editor/ast.js
index 5aa55d230..89bdcf5c4 100644
--- a/src/www/syntax-editor/ast.js
+++ b/src/www/syntax-editor/ast.js
@@ -137,7 +137,8 @@ function AST(fun, cat) {
}
// Wrap the current node inside another node
- this.wrap = function(typeobj, childid) {
+ // Doesn't check whether child_id is within in range
+ this.wrap = function(typeobj, child_id) {
var subtree = new ASTNode(this.currentNode);
this.currentNode.fun = typeobj.name.join(" ");
this.currentNode.cat = typeobj.ret;
@@ -145,7 +146,7 @@ function AST(fun, cat) {
for (var i in typeobj.args) {
this.add(null, typeobj.args[i]);
}
- this.currentNode.children[i] = subtree;
+ this.currentNode.children[child_id] = subtree;
return subtree;
}