[bugzilla-gnome-org-extensions] IE compat: don't test match groups against null



commit ee7ec3b7725d7b7a186211787f79e2fe49b6bdcc
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sat Oct 10 17:26:17 2009 -0400

    IE compat: don't test match groups against null
    
    Unmatched optional groups in IE match results are empty strings
    not null, so use 'if (m[1])' not 'if (m[1]) != null'

 js/review.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/review.js b/js/review.js
index 144ea7e..2899e6e 100644
--- a/js/review.js
+++ b/js/review.js
@@ -331,14 +331,14 @@ Review.prototype = {
                 pos = HUNK_RE.lastIndex;
 
                 var oldStart, oldCount, newStart, newCount;
-                if (m2[1] != null) {
+                if (m2[1]) {
                     oldStart = parseInt(m2[1]);
                     oldCount = parseInt(m2[2]);
                 } else {
                     oldStart = oldCount = null;
                 }
 
-                if (m2[3] != null) {
+                if (m2[3]) {
                     newStart = parseInt(m2[3]);
                     newCount = parseInt(m2[4]);
                 } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]