Collect console log and allow time-travel to log invocation

This commit is contained in:
Dmitry Vasilev
2022-10-17 02:49:21 +08:00
parent 1a00533103
commit 8c7c68ba50
15 changed files with 581 additions and 186 deletions

View File

@@ -59,6 +59,25 @@ export const zip = (x,y) => {
export const uniq = arr => [...new Set(arr)]
export const collect_nodes_with_parents = new Function('node', 'pred', `
const result = []
const do_collect = (node, parent) => {
if(node.children != null) {
for(let c of node.children) {
do_collect(c, node)
}
}
if(pred(node)) {
result.push({node, parent})
}
}
do_collect(node, null)
return result
`)
// TODO remove
/*
function object_diff(a,b){