Closed trichins closed 10 years ago
Thanks for pointing that out! I'll fix the behaviour as soon as I get home. Did you have a patch/diff/pr for nodeutils with those changes? If not, no worries. :)
@trichins Fixed in https://github.com/danielstjules/jsinspect/commit/b6238b9554e5944ea1448d05962cb2278ee4dd66 You can expect a new release soon. :)
I ran jsinspect with the identifier option (I'm just looking for copy and paste) and it seems to have a broad match. Take these two files (a reduced case from two larger files).
test1.js (function () { test1 = new Class({
}());
test2.js (function () { A = new Class({
}());
If you run jsinspect -i -t 34 test1.js test2.js, it will find a match. But with the identifier flag turned on, it don't think it should have matched them.
I believe the problem is that you don't have an identifierHandler for an ExpressionStatement so it is just comparing the fact that there are 16 ExpressionStatements in both files. If I add an identifierHandler for an ExpressionStatement (by checking the node type of the left node and using its identifierHandler), it stops matching the two.