@samitouri / QOS-React-2 / commits / fdffec73c3

Use String.charAt for character by index lookup

Using object property accessor for string character lookup breaks in non-modern browsers.

Árni Hermann Reynisson committed Dec 3, 2014 at 14:49 UTC fdffec73c36a73443182b206595b239924d294cb
1 file changed +1 -1
src/browser/ui/ReactMount.js
+1 -1
@@ -63,7 +63,7 @@ var findComponentRootReusableArray = [];
63 function firstDifferenceIndex(string1, string2) {
64 var minLen = Math.min(string1.length, string2.length);
65 for (var i = 0; i < minLen; i++) {
66 - if (string1[i] !== string2[i]) {
66 + if (string1.charAt(i) !== string2.charAt(i)) {
67 return i;
68 }
69 }