Skip to content

Commit

Permalink
comment out debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjor committed Oct 22, 2019
1 parent 832e420 commit ac09386
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions patch/VirtualDom.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- Kernel/original_VirtualDom.js 2019-10-05 04:17:25.000000000 +0900
+++ Kernel/VirtualDom.js 2019-10-22 19:38:46.000000000 +0900
+++ Kernel/VirtualDom.js 2019-10-22 19:42:42.000000000 +0900
@@ -419,7 +419,9 @@

if (tag === __2_TEXT)
Expand All @@ -25,10 +25,10 @@
var childNodes = domNode.childNodes;
- for (var j = 0; j < vKids.length; j++)
+ if(domNode.tagName === "BODY") {
+ console.log("addDomeNodeHelp", vKids.length);
+ for (let c of document.body.childNodes) {
+ console.log(" " + c.tagName, c.created_by_elm);
+ }
+ // console.log("addDomeNodeHelp", vKids.length);
+ // for (let c of document.body.childNodes) {
+ // console.log(" " + c.tagName, c.created_by_elm);
+ // }
+ }
+
+ for (var j = 0, k = 0; j < Math.max(vKids.length, childNodes.length); j++, k++)
Expand Down
48 changes: 24 additions & 24 deletions public/simple-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ const main = params.get("main") || "Element";
const app = Elm.Simple[main].init({
node: document.getElementById("root")
});
console.log("After init");
for (let c of document.body.childNodes) {
console.log(" " + c.tagName, c.created_by_elm);
}
// console.log("After init");
// for (let c of document.body.childNodes) {
// console.log(" " + c.tagName, c.created_by_elm);
// }
setTimeout(() => {
console.log("After init 2");
for (let c of document.body.childNodes) {
console.log(" " + c.tagName, c.created_by_elm);
}
// console.log("After init 2");
// for (let c of document.body.childNodes) {
// console.log(" " + c.tagName, c.created_by_elm);
// }
});
app.ports.event.subscribe(s => {
if (window.notifyEvent) {
Expand All @@ -21,10 +21,10 @@ app.ports.event.subscribe(s => {
app.ports.done.send("");
});
app.ports.insertIntoBody.subscribe(([id, top, bottom]) => {
console.log("Before insert");
for (let c of document.body.childNodes) {
console.log(" " + c.tagName, c.created_by_elm, c.nodeType);
}
// console.log("Before insert");
// for (let c of document.body.childNodes) {
// console.log(" " + c.tagName, c.created_by_elm, c.nodeType);
// }

for (let i = 0; i < top; i++) {
const node = `<div class="ext top">EXTENSION NODE</div>`;
Expand All @@ -36,10 +36,10 @@ app.ports.insertIntoBody.subscribe(([id, top, bottom]) => {
}
app.ports.done.send(id);

console.log("After insert");
for (let c of document.body.childNodes) {
console.log(" " + c.tagName, c.created_by_elm);
}
// console.log("After insert");
// for (let c of document.body.childNodes) {
// console.log(" " + c.tagName, c.created_by_elm);
// }
});
app.ports.insertBeforeTarget.subscribe(id => {
const target = document.querySelector(`#${id} .target`);
Expand Down Expand Up @@ -75,16 +75,16 @@ app.ports.updateAttribute.subscribe(id => {
app.ports.done.send(id);
});
app.ports.removeInsertedNode.subscribe(id => {
console.log("Before remove");
for (let c of document.body.childNodes) {
console.log(" " + c.tagName, c.created_by_elm);
}
// console.log("Before remove");
// for (let c of document.body.childNodes) {
// console.log(" " + c.tagName, c.created_by_elm);
// }
for (let el of document.querySelectorAll(`.ext`)) {
el.remove();
}
console.log("After remove");
for (let c of document.body.childNodes) {
console.log(" " + c.tagName, c.created_by_elm);
}
// console.log("After remove");
// for (let c of document.body.childNodes) {
// console.log(" " + c.tagName, c.created_by_elm);
// }
app.ports.done.send(id);
});

0 comments on commit ac09386

Please sign in to comment.