1
// Any copyright is dedicated to the Public Domain.
2
// http://creativecommons.org/licenses/publicdomain/
4
var gTestfile = 'trailing-comma.js';
5
//-----------------------------------------------------------------------------
6
var BUGNUMBER = 564621;
7
var summary = 'JSON.parse should reject {"a" : "b",} or [1,]';
9
print(BUGNUMBER + ": " + summary);
15
testJSON('[]', false);
16
testJSON('[1]', false);
17
testJSON('["a"]', false);
18
testJSON('{}', false);
19
testJSON('{"a":1}', false);
20
testJSON('{"a":"b"}', false);
21
testJSON('{"a":true}', false);
22
testJSON('[{}]', false);
24
testJSON('[1,]', true);
25
testJSON('["a",]', true);
26
testJSON('{,}', true);
27
testJSON('{"a":1,}', true);
28
testJSON('{"a":"b",}', true);
29
testJSON('{"a":true,}', true);
30
testJSON('[{,}]', true);
31
testJSON('[[1,]]', true);
32
testJSON('[{"a":"b",}]', true);