Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Sorry IE users, I left an Array.prototype.indexOf call in there

  • Loading branch information...
commit 91ea29f9cd44b4235b337519b4f7bb6a42f1a797 1 parent 367b978
Alex Young authored

Showing 1 changed file with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. 11  riot.js
11  riot.js
@@ -127,8 +127,17 @@
127 127
 
128 128
     requiredFiles: [],
129 129
 
  130
+    indexOf: function(array, value) {
  131
+      for (var i = 0; i < array.length; i++) {
  132
+        if (array[i] === value) {
  133
+          return i;
  134
+        }
  135
+      }
  136
+      return -1;
  137
+    },
  138
+
130 139
     require: function() {
131  
-      if (this.requiredFiles.indexOf(arguments[0]) == -1) {
  140
+      if (this.indexOf(this.requiredFiles, arguments[0]) == -1) {
132 141
         this.requiredFiles.push(arguments[0]);
133 142
         if (Riot.detectEnvironment() !== 'browser') {
134 143
           this.load(arguments[0]);

0 notes on commit 91ea29f

Please sign in to comment.
Something went wrong with that request. Please try again.