Replaces the current node with the specified one.

@example
someNode.replace(someNewNode);

@method replace
@param {tinymce.html.Node} node Node to replace the current node with.
@return {tinymce.html.Node} The old node that got replaced.
184281
function(node) {
                var self = this;
                node.parent && node.remove();
                self.insert(node, self);
                self.remove();
                return self;
            }
256732
public void replaceWith(HasNode node) {
		feature = node.feature;
		nodeName = node.nodeName;
		trueNode = node.trueNode;
		falseNode = node.falseNode;
	}
813536
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
  {

    error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"replaceChild not supported!");

    return null;
  }
930849
function insertNode (i, last) {
  var node = new Node(i)

  if (!last) {
    node.prev = node
    node.next = node

  } else {
    node.next = last.next
    node.prev = last
    last.next.prev = node
    last.next = node
  }
  return node
}
1122285
function updateIfNodeValueChanged(currentNode, newNode){
    var nodeValueChanged = newNode.nodeValue !== currentNode.nodeValue;
    if (nodeValueChanged) {
      $(currentNode).replaceWith(newNode);
    }
  }
521125
function(node){
    if (!node) this.expect('atblock');
    node = new nodes.Atblock;
    this.state.push('atblock');
    node.block = this.block(node, false);
    this.state.pop();
    return node;
  }
106955
function updateNode(node, content, append) {
  append = append || false;

  while(!append && node.firstChild) {
    node.removeChild(node.firstChild);
  }

  if(content instanceof Element) {
    node.appendChild(content);
  }
  else if(content instanceof Array) {
    content.forEach(function(element) {
      node.appendChild(element);
    });
  }
  else {
    node.textContent = content;
  }
}
529294
function (nodeList, newNodes) {
			// Unregister all childNodeLists.
			var oldNodes = nodeLists.unregisterChildren(nodeList);

			newNodes = makeArray(newNodes);

			var oldListLength = nodeList.length;

			// Replace oldNodeLists's contents.
			splice.apply(nodeList, [
				0,
				oldListLength
			].concat(newNodes));

			// Replacements are nodes that have replaced the original element this is on.
			// We can't simply insert elements because stache does children before parents.
			if(nodeList.replacements){
				nodeLists.nestReplacements(nodeList);
				nodeList.deepChildren = nodeList.newDeepChildren;
				nodeList.newDeepChildren = [];
			} else {
				nodeLists.nestList(nodeList);
			}

			return oldNodes;
		}
1269297
function (prevNode, newNode) {
      if (prevNode === newNode) {
          return;
      }
      TNode.replaceNodeBy.call(this,prevNode, newNode);
      var aen=this.attEltNodes;
      if (aen) {
          for (var i=0,sz=aen.length; sz>i;i++) {
              aen[i].replaceNodeBy(prevNode, newNode);
          }
      }
  }
852061
def visit(self, node):
        
        for pattern, replace in know_pattern:
            check = Check(node, dict())
            if check.visit(pattern):
                node = PlaceholderReplace(check.placeholders).visit(replace())
                self.update = True
        return super(PatternTransform, self).visit(node)
941755
def swap_with node
      return self if node.equal? self
      if self.attached?
        if node.attached?
          # both attached -- use placeholder
          placeholder = Default.new
          my_parent = @parent
          my_parent.replace_node(self, placeholder)
          node.parent.replace_node(node, self)
          my_parent.replace_node(placeholder, node)
        else
          # only `self' attached
          @parent.replace_node(self, node)
        end
      else
        if node.attached?
          # only `node' attached
          node.parent.replace_node(node, self)
        else
          # neither attached -- nothing to do
        end
      end
      return self
    end
1075266
private static void replaceThis(Node expectedGetprop, Node replacement) {
    Node leftChild = expectedGetprop.getFirstChild();
    if (leftChild.isThis()) {
      expectedGetprop.replaceChild(leftChild, replacement);
    } else {
      replaceThis(leftChild, replacement);
    }
  }
1318135
function replaceWithMultiple(nodes) {
  this.resync();

  nodes = this._verifyNodeList(nodes);
  t.inheritLeadingComments(nodes[0], this.node);
  t.inheritTrailingComments(nodes[nodes.length - 1], this.node);
  this.node = this.container[this.key] = null;
  this.insertAfter(nodes);
  if (!this.node) this.dangerouslyRemove();
}
745157
function remove(node) {
    var next = node.nextSibling || node.parentNode;

    node.parentNode.removeChild(node);

    return next;
}
233834
function replaceNode(replacementNode, node) {
  remove(replacementNode)
  node.parentNode.insertBefore(replacementNode, node)
  remove(node)
}
583371
public void replaceWith(Node in) {
        Validate.notNull(in);
        Validate.notNull(parentNode);
        parentNode.replaceChild(this, in);
    }
1021019
public void replaceChild(Node current, Node with) {
        double currentSplit = nodeSplits.get(current);
        int index = children.indexOf(current);
        children.remove(current);
        addChild(with, index, currentSplit);
        notifyStateChange();
    }