3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/network-test.js"></script>
7 function check(jsonText
)
9 var result
= WebInspector
.RequestJSONView
.parseJSON(jsonText
);
10 InspectorTest
.addResult("");
11 InspectorTest
.addResult("Input: " + jsonText
);
13 InspectorTest
.addResult("Invalid JSON");
15 InspectorTest
.addResult("Prefix: " + result
.prefix
);
16 InspectorTest
.addResult("Suffix: " + result
.suffix
);
17 InspectorTest
.addResult("Data: " + JSON
.stringify(result
.data
));
22 check("{\"x\": 5, \"y\": false, \"z\":\"foo\"}");
23 check("{\"bar\": [,,,1, 2, 3,,,], \"baz\": {\"data\": []}}");
25 check("/* GUARD */callback({\"a\": []]});");
26 check("foo({a = 5});");
27 check("(function(){return {\"a\": []}})()");
29 InspectorTest
.completeTest();
34 <body onload=
"runTest()">
35 <p>Tests JSON parsing.
</p>