diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2018-02-09 11:35:37 -0500 |
---|---|---|
committer | Leo Balter <leonardo.balter@gmail.com> | 2018-02-09 11:35:37 -0500 |
commit | a01de4a722d088055a7d84d8c691ddd7109edb34 (patch) | |
tree | f583c8efd40a3b699261f1166da75a9861d83e7b /test/built-ins/JSON/stringify | |
parent | 7b01f9799f99851955f23c18c12e6651c1941022 (diff) | |
download | qtdeclarative-testsuites-a01de4a722d088055a7d84d8c691ddd7109edb34.tar.gz |
js-beautify: make all indentation consistent (depth & character) (#1409)
Diffstat (limited to 'test/built-ins/JSON/stringify')
50 files changed, 660 insertions, 465 deletions
diff --git a/test/built-ins/JSON/stringify/15.12.3-0-1.js b/test/built-ins/JSON/stringify/15.12.3-0-1.js index c79c6f026..5cc4240c7 100644 --- a/test/built-ins/JSON/stringify/15.12.3-0-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-0-1.js @@ -17,6 +17,6 @@ es5id: 15.12.3-0-1 description: JSON.stringify must exist as be a function ---*/ - var f = JSON.stringify; +var f = JSON.stringify; assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-0-2.js b/test/built-ins/JSON/stringify/15.12.3-0-2.js index 3f5fe1ec0..08e864d0c 100644 --- a/test/built-ins/JSON/stringify/15.12.3-0-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-0-2.js @@ -17,7 +17,7 @@ es5id: 15.12.3-0-2 description: JSON.stringify must exist as be a function taking 3 parameters ---*/ - var f = JSON.stringify; +var f = JSON.stringify; assert.sameValue(typeof(f), "function", 'typeof(f)'); assert.sameValue(f.length, 3, 'f.length'); diff --git a/test/built-ins/JSON/stringify/15.12.3-0-3.js b/test/built-ins/JSON/stringify/15.12.3-0-3.js index d8a575973..76e41ffb8 100644 --- a/test/built-ins/JSON/stringify/15.12.3-0-3.js +++ b/test/built-ins/JSON/stringify/15.12.3-0-3.js @@ -10,7 +10,7 @@ es5id: 15.12.3-0-3 description: JSON.stringify must be deletable (configurable) ---*/ - var o = JSON; - var desc = Object.getOwnPropertyDescriptor(o, "stringify"); +var o = JSON; +var desc = Object.getOwnPropertyDescriptor(o, "stringify"); assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-10.js b/test/built-ins/JSON/stringify/15.12.3-11-10.js index f15173196..c59045ebb 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-10.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-10.js @@ -8,4 +8,6 @@ description: > value can return undefined. ---*/ -assert.sameValue(JSON.stringify(42, function(k, v) { return undefined }), undefined, 'JSON.stringify(42, function(k, v) { return undefined })'); +assert.sameValue(JSON.stringify(42, function(k, v) { + return undefined +}), undefined, 'JSON.stringify(42, function(k, v) { return undefined })'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-11.js b/test/built-ins/JSON/stringify/15.12.3-11-11.js index da886044b..f4da04f92 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-11.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-11.js @@ -8,4 +8,8 @@ description: > can return undefined. ---*/ -assert.sameValue(JSON.stringify({prop:1}, function(k, v) { return undefined }), undefined, 'JSON.stringify({prop:1}, function(k, v) { return undefined })'); +assert.sameValue(JSON.stringify({ + prop: 1 +}, function(k, v) { + return undefined +}), undefined, 'JSON.stringify({prop:1}, function(k, v) { return undefined })'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-12.js b/test/built-ins/JSON/stringify/15.12.3-11-12.js index 5fdfea838..1238189a0 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-12.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-12.js @@ -8,4 +8,6 @@ description: > can return an Array. ---*/ -assert.sameValue(JSON.stringify(42, function(k, v) { return v==42 ?[4,2]:v }), '[4,2]', 'JSON.stringify(42, function(k, v) { return v==42 ?[4,2]:v })'); +assert.sameValue(JSON.stringify(42, function(k, v) { + return v == 42 ? [4, 2] : v +}), '[4,2]', 'JSON.stringify(42, function(k, v) { return v==42 ?[4,2]:v })'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-13.js b/test/built-ins/JSON/stringify/15.12.3-11-13.js index e98f67116..22b244c0b 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-13.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-13.js @@ -8,4 +8,8 @@ description: > can return an Object. ---*/ -assert.sameValue(JSON.stringify(42, function(k, v) { return v==42 ? {forty:2}: v}), '{"forty":2}', 'JSON.stringify(42, function(k, v) { return v==42 ? {forty:2}: v})'); +assert.sameValue(JSON.stringify(42, function(k, v) { + return v == 42 ? { + forty: 2 + } : v +}), '{"forty":2}', 'JSON.stringify(42, function(k, v) { return v==42 ? {forty:2}: v})'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-15.js b/test/built-ins/JSON/stringify/15.12.3-11-15.js index d2cb93191..5a4b35c96 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-15.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-15.js @@ -8,4 +8,6 @@ description: > returns the replacer value. ---*/ -assert.sameValue(JSON.stringify(function() {}, function(k,v) {return 99}), '99', 'JSON.stringify(function() {}, function(k,v) {return 99})'); +assert.sameValue(JSON.stringify(function() {}, function(k, v) { + return 99 +}), '99', 'JSON.stringify(function() {}, function(k,v) {return 99})'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-16.js b/test/built-ins/JSON/stringify/15.12.3-11-16.js index e9d92d5c2..23f89c2f9 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-16.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-16.js @@ -9,46 +9,48 @@ description: > step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-17.js b/test/built-ins/JSON/stringify/15.12.3-11-17.js index fe8a268b6..972323629 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-17.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-17.js @@ -9,46 +9,48 @@ description: > Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname": "John" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname": "John" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-18.js b/test/built-ins/JSON/stringify/15.12.3-11-18.js index 721fe41e3..6766a4e19 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-18.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-18.js @@ -9,46 +9,48 @@ description: > Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "name\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "name\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-19.js b/test/built-ins/JSON/stringify/15.12.3-11-19.js index c372e890f..052e394f2 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-19.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-19.js @@ -9,46 +9,48 @@ description: > operation Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-2.js b/test/built-ins/JSON/stringify/15.12.3-11-2.js index f6dc5e862..adc1c36c8 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-2.js @@ -8,4 +8,6 @@ description: > undefined value. ---*/ -assert.sameValue(JSON.stringify(undefined, function(k, v) { return "replacement" }), '"replacement"', 'JSON.stringify(undefined, function(k, v) { return "replacement" })'); +assert.sameValue(JSON.stringify(undefined, function(k, v) { + return "replacement" +}), '"replacement"', 'JSON.stringify(undefined, function(k, v) { return "replacement" })'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-20.js b/test/built-ins/JSON/stringify/15.12.3-11-20.js index 6b7c2e6f4..8c9bc2783 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-20.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-20.js @@ -9,46 +9,48 @@ description: > operation Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "na\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fme": "John" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "na\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fme": "John" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-21.js b/test/built-ins/JSON/stringify/15.12.3-11-21.js index e22b848cc..ca7e598d6 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-21.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-21.js @@ -9,46 +9,48 @@ description: > Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-22.js b/test/built-ins/JSON/stringify/15.12.3-11-22.js index 238b6c35f..eec132500 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-22.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-22.js @@ -9,46 +9,48 @@ description: > operation Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001FJohn" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001FJohn" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-23.js b/test/built-ins/JSON/stringify/15.12.3-11-23.js index c19435273..982968f34 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-23.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-23.js @@ -9,46 +9,48 @@ description: > Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "name": "John\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "name": "John\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-24.js b/test/built-ins/JSON/stringify/15.12.3-11-24.js index 17a9c9631..3fc4140a2 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-24.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-24.js @@ -9,46 +9,48 @@ description: > operation Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001FJohn\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001FJohn\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-25.js b/test/built-ins/JSON/stringify/15.12.3-11-25.js index 146d71200..9a26fa418 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-25.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-25.js @@ -9,46 +9,48 @@ description: > operation Quote(value) step 2.c) ---*/ - var result = true; +var result = true; - var expectedNullChars = new Array(); - expectedNullChars[0] = "\\u0000"; - expectedNullChars[1] = "\\u0001"; - expectedNullChars[2] = "\\u0002"; - expectedNullChars[3] = "\\u0003"; - expectedNullChars[4] = "\\u0004"; - expectedNullChars[5] = "\\u0005"; - expectedNullChars[6] = "\\u0006"; - expectedNullChars[7] = "\\u0007"; - expectedNullChars[8] = "\\b"; - expectedNullChars[9] = "\\t"; - expectedNullChars[10] = "\\n"; - expectedNullChars[11] = "\\u000b"; - expectedNullChars[12] = "\\f"; - expectedNullChars[13] = "\\r"; - expectedNullChars[14] = "\\u000e"; - expectedNullChars[15] = "\\u000f"; - expectedNullChars[16] = "\\u0010"; - expectedNullChars[17] = "\\u0011"; - expectedNullChars[18] = "\\u0012"; - expectedNullChars[19] = "\\u0013"; - expectedNullChars[20] = "\\u0014"; - expectedNullChars[21] = "\\u0015"; - expectedNullChars[22] = "\\u0016"; - expectedNullChars[23] = "\\u0017"; - expectedNullChars[24] = "\\u0018"; - expectedNullChars[25] = "\\u0019"; - expectedNullChars[26] = "\\u001a"; - expectedNullChars[27] = "\\u001b"; - expectedNullChars[28] = "\\u001c"; - expectedNullChars[29] = "\\u001d"; - expectedNullChars[30] = "\\u001e"; - expectedNullChars[31] = "\\u001f"; +var expectedNullChars = new Array(); +expectedNullChars[0] = "\\u0000"; +expectedNullChars[1] = "\\u0001"; +expectedNullChars[2] = "\\u0002"; +expectedNullChars[3] = "\\u0003"; +expectedNullChars[4] = "\\u0004"; +expectedNullChars[5] = "\\u0005"; +expectedNullChars[6] = "\\u0006"; +expectedNullChars[7] = "\\u0007"; +expectedNullChars[8] = "\\b"; +expectedNullChars[9] = "\\t"; +expectedNullChars[10] = "\\n"; +expectedNullChars[11] = "\\u000b"; +expectedNullChars[12] = "\\f"; +expectedNullChars[13] = "\\r"; +expectedNullChars[14] = "\\u000e"; +expectedNullChars[15] = "\\u000f"; +expectedNullChars[16] = "\\u0010"; +expectedNullChars[17] = "\\u0011"; +expectedNullChars[18] = "\\u0012"; +expectedNullChars[19] = "\\u0013"; +expectedNullChars[20] = "\\u0014"; +expectedNullChars[21] = "\\u0015"; +expectedNullChars[22] = "\\u0016"; +expectedNullChars[23] = "\\u0017"; +expectedNullChars[24] = "\\u0018"; +expectedNullChars[25] = "\\u0019"; +expectedNullChars[26] = "\\u001a"; +expectedNullChars[27] = "\\u001b"; +expectedNullChars[28] = "\\u001c"; +expectedNullChars[29] = "\\u001d"; +expectedNullChars[30] = "\\u001e"; +expectedNullChars[31] = "\\u001f"; - for (var index in expectedNullChars) { +for (var index in expectedNullChars) { - var str = JSON.stringify({ "name": "Jo\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fhn" }); - result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); - } + var str = JSON.stringify({ + "name": "Jo\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fhn" + }); + result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); +} assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-26.js b/test/built-ins/JSON/stringify/15.12.3-11-26.js index a04f354a0..142160ce5 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-26.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-26.js @@ -8,11 +8,11 @@ description: > abstract operation JA(value) step 10.b.iii) ---*/ - var arrObj = []; - arrObj[0] = "a"; - arrObj[1] = "b"; - arrObj[2] = "c"; +var arrObj = []; +arrObj[0] = "a"; +arrObj[1] = "b"; +arrObj[2] = "c"; - var jsonText = JSON.stringify(arrObj, undefined, "").toString(); +var jsonText = JSON.stringify(arrObj, undefined, "").toString(); assert.sameValue(jsonText.charAt(jsonText.length - 1), "]", 'jsonText.charAt(jsonText.length - 1)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-4-1.js b/test/built-ins/JSON/stringify/15.12.3-4-1.js index 0f7eafd11..d68148698 100644 --- a/test/built-ins/JSON/stringify/15.12.3-4-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-4-1.js @@ -8,4 +8,4 @@ description: > or arrays.. ---*/ -assert.sameValue(JSON.stringify([42],{}), '[42]', 'JSON.stringify([42],{})'); +assert.sameValue(JSON.stringify([42], {}), '[42]', 'JSON.stringify([42],{})'); diff --git a/test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js b/test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js index 719f653c9..0304b03c2 100644 --- a/test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js @@ -8,6 +8,15 @@ description: > Number values ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj,null, new Number(5)), JSON.stringify(obj,null, 5), 'JSON.stringify(obj,null, new Number(5))'); +assert.sameValue(JSON.stringify(obj, null, new Number(5)), JSON.stringify(obj, null, 5), 'JSON.stringify(obj,null, new Number(5))'); diff --git a/test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js b/test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js index 034123aec..baf3d06f5 100644 --- a/test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js @@ -8,6 +8,15 @@ description: > String values ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj,null, new String('xxx')), JSON.stringify(obj,null, 'xxx'), 'JSON.stringify(obj,null, new String("xxx"))'); +assert.sameValue(JSON.stringify(obj, null, new String('xxx')), JSON.stringify(obj, null, 'xxx'), 'JSON.stringify(obj,null, new String("xxx"))'); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-a-1.js b/test/built-ins/JSON/stringify/15.12.3-6-a-1.js index fd0d4ded4..2d7e6386f 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-a-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-a-1.js @@ -8,6 +8,15 @@ description: > same as a space argument of 10. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj,null, 10), JSON.stringify(obj,null, 100), 'JSON.stringify(obj,null, 10)'); +assert.sameValue(JSON.stringify(obj, null, 10), JSON.stringify(obj, null, 100), 'JSON.stringify(obj,null, 10)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-a-2.js b/test/built-ins/JSON/stringify/15.12.3-6-a-2.js index 1cfe50a80..16349f1f3 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-a-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-a-2.js @@ -8,6 +8,15 @@ description: > their integer part. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj,null, 5.99999), JSON.stringify(obj,null, 5), 'JSON.stringify(obj,null, 5.99999)'); +assert.sameValue(JSON.stringify(obj, null, 5.99999), JSON.stringify(obj, null, 5), 'JSON.stringify(obj,null, 5.99999)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-b-1.js b/test/built-ins/JSON/stringify/15.12.3-6-b-1.js index d5eea1024..d178f1eef 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-b-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-b-1.js @@ -8,7 +8,16 @@ description: > (0.999999)the same as empty string space argument. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; /* empty string should be same as no space arg */ -assert.sameValue(JSON.stringify(obj,null, 0.999999), JSON.stringify(obj)); +assert.sameValue(JSON.stringify(obj, null, 0.999999), JSON.stringify(obj)); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-b-2.js b/test/built-ins/JSON/stringify/15.12.3-6-b-2.js index d1bf8401b..504e939e6 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-b-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-b-2.js @@ -8,7 +8,16 @@ description: > same as empty string space argument. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; /* empty string should be same as no space arg */ -assert.sameValue(JSON.stringify(obj,null, 0), JSON.stringify(obj)); +assert.sameValue(JSON.stringify(obj, null, 0), JSON.stringify(obj)); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-b-3.js b/test/built-ins/JSON/stringify/15.12.3-6-b-3.js index 9310f9470..92db3c825 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-b-3.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-b-3.js @@ -8,7 +8,16 @@ description: > same as empty string space argument. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; - /* empty string should be same as no space arg */ - assert.sameValue(JSON.stringify(obj,null, -5), JSON.stringify(obj)); +/* empty string should be same as no space arg */ +assert.sameValue(JSON.stringify(obj, null, -5), JSON.stringify(obj)); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-b-4.js b/test/built-ins/JSON/stringify/15.12.3-6-b-4.js index de0330367..e492e43a3 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-b-4.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-b-4.js @@ -8,8 +8,17 @@ description: > is equivalent to a string of spaces of that length. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - var fiveSpaces = ' '; - // '12345' +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; +var fiveSpaces = ' '; +// '12345' -assert.sameValue(JSON.stringify(obj,null, 5), JSON.stringify(obj, null, fiveSpaces), 'JSON.stringify(obj,null, 5)'); +assert.sameValue(JSON.stringify(obj, null, 5), JSON.stringify(obj, null, fiveSpaces), 'JSON.stringify(obj,null, 5)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-7-a-1.js b/test/built-ins/JSON/stringify/15.12.3-7-a-1.js index e16a25e6f..fd579d854 100644 --- a/test/built-ins/JSON/stringify/15.12.3-7-a-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-7-a-1.js @@ -8,6 +8,15 @@ description: > arguments. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj,null, '0123456789xxxxxxxxx'), JSON.stringify(obj,null, '0123456789'), 'JSON.stringify(obj,null, "0123456789xxxxxxxxx")'); +assert.sameValue(JSON.stringify(obj, null, '0123456789xxxxxxxxx'), JSON.stringify(obj, null, '0123456789'), 'JSON.stringify(obj,null, "0123456789xxxxxxxxx")'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-1.js b/test/built-ins/JSON/stringify/15.12.3-8-a-1.js index c95e950e6..7fc0583f6 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-1.js @@ -8,6 +8,15 @@ description: > missing space argument. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, ''), 'JSON.stringify(obj)'); +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj, null, ''), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-2.js b/test/built-ins/JSON/stringify/15.12.3-8-a-2.js index 0443eb753..eacd51d52 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-2.js @@ -8,6 +8,15 @@ description: > missing space argument. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, true), 'JSON.stringify(obj)'); +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj, null, true), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-3.js b/test/built-ins/JSON/stringify/15.12.3-8-a-3.js index 6d4bc3eb8..072eb9d53 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-3.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-3.js @@ -8,6 +8,15 @@ description: > space argument. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, null), 'JSON.stringify(obj)'); +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj, null, null), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-4.js b/test/built-ins/JSON/stringify/15.12.3-8-a-4.js index d13b9c5c8..7ac1a28ec 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-4.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-4.js @@ -8,6 +8,15 @@ description: > as a missing space argument. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, new Boolean(true)), 'JSON.stringify(obj)'); +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj, null, new Boolean(true)), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-5.js b/test/built-ins/JSON/stringify/15.12.3-8-a-5.js index 56532c4ec..4f05d178f 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-5.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-5.js @@ -8,6 +8,15 @@ description: > the same as a missing space argument. ---*/ - var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; +var obj = { + a1: { + b1: [1, 2, 3, 4], + b2: { + c1: 1, + c2: 2 + } + }, + a2: 'a2' +}; -assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, obj), 'JSON.stringify(obj)'); +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj, null, obj), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js index 6f6fa62da..447652a8b 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js @@ -8,9 +8,11 @@ description: > toJSON call to literal strings. ---*/ - var obj = { - prop:42, - toJSON: function () {return 'fortytwo objects'} - }; +var obj = { + prop: 42, + toJSON: function() { + return 'fortytwo objects' + } +}; assert.sameValue(JSON.stringify([obj]), '["fortytwo objects"]', 'JSON.stringify([obj])'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js index b665d8004..aa418fefd 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js @@ -8,9 +8,11 @@ description: > toJSON call to literal Number. ---*/ - var obj = { - prop:42, - toJSON: function () {return new Number(42)} - }; +var obj = { + prop: 42, + toJSON: function() { + return new Number(42) + } +}; assert.sameValue(JSON.stringify([obj]), '[42]', 'JSON.stringify([obj])'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js index 9a192f26c..6f4eaccdf 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js @@ -8,9 +8,11 @@ description: > toJSON call to literal Boolean values. ---*/ - var obj = { - prop:42, - toJSON: function () {return new Boolean(true)} - }; +var obj = { + prop: 42, + toJSON: function() { + return new Boolean(true) + } +}; assert.sameValue(JSON.stringify([obj]), '[true]', 'JSON.stringify([obj])'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-3-a-1.js b/test/built-ins/JSON/stringify/15.12.3_2-3-a-1.js index 853acb01d..aefb5d77c 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-3-a-1.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-3-a-1.js @@ -8,4 +8,6 @@ description: > replacer functions to literal strings. ---*/ -assert.sameValue(JSON.stringify([42], function(k,v) {return v===42? new String('fortytwo'):v}), '["fortytwo"]', 'JSON.stringify([42], function(k,v) {return v===42? new String("fortytwo"):v})'); +assert.sameValue(JSON.stringify([42], function(k, v) { + return v === 42 ? new String('fortytwo') : v +}), '["fortytwo"]', 'JSON.stringify([42], function(k,v) {return v===42? new String("fortytwo"):v})'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-3-a-2.js b/test/built-ins/JSON/stringify/15.12.3_2-3-a-2.js index 7888996d7..87b0df0ac 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-3-a-2.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-3-a-2.js @@ -8,4 +8,6 @@ description: > replacer functions to literal numbers. ---*/ -assert.sameValue(JSON.stringify([42], function(k,v) {return v===42? new Number(84):v}), '[84]', 'JSON.stringify([42], function(k,v) {return v===42? new Number(84):v})'); +assert.sameValue(JSON.stringify([42], function(k, v) { + return v === 42 ? new Number(84) : v +}), '[84]', 'JSON.stringify([42], function(k,v) {return v===42? new Number(84):v})'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-3-a-3.js b/test/built-ins/JSON/stringify/15.12.3_2-3-a-3.js index adb582fe2..a26ae4b2f 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-3-a-3.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-3-a-3.js @@ -8,4 +8,6 @@ description: > replacer functions to literal numbers. ---*/ -assert.sameValue(JSON.stringify([42], function(k,v) {return v===42? new Boolean(false):v}), '[false]', 'JSON.stringify([42], function(k,v) {return v===42? new Boolean(false):v})'); +assert.sameValue(JSON.stringify([42], function(k, v) { + return v === 42 ? new Boolean(false) : v +}), '[false]', 'JSON.stringify([42], function(k,v) {return v===42? new Boolean(false):v})'); diff --git a/test/built-ins/JSON/stringify/15.12.3_4-1-1.js b/test/built-ins/JSON/stringify/15.12.3_4-1-1.js index f9b5f68ab..40b42f574 100644 --- a/test/built-ins/JSON/stringify/15.12.3_4-1-1.js +++ b/test/built-ins/JSON/stringify/15.12.3_4-1-1.js @@ -6,9 +6,9 @@ es5id: 15.12.3_4-1-1 description: JSON.stringify a circular object throws a error ---*/ - var obj = {}; - obj.prop = obj; +var obj = {}; +obj.prop = obj; assert.throws(TypeError, function() { - JSON.stringify(obj); + JSON.stringify(obj); }); diff --git a/test/built-ins/JSON/stringify/15.12.3_4-1-2.js b/test/built-ins/JSON/stringify/15.12.3_4-1-2.js index a79907bd0..299853c91 100644 --- a/test/built-ins/JSON/stringify/15.12.3_4-1-2.js +++ b/test/built-ins/JSON/stringify/15.12.3_4-1-2.js @@ -6,9 +6,9 @@ es5id: 15.12.3_4-1-2 description: JSON.stringify a circular object throws a TypeError ---*/ - var obj = {}; - obj.prop = obj; +var obj = {}; +obj.prop = obj; assert.throws(TypeError, function() { - JSON.stringify(obj); + JSON.stringify(obj); }); diff --git a/test/built-ins/JSON/stringify/15.12.3_4-1-3.js b/test/built-ins/JSON/stringify/15.12.3_4-1-3.js index 30d0a4339..feb1a6c9c 100644 --- a/test/built-ins/JSON/stringify/15.12.3_4-1-3.js +++ b/test/built-ins/JSON/stringify/15.12.3_4-1-3.js @@ -6,9 +6,13 @@ es5id: 15.12.3_4-1-3 description: JSON.stringify a indirectly circular object throws a error ---*/ - var obj = {p1: {p2: {}}}; - obj.p1.p2.prop = obj; +var obj = { + p1: { + p2: {} + } +}; +obj.p1.p2.prop = obj; assert.throws(TypeError, function() { - JSON.stringify(obj); + JSON.stringify(obj); }); diff --git a/test/built-ins/JSON/stringify/bigint-order.js b/test/built-ins/JSON/stringify/bigint-order.js index 7dc1d9672..a6de33687 100644 --- a/test/built-ins/JSON/stringify/bigint-order.js +++ b/test/built-ins/JSON/stringify/bigint-order.js @@ -27,16 +27,19 @@ let step; function replacer(x, k, v) { assert.sameValue(step++, 1); - assert.sameValue(v, 1n); + assert.sameValue(v, 1 n); return x; } -BigInt.prototype.toJSON = function () { assert.sameValue(step++, 0); return 1n; }; +BigInt.prototype.toJSON = function() { + assert.sameValue(step++, 0); + return 1 n; +}; step = 0; -assert.throws(TypeError, () => JSON.stringify(0n, (k, v) => replacer(2n, k, v))); +assert.throws(TypeError, () => JSON.stringify(0 n, (k, v) => replacer(2 n, k, v))); assert.sameValue(step, 2); step = 0; -assert.throws(TypeError, () => JSON.stringify(0n, (k, v) => replacer(Object(2n), k, v))); +assert.throws(TypeError, () => JSON.stringify(0 n, (k, v) => replacer(Object(2 n), k, v))); assert.sameValue(step, 2); diff --git a/test/built-ins/JSON/stringify/bigint-replacer.js b/test/built-ins/JSON/stringify/bigint-replacer.js index 03878ec5c..72e19c149 100644 --- a/test/built-ins/JSON/stringify/bigint-replacer.js +++ b/test/built-ins/JSON/stringify/bigint-replacer.js @@ -14,11 +14,13 @@ features: [BigInt] function replacer(k, v) { - if (typeof v === "bigint") - return "bigint"; - else - return v; + if (typeof v === "bigint") + return "bigint"; + else + return v; } assert.sameValue(JSON.stringify(0n, replacer), '"bigint"'); -assert.sameValue(JSON.stringify({x: 0n}, replacer), '{"x":"bigint"}'); +assert.sameValue(JSON.stringify({ + x: 0n +}, replacer), '{"x":"bigint"}'); diff --git a/test/built-ins/JSON/stringify/bigint-tojson.js b/test/built-ins/JSON/stringify/bigint-tojson.js index bf4f531f2..c314d74bd 100644 --- a/test/built-ins/JSON/stringify/bigint-tojson.js +++ b/test/built-ins/JSON/stringify/bigint-tojson.js @@ -14,5 +14,7 @@ info: | features: [BigInt] ---*/ -BigInt.prototype.toJSON = function () { return this.toString(); }; +BigInt.prototype.toJSON = function() { + return this.toString(); +}; assert.sameValue(JSON.stringify(0n), '"0"'); diff --git a/test/built-ins/JSON/stringify/bigint.js b/test/built-ins/JSON/stringify/bigint.js index 80d17799e..bba26f4dc 100644 --- a/test/built-ins/JSON/stringify/bigint.js +++ b/test/built-ins/JSON/stringify/bigint.js @@ -9,4 +9,6 @@ features: [BigInt] assert.throws(TypeError, () => JSON.stringify(0n)); assert.throws(TypeError, () => JSON.stringify(Object(0n))); -assert.throws(TypeError, () => JSON.stringify({x: 0n})); +assert.throws(TypeError, () => JSON.stringify({ + x: 0n +})); diff --git a/test/built-ins/JSON/stringify/replacer-proxy.js b/test/built-ins/JSON/stringify/replacer-proxy.js index 9ac8d5bb5..8ec585a98 100644 --- a/test/built-ins/JSON/stringify/replacer-proxy.js +++ b/test/built-ins/JSON/stringify/replacer-proxy.js @@ -36,10 +36,14 @@ var arrayProxyProxy = new Proxy(arrayProxy, {}); assert.sameValue(JSON.stringify(objectProxy), '{}'); assert.sameValue(JSON.stringify(arrayProxy), '[]', 'proxy for an array'); assert.sameValue( - JSON.stringify([[arrayProxy]]), '[[[]]]', 'proxy for an array (nested)' + JSON.stringify([ + [arrayProxy] + ]), '[[[]]]', 'proxy for an array (nested)' ); assert.sameValue( - JSON.stringify([[arrayProxyProxy]]), + JSON.stringify([ + [arrayProxyProxy] + ]), '[[[]]]', 'proxy for a proxy for an array (nested)' ); diff --git a/test/built-ins/JSON/stringify/value-proxy-revoked.js b/test/built-ins/JSON/stringify/value-proxy-revoked.js index 24b34f5dc..81cd50d98 100644 --- a/test/built-ins/JSON/stringify/value-proxy-revoked.js +++ b/test/built-ins/JSON/stringify/value-proxy-revoked.js @@ -38,5 +38,9 @@ assert.throws(TypeError, function() { }, 'top-level value'); assert.throws(TypeError, function() { - JSON.stringify([[[handle.proxy]]]); + JSON.stringify([ + [ + [handle.proxy] + ] + ]); }, 'nested value'); |