You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ah, just took a look at the parser. Very smart re-using Uglify's walker.
I see the filterTuple which prevents lib calls which is good, otherwise the graph would be polluted with calls. I disabled the filter to see what would happen, and now I see that prototype calls end up being very flat/wide cause the tree walker doesn't seem to have an awareness of "this." instance calls referencing a particular class.
Any thoughts on how you'd approach enabling graphing something like that?
Here's what I'm aiming for:
digraph G {
subgraph cluster_0 {
label = "Class A";
a -> b;
a -> c -> e -> f;
a -> d;
}
subgraph cluster_1 {
label = "Class B";
g -> h;
i;
}
f -> g [constraint=false];
d -> i [constraint=false];
}
Thanks, @jakedowns. It is my understanding that the problem you presented is the reason why there were no such tools for JS since callgraph. The dynamic/prototypal nature of JS makes it very hard to correctly understand such calls from the static code only (from the AST). In order to do that, one would have to actually interpret (run) the code.
I'm afraid this tool won't ever be 100% "compliant". However, there are still use cases for it.
First off, this is a great start! and a tool I've been searching for for a long time.
It appears that .prototype method calls on custom class/functions aren't graphed?
Is this something you plan on adding? Or am I missing something obvious?
Thanks again for sharing such a cool package. I might try to dig into the source code a bit if I can find the time.
The text was updated successfully, but these errors were encountered: