+2016-05-24 Ryosuke Niwa <rniwa@webkit.org>
+
+ Another build fix after r201307.
+
+ * public/v3/pages/page-router.js:
+ (PageRouter.prototype._deserializeHashQueryValue):
+ (PageRouter.prototype._countOccurrences): Moved from _deserializeHashQueryValue.
+
2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
Build fix after r201307.
// Some applications don't linkify two consecutive closing parentheses: )).
// Try fixing adding one extra parenthesis to see if that works.
- function count(regex)
- {
- var match = json.match(regex);
- return match ? match.length : 0;
- }
- var missingClosingBrackets = count(/\[/g) - count(/\]/g);
+ var missingClosingBrackets = this._countOccurrences(json, /\[/g) - this._countOccurrences(json, /\]/g);
var fix = new Array(missingClosingBrackets).fill(']').join('');
try {
return JSON.parse(json + fix);
return value;
}
}
+
+ _countOccurrences(string, regex)
+ {
+ var match = string.match(regex);
+ return match ? match.length : 0;
+ }
}