Revision: 1507ab2437f4
Author:   Janne Härkönen <[email protected]>
Date:     Sun Jun  5 23:43:47 2011
Log:      IE8 does not support indexOf for arrays
http://code.google.com/p/robotframework/source/detail?r=1507ab2437f4

Modified:
 /src/robot/webcontent/js/model.js
 /src/robot/webcontent/js/util.js

=======================================
--- /src/robot/webcontent/js/model.js   Fri Jun  3 08:37:10 2011
+++ /src/robot/webcontent/js/model.js   Sun Jun  5 23:43:47 2011
@@ -56,7 +56,7 @@
     function containsTag(testTags, tagname, isCombined) {
         testTags = util.map(testTags, util.normalize);
         if (!isCombined)
-            return testTags.indexOf(util.normalize(tagname)) != -1;
+            return util.contains(testTags, util.normalize(tagname));
         if (tagname.indexOf(' & ') != -1) {
             var tagnames = tagname.split(' & ');
return util.all(util.map(tagnames, function (name) { return containsTag(testTags, name, true); }));
=======================================
--- /src/robot/webcontent/js/util.js    Sun May 29 22:33:49 2011
+++ /src/robot/webcontent/js/util.js    Sun Jun  5 23:43:47 2011
@@ -32,6 +32,14 @@
         }
         return false;
     }
+
+    function contains(elems, e) {
+        for (var i=0; i<elems.length; i++) {
+            if (elems[i] == e)
+                return true;
+        }
+        return false;
+    }

     function normalize(string) {
         return string.toLowerCase().replace(' ', '', 'g');
@@ -55,6 +63,7 @@
         filter: filter,
         all: all,
         any: any,
+        contains: contains,
         normalize: normalize,
         Matcher: Matcher
     };

Reply via email to