Dhtmlx/codebase2/chart.js
//  TODO: DRY this out. reusing normal patch here negatively affects V8's JIT
DRY this out. reusing normal patch here negatively affects V8's JIT
DRY this out . reusing normal patch here negatively affects V8 ' s JIT
function hydrate(vnode, withEl) {
	if (vnode.el == null) {
		if (vnode.type === ELEMENT) {
			vnode.el = withEl || createElement(vnode.tag, vnode.ns);
			if (vnode.attrs != null)
				{ patchAttrs(vnode, emptyObj, true); }
			if ((vnode.flags & LAZY_LIST) === LAZY_LIST)	
				{ vnode.body.body(vnode); }
			if (isArr(vnode.body))
				{ hydrateBody(vnode); }
			else if (vnode.body != null && vnode.body !== "")
				{ vnode.el.textContent = vnode.body; }
		}
		else if (vnode.type === TEXT)
			{ vnode.el = withEl || createTextNode(vnode.body); }
		else if (vnode.type === COMMENT)
			{ vnode.el = withEl || createComment(vnode.body); }
	}
	vnode.el._node = vnode;
	return vnode.el;
}
function hydrate ( vnode , withEl ) { if ( vnode . el == null ) { if ( vnode . type === ELEMENT ) { vnode . el = withEl || createElement ( vnode . tag , vnode . ns ) ; if ( vnode . attrs != null ) { patchAttrs ( vnode , emptyObj , true ) ; } if ( ( vnode . flags & LAZY_LIST ) === LAZY_LIST ) { vnode . body . body ( vnode ) ; } if ( isArr ( vnode . body ) ) { hydrateBody ( vnode ) ; } else if ( vnode . body != null && vnode . body !== "" ) { vnode . el . textContent = vnode . body ; } } else if ( vnode . type === TEXT ) { vnode . el = withEl || createTextNode ( vnode . body ) ; } else if ( vnode . type === COMMENT ) { vnode . el = withEl || createComment ( vnode . body ) ; } } vnode . el . _node = vnode ; return vnode . el ; }
TODO: DRY this out.
TODO : DRY this out .
//	if (vnode.tag === "svg") //		vnode.el.setAttributeNS(XML_NS, 'xmlns:xlink', XLINK_NS); // vnode.body instanceof LazyList