Another build fix after r201307.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 May 2016 18:04:03 +0000 (18:04 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 May 2016 18:04:03 +0000 (18:04 +0000)
* public/v3/pages/page-router.js:
(PageRouter.prototype._deserializeHashQueryValue):
(PageRouter.prototype._countOccurrences): Moved from _deserializeHashQueryValue.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201337 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/v3/pages/page-router.js

index 5e30ea7..6bb120a 100644 (file)
@@ -1,3 +1,11 @@
+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.
index cc782d5..71fdedd 100644 (file)
@@ -147,12 +147,7 @@ class PageRouter {
 
             // 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);
@@ -161,4 +156,10 @@ class PageRouter {
             return value;
         }
     }
+
+    _countOccurrences(string, regex)
+    {
+        var match = string.match(regex);
+        return match ? match.length : 0;
+    }
 }