[bugzilla-gnome-org-extensions] IE compat: Don't array-index strings



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

    IE compat: Don't array-index strings
    
    Use substr() rather than array-indexing strings.

 js/patch.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/patch.js b/js/patch.js
index b4b3058..cedb339 100644
--- a/js/patch.js
+++ b/js/patch.js
@@ -96,7 +96,7 @@ Hunk.prototype = {
 
         for (var i = 0; i < rawlines.length; i++) {
             var line = rawlines[i];
-            var op = line[0];
+            var op = line.substr(0, 1);
             var strippedLine = line.substring(1);
             var noNewLine = 0;
             if (i + 1 < rawlines.length && rawlines[i + 1].substr(0, 1) == '\\') {
@@ -139,7 +139,7 @@ Hunk.prototype = {
         // generically stripping excess lines to be kind to hand-edited patches
         if (totalOld > oldCount &&
             lines[lines.length - 1][1] == null &&
-            lines[lines.length - 1][0][0] == '-')
+            lines[lines.length - 1][0].substr(0, 1) == '-')
         {
             lines.pop();
             currentOldCount--;


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