3

When trying to compare the difference between two minified javascript files with random identifier names, about 95% of the changes are identifiers being renamed. I would like to use a tool that ignores these renames and just shows actual code addition and deletion.

Such a tool would be very useful to easily see what an app has changed in an update.

1

The approach you are looking for is to to parse both files into Abstract Syntax Trees and then compare the two trees for similarity.

A simple solution would be to write a lexer/tokenizer/transducer which replaces the names with just "NAMEGOESHERE" and then use diff.

If you post the two files, I can give it a try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.