From 1b2cdf9cd078bfaa676afa47f5c4bce471bbd8ba Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 5 Feb 2013 19:12:05 +0000 Subject: [PATCH] Use string.charAt(n) instead of string[n] Safari doesn't seem to like the string indices in some circumstances --- core/modules/filters.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/modules/filters.js b/core/modules/filters.js index c9100485a..b19c9ceea 100644 --- a/core/modules/filters.js +++ b/core/modules/filters.js @@ -241,15 +241,15 @@ Returns the new start position, after the parsed operation function parseFilterOperation(operators,filterString,p) { var operator, operand, bracketPos; // Skip the starting square bracket - if(filterString[p++] !== "[") { + if(filterString.charAt(p++) !== "[") { throw "Missing [ in filter expression"; } // Process each operator in turn do { operator = {}; // Check for an operator prefix - if(filterString[p] === "!") { - operator.prefix = filterString[p++]; + if(filterString.charAt(p) === "!") { + operator.prefix = filterString.charAt(p++); } // Get the operator name bracketPos = filterString.indexOf("[",p); @@ -270,9 +270,9 @@ function parseFilterOperation(operators,filterString,p) { p = bracketPos + 1; // Push this operator operators.push(operator); - } while(filterString[p] !== "]"); + } while(filterString.charAt(p) !== "]"); // Skip the ending square bracket - if(filterString[p++] !== "]") { + if(filterString.charAt(p++) !== "]") { throw "Missing ] in filter expression"; } // Return the parsing position