[Pkg-mozext-commits] [firebug] 03/16: #7964 JSON previews should ignore comments at the start of the content

David Prévot taffit at moszumanska.debian.org
Sun Feb 7 19:14:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit 8db08d3a4607558b28645090450c819cc092ba7b
Author: Florent FAYOLLE <florent.fayolle69 at gmail.com>
Date:   Mon Nov 2 22:18:24 2015 +0100

    #7964 JSON previews should ignore comments at the start of the content
---
 extension/content/firebug/lib/json.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/extension/content/firebug/lib/json.js b/extension/content/firebug/lib/json.js
index c81ad32..9015bd6 100644
--- a/extension/content/firebug/lib/json.js
+++ b/extension/content/firebug/lib/json.js
@@ -70,9 +70,10 @@ Json.parseJSONString = function(jsonString, originURL)
     }
     catch (exc) {}
 
-    // Give up if we don't have valid start, to avoid some unnecessary overhead.
+    // Give up if we don't have valid start, to avoid some unnecessary overhead,
+    // and if we don't start with comments (pseudoJsonToJson is meant to strip them).
     first = firstNonWs(jsonString);
-    if (first !== "[" && first !== "{" && isNaN(first) && first !== '"')
+    if (first !== "[" && first !== "{" && isNaN(first) && first !== '"' && first !== "/")
         return null;
 
     // Remove JavaScript comments, quote non-quoted identifiers, and merge

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list