js/src/tests/ecma_5/JSON/stringify-dropping-elements.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // Ported from dom/src/json/test/unit/test_dropping_elements_in_stringify.js
     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}');
    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]');
    17 /******************************************************************************/
    19 if (typeof reportCompare === "function")
    20   reportCompare(true, true);
    22 print("Tests complete");

mercurial