1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_5/JSON/parse-syntax-errors-03.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +// Any copyright is dedicated to the Public Domain. 1.5 +// http://creativecommons.org/licenses/publicdomain/ 1.6 + 1.7 +testJSON('[', true); 1.8 +testJSON('[1', true); 1.9 +testJSON('[1,]', true); 1.10 +testJSON('[1,{', true); 1.11 +testJSON('[1,}', true); 1.12 +testJSON('[1,{]', true); 1.13 +testJSON('[1,}]', true); 1.14 +testJSON('[1,{"', true); 1.15 +testJSON('[1,}"', true); 1.16 +testJSON('[1,{"\\', true); 1.17 +testJSON('[1,}"\\', true); 1.18 +testJSON('[1,"', true); 1.19 +testJSON('[1,"\\', true); 1.20 + 1.21 +testJSON('{', true); 1.22 +testJSON('{1', true); 1.23 +testJSON('{,', true); 1.24 +testJSON('{"', true); 1.25 +testJSON('{"\\', true); 1.26 +testJSON('{"\\u', true); 1.27 +testJSON('{"\\uG', true); 1.28 +testJSON('{"\\u0', true); 1.29 +testJSON('{"\\u01', true); 1.30 +testJSON('{"\\u012', true); 1.31 +testJSON('{"\\u0123', true); 1.32 +testJSON('{"\\u0123"', true); 1.33 +testJSON('{"a"', true); 1.34 +testJSON('{"a"}', true); 1.35 +testJSON('{"a":', true); 1.36 +testJSON('{"a",}', true); 1.37 +testJSON('{"a":}', true); 1.38 +testJSON('{"a":,}', true); 1.39 +testJSON('{"a":5,}', true); 1.40 +testJSON('{"a":5,[', true); 1.41 +testJSON('{"a":5,"', true); 1.42 +testJSON('{"a":5,"', true); 1.43 +testJSON('{"a":5,"\\', true); 1.44 +testJSON("a[false ]".substring(1, 7) /* "[false" */, true); 1.45 + 1.46 +testJSON('this', true); 1.47 + 1.48 +testJSON('[1,{}]', false); 1.49 +testJSON('{}', false); 1.50 +testJSON('{"a":5}', false); 1.51 +testJSON('{"\\u0123":5}', false); 1.52 + 1.53 +/******************************************************************************/ 1.54 + 1.55 +if (typeof reportCompare === "function") 1.56 + reportCompare(true, true); 1.57 + 1.58 +print("Tests complete");