This commit is contained in:
CoolElectronics 2024-04-16 19:28:26 -04:00
parent 52a1b304a1
commit f106409603
No known key found for this signature in database
GPG key ID: F63593D168636C50

View file

@ -1,12 +1,15 @@
import { assert } from './asserts' import { assert } from './asserts'
// saves a few characters, since document will never change // saves a few characters, since document will never change
let doc = document; let doc = document
export const Fragment = Symbol() export const Fragment = Symbol()
// We add some extra properties into various objects throughout, better to use symbols and not interfere. this is just a tiny optimization // We add some extra properties into various objects throughout, better to use symbols and not interfere. this is just a tiny optimization
let [USE_MAPFN, TARGET, PROXY, STEPS, LISTENERS, IF] = Array.from([, , , , , ,], Symbol) let [USE_MAPFN, TARGET, PROXY, STEPS, LISTENERS, IF] = Array.from(
[, , , , , ,],
Symbol
)
// whether to return the true value from a stateful object or a "trap" containing the pointer // whether to return the true value from a stateful object or a "trap" containing the pointer
let __use_trap = false let __use_trap = false
@ -304,9 +307,7 @@ export function h(type, props, ...children) {
} }
let xmlns = props?.xmlns let xmlns = props?.xmlns
let elm = xmlns let elm = xmlns ? doc.createElementNS(xmlns, type) : doc.createElement(type)
? doc.createElementNS(xmlns, type)
: doc.createElement(type)
for (let child of children) { for (let child of children) {
let cond = child && !isDLPtr(child) && child[IF] let cond = child && !isDLPtr(child) && child[IF]