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

« back to all changes in this revision

Viewing changes to js/src/tests/ecma_5/JSON/stringify-dropping-elements.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
// Ported from dom/src/json/test/unit/test_dropping_elements_in_stringify.js
 
2
 
 
3
assertEq(JSON.stringify({foo: 123}),
 
4
         '{"foo":123}');
 
5
assertEq(JSON.stringify({foo: 123, bar: function () {}}),
 
6
         '{"foo":123}');
 
7
assertEq(JSON.stringify({foo: 123, bar: function () {}, baz: 123}),
 
8
         '{"foo":123,"baz":123}');
 
9
 
 
10
assertEq(JSON.stringify([123]),
 
11
         '[123]');
 
12
assertEq(JSON.stringify([123, function () {}]),
 
13
         '[123,null]');
 
14
assertEq(JSON.stringify([123, function () {}, 456]),
 
15
         '[123,null,456]');
 
16
 
 
17
/******************************************************************************/
 
18
 
 
19
if (typeof reportCompare === "function")
 
20
  reportCompare(true, true);
 
21
 
 
22
print("Tests complete");