function viewPatch(nodeOld, nodeOldElement, nodeNew) {
		var nodeOldData = nodeOld.data;
		var nodeNewData = nodeNew.data; // First, go through all new data and update all of the existing data to
		// match.

		for (var keyNew in nodeNewData) {
			var valueOld = nodeOldData[keyNew];
			var valueNew = nodeNewData[keyNew];

			if (valueOld !== valueNew) {
				if (keyNew[0] === "o" && keyNew[1] === "n") {
					// Update an event.
					nodeOldElement[keyNew.toLowerCase()] = valueNew;
				} else {
					switch (keyNew) {
						case "attributes":
							{
								// Update attributes.
								if (valueOld === undefined) {
									for (var valueNewKey in valueNew) {
										nodeOldElement.setAttribute(valueNewKey, valueNew[valueNewKey]);
									}
								} else {
									for (var _valueNewKey in valueNew) {
										var valueNewValue = valueNew[_valueNewKey];

										if (valueOld[_valueNewKey] !== valueNewValue) {
											nodeOldElement.setAttribute(_valueNewKey, valueNewValue);
										}
									} // Remove attributes from the old value that are not in
									// the new value.


									for (var valueOldKey in valueOld) {
										if (!(valueOldKey in valueNew)) {
											nodeOldElement.removeAttribute(valueOldKey);
										}
									}
								}

								break;
							}

						case "style":
							{
								// Update style properties.
								var nodeOldElementStyle = nodeOldElement.style;

								if (valueOld === undefined) {
									for (var _valueNewKey2 in valueNew) {
										nodeOldElementStyle[_valueNewKey2] = valueNew[_valueNewKey2];
									}
								} else {
									for (var _valueNewKey3 in valueNew) {
										var _valueNewValue = valueNew[_valueNewKey3];

										if (valueOld[_valueNewKey3] !== _valueNewValue) {
											nodeOldElementStyle[_valueNewKey3] = _valueNewValue;
										}
									} // Remove style properties from the old value that are not
									// in the new value.


									for (var _valueOldKey in valueOld) {
										if (!(_valueOldKey in valueNew)) {
											nodeOldElementStyle[_valueOldKey] = "";
										}
									}
								}

								break;
							}

						case "focus":
							{
								// Update focus/blur.
								if (valueNew) {
									nodeOldElement.focus();
								} else {
									nodeOldElement.blur();
								}

								break;
							}

						case "class":
							{
								// Update a className property.
								nodeOldElement.className = valueNew;
								break;
							}

						case "for":
							{
								// Update an htmlFor property.
								nodeOldElement.htmlFor = valueNew;
								break;
							}

						case "children":
							{
								// Update children.
								var valueNewLength = valueNew.length;

								if (valueOld === undefined) {
									// If there were no old children, create new children.
									var nodeOldElementMoonChildren = nodeOldElement.MoonChildren = [];

									for (var i = 0; i < valueNewLength; i++) {
										var nodeOldElementChild = viewCreate(valueNew[i]);
										nodeOldElementMoonChildren.push(nodeOldElementChild);
										nodeOldElement.appendChild(nodeOldElementChild);
									}
								} else {
									var valueOldLength = valueOld.length;

									if (valueOldLength === valueNewLength) {
										// If the children have the same length then update
										// both as usual.
										var _nodeOldElementMoonChildren = nodeOldElement.MoonChildren;

										for (var _i = 0; _i < valueOldLength; _i++) {
											var valueOldNode = valueOld[_i];
											var valueNewNode = valueNew[_i];

											if (valueOldNode !== valueNewNode) {
												if (valueOldNode.name === valueNewNode.name) {
													viewPatch(valueOldNode, _nodeOldElementMoonChildren[_i], valueNewNode);
												} else {
													var valueOldElementNew = viewCreate(valueNewNode);
													nodeOldElement.replaceChild(valueOldElementNew, _nodeOldElementMoonChildren[_i]);
													_nodeOldElementMoonChildren[_i] = valueOldElementNew;
												}
											}
										}
									} else if (valueOldLength > valueNewLength) {
										// If there are more old children than new children,
										// update the corresponding ones and remove the extra
										// old children.
										var _nodeOldElementMoonChildren2 = nodeOldElement.MoonChildren;

										for (var _i2 = 0; _i2 < valueNewLength; _i2++) {
											var _valueOldNode = valueOld[_i2];
											var _valueNewNode = valueNew[_i2];

											if (_valueOldNode !== _valueNewNode) {
												if (_valueOldNode.name === _valueNewNode.name) {
													viewPatch(_valueOldNode, _nodeOldElementMoonChildren2[_i2], _valueNewNode);
												} else {
													var _valueOldElementNew = viewCreate(_valueNewNode);

													nodeOldElement.replaceChild(_valueOldElementNew, _nodeOldElementMoonChildren2[_i2]);
													_nodeOldElementMoonChildren2[_i2] = _valueOldElementNew;
												}
											}
										}

										for (var _i3 = valueNewLength; _i3 < valueOldLength; _i3++) {
											nodeOldElement.removeChild(_nodeOldElementMoonChildren2.pop());
										}
									} else {
										// If there are more new children than old children,
										// update the corresponding ones and append the extra
										// new children.
										var _nodeOldElementMoonChildren3 = nodeOldElement.MoonChildren;

										for (var _i4 = 0; _i4 < valueOldLength; _i4++) {
											var _valueOldNode2 = valueOld[_i4];
											var _valueNewNode2 = valueNew[_i4];

											if (_valueOldNode2 !== _valueNewNode2) {
												if (_valueOldNode2.name === _valueNewNode2.name) {
													viewPatch(_valueOldNode2, _nodeOldElementMoonChildren3[_i4], _valueNewNode2);
												} else {
													var _valueOldElementNew2 = viewCreate(_valueNewNode2);

													nodeOldElement.replaceChild(_valueOldElementNew2, _nodeOldElementMoonChildren3[_i4]);
													_nodeOldElementMoonChildren3[_i4] = _valueOldElementNew2;
												}
											}
										}

										for (var _i5 = valueOldLength; _i5 < valueNewLength; _i5++) {
											var _nodeOldElementChild = viewCreate(valueNew[_i5]);

											_nodeOldElementMoonChildren3.push(_nodeOldElementChild);

											nodeOldElement.appendChild(_nodeOldElementChild);
										}
									}
								}

								break;
							}

						default:
							{
								// Update a DOM property.
								nodeOldElement[keyNew] = valueNew;
							}
					}
				}
			}
		} // Next, go through all of the old data and remove data that isn't in the
		// new data.


		for (var keyOld in nodeOldData) {
			if (!(keyOld in nodeNewData)) {
				if (keyOld[0] === "o" && keyOld[1] === "n") {
					// Remove an event.
					nodeOldElement[keyOld.toLowerCase()] = null;
				} else {
					switch (keyOld) {
						case "attributes":
							{
								// Remove attributes.
								var _valueOld = nodeOldData.attributes;

								for (var _valueOldKey2 in _valueOld) {
									nodeOldElement.removeAttribute(_valueOldKey2);
								}

								break;
							}

						case "focus":
							{
								// Remove focus.
								nodeOldElement.blur();
								break;
							}

						case "class":
							{
								// Remove a className property.
								nodeOldElement.className = "";
								break;
							}

						case "for":
							{
								// Remove an htmlFor property.
								nodeOldElement.htmlFor = "";
								break;
							}

						case "children":
							{
								// Remove children.
								var _valueOldLength = nodeOldData.children.length;
								var _nodeOldElementMoonChildren4 = nodeOldElement.MoonChildren;

								for (var _i6 = 0; _i6 < _valueOldLength; _i6++) {
									nodeOldElement.removeChild(_nodeOldElementMoonChildren4.pop());
								}

								break;
							}

						default:
							{
								// Remove a DOM property.
								var nodeOldName = nodeOld.name;
								nodeOldElement[keyOld] = (nodeOldName in removeDataPropertyCache ? removeDataPropertyCache[nodeOldName] : removeDataPropertyCache[nodeOldName] = nodeOldName === "text" ? document.createTextNode("") : document.createElement(nodeOldName))[keyOld];
							}
					}
				}
			}
		}
	}
Patches an old element's data to match a new node, using an old node as
reference.

@param {object} nodeOld
@param {object} nodeOldElement
@param {object} nodeNew