mirror of
https://github.com/MercuryWorkshop/dreamlandjs.git
synced 2025-05-16 23:50:00 -04:00
reformat
This commit is contained in:
parent
52a1b304a1
commit
f106409603
1 changed files with 6 additions and 5 deletions
11
src/core.js
11
src/core.js
|
@ -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]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue