Commit c2f8fb9
authored
Fix lineHash.hasOwnProperty might be contaminated
if calling method like dmp.diff_linesToChars_('hasOwnProperty', ' ') will throw TypeError: lineHash.hasOwnProperty is not a function
since the lineHash is a instance of Object, the method can be overwritten while walking through the text lines.
To avoid this, we can use Object.prototype.hasOwnProperty.call(lineHash, line) that make it always can call hasOwnProperty properly.
Update diff_match_patch_uncompressed.js1 parent 5b73bb8 commit c2f8fb9
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
0 commit comments