Revision: 10445
Author:   cod...@google.com
Date:     Tue Jul 12 10:58:10 2011
Log:      Updating test case to check for existence of indexOf() (<=IE8)
Review at http://gwt-code-reviews.appspot.com/1469803

Review by: jlaba...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=10445

Modified:
 /trunk/user/test/com/google/gwt/core/client/JsIdentityTest.java

=======================================
--- /trunk/user/test/com/google/gwt/core/client/JsIdentityTest.java Mon Jul 11 06:15:51 2011 +++ /trunk/user/test/com/google/gwt/core/client/JsIdentityTest.java Tue Jul 12 10:58:10 2011
@@ -179,7 +179,16 @@
   }-*/;

   public native int indexOf(T value) /*-{
-    return this.indexOf(value);
+    if(this.indexOf) {
+      return this.indexOf(value);
+    } else {
+      for(var i=0; i<this.length; i++) {
+        if(this[i]==value) {
+          return i;
+        }
+      }
+      return -1;
+    }
   }-*/;

   public native int length() /*-{

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to