diff --git a/lib/diff.js b/lib/diff.js index 21ed339c..4f81a262 100644 --- a/lib/diff.js +++ b/lib/diff.js @@ -1,6 +1,8 @@ (function (obj) { - obj.DiffProto = function(diffMatchPatch) { - var dmp = new diffMatchPatch(); + 'use strict'; + + obj.DiffProto = function(DiffMatchPatch) { + var dmp = new DiffMatchPatch(); this.createPatch = function(oldText, newText) { var diff = dmp.diff_main(oldText, newText), @@ -12,7 +14,7 @@ this.applyPatch = function(oldText, patch) { var patches = dmp.patch_fromText(patch), - result = dmp.patch_apply(patches, oldText); + result = dmp.patch_apply(patches, oldText), newText = result[0]; return newText;