~ubuntu-branches/ubuntu/saucy/mozjs17/saucy

« back to all changes in this revision

Viewing changes to js/src/tests/ecma_5/JSON/trailing-comma.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Any copyright is dedicated to the Public Domain.
 
2
// http://creativecommons.org/licenses/publicdomain/
 
3
 
 
4
var gTestfile = 'trailing-comma.js';
 
5
//-----------------------------------------------------------------------------
 
6
var BUGNUMBER = 564621;
 
7
var summary = 'JSON.parse should reject {"a" : "b",} or [1,]';
 
8
 
 
9
print(BUGNUMBER + ": " + summary);
 
10
 
 
11
/**************
 
12
 * BEGIN TEST *
 
13
 **************/
 
14
 
 
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);
 
23
 
 
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);