This commit is contained in:
leon.lee 2017-04-16 10:13:22 +00:00 committed by GitHub
commit b6d1bc0102

View File

@ -58,6 +58,8 @@ TreeTransformer.prototype = new TreeWalker;
node.DEFMETHOD("transform", function(tw, in_list){
var x, y;
tw.push(this);
this.walker = new TreeWalker;
this.walker.stack = tw.stack.concat();
if (tw.before) x = tw.before(this, descend, in_list);
if (x === undefined) {
if (!tw.after) {
@ -75,8 +77,9 @@ TreeTransformer.prototype = new TreeWalker;
});
};
function do_list(list, tw) {
return MAP(list, function(node){
function do_list(list, tw){
return MAP(list, function(node , i){
node._position = i;
return node.transform(tw, true);
});
};