This doesn't really look like a 'proper' refactor to me. It's a blanket 'all strings and attributes' isn't it? How does this apply to 'real world' code?<p>1 - What if I'm using an external library so I have some exceptions?<p>2 - What if I want to keep strings with underscores in them? Can it detect those strings that are used to reference as attributes and those that aren't?<p>3 - What if I'm using an external library so I have some exceptions?<p>4 - What if I have two entirely separate 'classes'/prototypes but they share a common attribute name. What if I want to update one but not the other?<p>I've spent a lot of time writing in static and dynamic languages and I intuitively don't believe that you can do 'proper' refactors in dynamic languages (although it's not something I've gone out of my way to look into).<p>I'd love to be proved wrong.
Was discussing this in #node.js on freenode and someone suggested looking at Tern as well. It seems to be a bigger, though more powerful, library.<p>Blog post that was suggested: <a href="http://marijnhaverbeke.nl/blog/tern.html" rel="nofollow">http://marijnhaverbeke.nl/blog/tern.html</a>