diff --git a/README.asciidoc b/README.asciidoc index 1b0c439..b96a41b 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -16,7 +16,7 @@ http://cemerick.com[I] needed a good in-browser visual diff tool, and couldn't find anything suitable, so I built *jsdifflib* in Feb 2007 and open-sourced it soon thereafter. It's apparently been used a fair bit since then. Maybe you'll find it useful. -===== If you *do* find jsdifflib useful, _please support my open source work via a bitcoin donation/tip_ to 1Htu5T1Mkk7bU6XmzYjeQG25xSCgEjVZHn. Thanks! +===== If you *do* find jsdifflib useful, _please support my open source work via a bitcoin donation/tip_ to 19qCqZxAdRF4eZfyZD2GQnAWk2Mz7DZZVf. Thanks! [[overview]] == Overview diff --git a/difflib.js b/difflib.js index 5b8d769..191fe45 100755 --- a/difflib.js +++ b/difflib.js @@ -28,9 +28,9 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S DAMAGE. ***/ /* Author: Chas Emerick */ -__whitespace = {" ":true, "\t":true, "\n":true, "\f":true, "\r":true}; +var __whitespace = {" ":true, "\t":true, "\n":true, "\f":true, "\r":true}; -difflib = { +var difflib = { defaultJunkFunction: function (c) { return __whitespace.hasOwnProperty(c); }, @@ -171,6 +171,7 @@ difflib = { var bestj = blo; var bestsize = 0; var j = null; + var k; var j2len = {}; var nothing = []; @@ -249,7 +250,8 @@ difflib = { matching_blocks.sort(difflib.__ntuplecomp); - var i1 = j1 = k1 = block = 0; + var i1 = 0, j1 = 0, k1 = 0, block = 0; + var i2, j2, k2; var non_adjacent = []; for (var idx in matching_blocks) { if (matching_blocks.hasOwnProperty(idx)) { diff --git a/diffview.js b/diffview.js index 372753d..0414aba 100644 --- a/diffview.js +++ b/diffview.js @@ -27,7 +27,7 @@ The views and conclusions contained in the software and documentation are those authors and should not be interpreted as representing official policies, either expressed or implied, of Chas Emerick. */ -diffview = { +var diffview = { /** * Builds and returns a visual diff view. The single parameter, `params', should contain * the following values: