mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-26 11:53:26 -08:00
Use string.charAt(n) instead of string[n]
Safari doesn't seem to like the string indices in some circumstances
This commit is contained in:
parent
5e6e03f3f3
commit
1b2cdf9cd0
1 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue