From 75910f6f6e320c0131ea44f4f300bccd96149ee7 Mon Sep 17 00:00:00 2001 From: Alexander Pavlov Date: Wed, 5 Mar 2014 18:57:17 +0400 Subject: [PATCH 1/4] Make the difflib code ES5 strict mode-compliant --- difflib.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/difflib.js b/difflib.js index 5b8d769..bc58e71 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); }, From bb6753e56cf91ef8b4e2d29f5eaa6d0cb7e7da59 Mon Sep 17 00:00:00 2001 From: Alexander Pavlov Date: Wed, 5 Mar 2014 20:25:02 +0400 Subject: [PATCH 2/4] Fix more undeclared reference assignments --- difflib.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/difflib.js b/difflib.js index bc58e71..191fe45 100755 --- a/difflib.js +++ b/difflib.js @@ -171,6 +171,7 @@ var difflib = { var bestj = blo; var bestsize = 0; var j = null; + var k; var j2len = {}; var nothing = []; @@ -249,7 +250,8 @@ var 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)) { From ce74529f9d51943db440dbd7c15d515597cda2e1 Mon Sep 17 00:00:00 2001 From: Chas Emerick Date: Tue, 29 Jul 2014 14:04:26 -0400 Subject: [PATCH 3/4] Update README.asciidoc --- README.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From f728d45e5ccb798f35696f2ac6b763fbfc7682d0 Mon Sep 17 00:00:00 2001 From: Chas Emerick Date: Mon, 5 Jun 2017 09:37:21 -0400 Subject: [PATCH 4/4] declare diffview var, fixes gh-21 and gh-22 --- diffview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: