code: function getParents(node) {
      var result = [];
      var parent = node.parent;
      while (parent != null) {
          result.push(parent);
          parent = parent.parent;
      }
      return result;
  }
docs: Get parents of node.
  The parent nodes are returned in order from the closest parent to the outer ones.
  @param node
  @returns {Array}