[Pkg-mozext-commits] [nosquint] 43/47: Do proper version comparison

David Prévot taffit at moszumanska.debian.org
Tue Apr 28 01:41:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 2.1.6
in repository nosquint.

commit aaacabe89bfdf52cd401fa6e444e49a885a7680e
Author: Jason Tackaberry <tack at urandom.ca>
Date:   Wed Feb 8 08:37:10 2012 -0500

    Do proper version comparison
    
    Previously, NoSquint did a dumb string comparison which broke when Firefox
    reached verison 10.  This fixes #25.
---
 src/content/lib.js | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/content/lib.js b/src/content/lib.js
index 84d1ea8..2006355 100644
--- a/src/content/lib.js
+++ b/src/content/lib.js
@@ -19,21 +19,25 @@
         Application.storage.set('nosquint-global', this.storage);
     }
 
-    this.is30 = function() {
-        return Application.version.substr(0, 4) == '3.0.';
-    };
+    this.is30 = (function() {
+        let is30 = Application.version.substr(0, 4) == '3.0.';
+        return function() is30;
+    })();
 
-    this.is36 = function() {
-        return Application.version.substr(0, 4) == '3.6.';
-    };
+    this.is36 = (function() {
+        let is36 = Application.version.substr(0, 4) == '3.6.';
+        return function() is36;
+    })();
 
-    this.is3x = function() {
-        return Application.version.substr(0, 4) < '4.0';
-    };
+    this.is3x = (function() {
+        let is3x = parseInt(Application.version.split('.')[0]) < 4;
+        return function() is3x;
+    })();
 
-    this.is40 = function() {
-        return Application.version.substr(0, 4) >= '4.0.';
-    };
+    this.is40 = (function() {
+        let is40 = parseInt(Application.version.split('.')[0]) >= 4;
+        return function() is40;
+    })();
 
     this.$ = function(id, doc) {
         if (doc === undefined)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nosquint.git



More information about the Pkg-mozext-commits mailing list