Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function () {
var createdElement
if (tagName !== 'virtual' || originalTagName) {
// console.log('element open ->', tagName, parsedAttrs.key)
var TagClass = oval.getRegisteredTag(originalTagName || tagName)
if (!TagClass) {
IncrementalDOM.elementOpenStart(tagName, parsedAttrs.key, parsedAttrs.staticAttrs)
for (var key in parsedAttrs.attrs) {
IncrementalDOM.attr(key, parsedAttrs.attrs[key])
}
} else {
IncrementalDOM.elementOpenStart(tagName, parsedAttrs.key)
}
createdElement = IncrementalDOM.elementOpenEnd()
if (parsedAttrs.attrs['ref']) {
tag.refs[parsedAttrs.attrs['ref']] = createdElement
}
if (parsedAttrs.attrs['freeze']) {
IncrementalDOM.skip()
}
if (createdElement.tag) {
if (!createdElement.tag.shouldRender) {
IncrementalDOM.skip()
} else {
createdElement.tag.update(children, parsedAttrs.props, parsedAttrs.attrs)
}
IncrementalDOM.elementClose(tagName)
tag.childTags.push(createdElement.tag)
return
}
}
return
}
IncrementalDOM.elementOpenStart(tagName.toLowerCase(), parsedAttrs.oid)
for (let key in parsedAttrs.attrs) {
IncrementalDOM.attr(key, parsedAttrs.attrs[key])
}
if (!components[tagName]) {
for (let key in parsedAttrs.props) {
IncrementalDOM.attr(key, parsedAttrs.props[key])
}
for (let key in parsedAttrs.handlers) {
IncrementalDOM.attr('on' + key, parsedAttrs.handlers[key])
}
}
let createdElement = IncrementalDOM.elementOpenEnd()
if (parsedAttrs.attrs['freeze']) {
IncrementalDOM.skip()
}
if (components[tagName]) {
IncrementalDOM.currentComponent = createdElement
if (!createdElement.mounted) {
components[tagName](createdElement)
Object.assign(createdElement.state, parsedAttrs.props)
for (let name in parsedAttrs.handlers) {
createdElement.on(name, parsedAttrs.handlers[name])
}
appendChilds(kids)
createdElement.connectedCallback()
} else {
appendChilds(kids)
createdElement.shouldUpdate(parsedAttrs.props)