esgraph
esgraph copied to clipboard
translation error
This code:
function l(a) {
return q.test(a) ? '"' + a.replace(/\"/g, '""') + '"' : a
}
becomes the following unparsable code:
digraph cfg {
node [shape="box"]
subgraph cluster_0{
label = "function l(a)"
n0 [label="entry", style="rounded"]
n1 [label="return q.test(a) ? '\"' + a.replace(/\\"/g, '\"\"') + '\"' : a"]
n2 [label="exit", style="rounded"]
n0 -> n1 []
n1 -> n2 []
n1 -> n2 [color="red", label="exception"]
}
subgraph cluster_1{
label = "[[main]]"
n3 [label="entry", style="rounded"]
n4 [label="exit", style="rounded"]
n3 -> n4 []
}
}
that line should have one backslash more:
n1 [label="return q.test(a) ? '\"' + a.replace(/\\\"/g, '\"\"') + '\"' : a"]
Good catch @kaktus42, would you be interested in opening a pull request?