code: function walk(node, beforeCb, afterCb) {
    if (node._removed) {
      return;
    }
    if (node.type) {
      beforeCb(node);
    }
    if (node.nodes) {
      // copying in case the list changes
      var copyNodes = node.nodes.slice(0);
      copyNodes.forEach(function (childNode) {
        walk(childNode, beforeCb, afterCb);
      });
    }
    if (node.type) {
      if (typeof afterCb === 'function') {
        afterCb(node);
      }
    }
  }
docs: /*
  Walks a tree of AST nodes.
  @param {AstNode|Object} node AST node to walk.
  @param {String} node.type Each AST node needs a type.
  @param {Array} [node.nodes] Each AST node can optionally have a list of nodes to recurse.
  @param {function} beforeCb Function to call before recursing into node.
  @param {function} afterCb Function to call after recursing into node.