ajvincent / composite-collection

Composing Maps, WeakMaps, Sets and WeakSets into compiled classes
Mozilla Public License 2.0
1 stars 0 forks source link

Create spec/static-analysis directory for static analysis of classes #5

Closed ajvincent closed 3 years ago

ajvincent commented 3 years ago

... which is a hairy problem in and of itself.

https://github.com/sverweij/dependency-cruiser/issues/336 is the closest I could find to what I need, more complex than eslint but not designed for unit tests.

Example: KeyHasher must store non-primitive keys weakly. Truly verifying that would require analysis of an abstract syntax tree (AST), trying to trace an entry point (an argument in one function) to points that assign or store a value. I could see that requiring a few things, of which I only know I need the first three:

Crafting this would be ugly, but the composite collections I'm building could make it easier, ironically enough.

Honestly, the complexity of this type of analysis could result in a complementary project, where each one uses the other as a development dependency...

ajvincent commented 3 years ago

Note to self: look up "call graphs" in JavaScript. That's a pretty good starting point.

ajvincent commented 3 years ago

Too complicated for a project just starting out.