Refactoring of generateDiff() in prototype diffing code

error: Uncaught TypeError: Cannot read property 'cType' of undefined on line 93 of diff.js