michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: var gTestfile = 'trailing-comma.js'; michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 564621; michael@0: var summary = 'JSON.parse should reject {"a" : "b",} or [1,]'; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: testJSON('[]', false); michael@0: testJSON('[1]', false); michael@0: testJSON('["a"]', false); michael@0: testJSON('{}', false); michael@0: testJSON('{"a":1}', false); michael@0: testJSON('{"a":"b"}', false); michael@0: testJSON('{"a":true}', false); michael@0: testJSON('[{}]', false); michael@0: michael@0: testJSON('[1,]', true); michael@0: testJSON('["a",]', true); michael@0: testJSON('{,}', true); michael@0: testJSON('{"a":1,}', true); michael@0: testJSON('{"a":"b",}', true); michael@0: testJSON('{"a":true,}', true); michael@0: testJSON('[{,}]', true); michael@0: testJSON('[[1,]]', true); michael@0: testJSON('[{"a":"b",}]', true);