diff --git a/dom.js b/dom.js index 7caac64..29963c2 100644 --- a/dom.js +++ b/dom.js @@ -2,7 +2,6 @@ function Node(parent, tag) { this.parentNode = parent; // Node this.pos = 0; // position in siblings list this.tagName = tag; - this.text = null; // attributes are stored directly on the node object // see https://github.com/elm/virtual-dom/blob/master/src/Elm/Kernel/VirtualDom.js#L511 this.children = []; // List of Node @@ -17,10 +16,14 @@ function Node(parent, tag) { node.pos = this.children.push(node); } this.dump = (d=0) => { - if (this.text != null) { + if (this.text) { print(this.text); return } + if (this.innerHTML) { + print(this.innerHTML); + return + } std.printf("<%s", this.tagName) // Set.difference(other) is not avalable in qjs for (a of Object.keys(this)) { @@ -53,6 +56,8 @@ document.getElementById = (_id) => { return target} document.createElement = (tag) => new Node(null, tag); document.createTextNode = (text) => { t = new Node(null, "#text" ); t.text = text; return t } +var global = {}; + try { // here will come the Elm app code