mozilla / spiderflunky

Static analysis of JavaScript
5 stars 3 forks source link

Static property reference search #15

Open erikrose opened 10 years ago

erikrose commented 10 years ago

After the stuff to power DXR "callers:" queries, another handy feature would be the ability to identify (and thus search for) static property names. For example, you could do a search for "whatzit" and find the second line of…

x = {whozit: 'jane',
     whatzit: 'meat popsicle'}

This would help answer questions like "I received this object with a whatzit property. Where the heck did that come from, and what's that garbage in it?"

For bonus points, also find static occurrences in assignment statements, like…

x['whatzit'] = 6
x.whatzit = 7

…and dereferences, like…

console.log(x.whatzit)

We'd want to be able to do all those search cases separately so we can build queries of various degrees of pickiness.

For ultra, publication-worthy bonus points, do data flow analysis and find dynamic property references. :-) But that's another ticket....

mvcisback commented 10 years ago

Any interfaces defined using typescript definition files (#21) should also work with this.