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 deleted file mode 100644 index 23f89c2f9ca8dccc38a465a228b7403dbfa666d7..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-16.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-16 -description: > - JSON.stringify - stringifying an object where property name is the - union of all null character (The abstract operation Quote(value) - step 2.c) ----*/ - -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"; - -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); -} - -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 deleted file mode 100644 index 9723236294182a0464b9ac6eaf531d35554f0f2f..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-17.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-17 -description: > - JSON.stringify - stringifying an object where property name starts - with the union of all null character (The abstract operation - Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -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 deleted file mode 100644 index 6766a4e199561889e0afa537c747ee8fd6d566c7..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-18.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-18 -description: > - JSON.stringify - stringifying an object where property name ends - with the union of all null character (The abstract operation - Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -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 deleted file mode 100644 index 052e394f27c9aacab093d00282e603296533bb44..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-19.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-19 -description: > - JSON.stringify - stringifying an object where property name starts - and ends with the union of all null character (The abstract - operation Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -assert(result, 'result !== true'); 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 deleted file mode 100644 index 8c9bc27838e03e85b909820697854d222a9c25c1..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-20.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-20 -description: > - JSON.stringify - stringifying an object where property name - middles with the union of all null character (The abstract - operation Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -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 deleted file mode 100644 index ca7e598d61c942a2738bb7386791f14257384823..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-21.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-21 -description: > - JSON.stringify - stringifying an object where property value is - the union of all null character (The abstract operation - Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -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 deleted file mode 100644 index eec1325004d82a8c207601cfc4697c6be4613c4f..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-22.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-22 -description: > - JSON.stringify - stringifying an object where property value - starts with the union of all null character (The abstract - operation Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -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 deleted file mode 100644 index 982968f34db12bbf4fba31480f94bb9cc7da7256..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-23.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-23 -description: > - JSON.stringify - stringifying an object where property value ends - with the union of all null character (The abstract operation - Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -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 deleted file mode 100644 index 3fc4140a2c953b2a6ca0214912bfb5a190175001..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-24.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-24 -description: > - JSON.stringify - stringifying an object where property value - starts and ends with the union of all null character (The abstract - operation Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -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 deleted file mode 100644 index 9a26fa418138329b7ecb4d9ad94fb9372f9a0acb..0000000000000000000000000000000000000000 --- a/test/built-ins/JSON/stringify/15.12.3-11-25.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.12.3-11-25 -description: > - JSON.stringify - stringifying an object where property value - middles with the union of all null character (The abstract - operation Quote(value) step 2.c) ----*/ - -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"; - -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); -} - -assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/string-escape-ascii.js b/test/built-ins/JSON/stringify/string-escape-ascii.js new file mode 100644 index 0000000000000000000000000000000000000000..5751c43fdb832142035f175ef0a319f5bc51e461 --- /dev/null +++ b/test/built-ins/JSON/stringify/string-escape-ascii.js @@ -0,0 +1,66 @@ +// Copyright (c) 2018 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-quotejsonstring +description: > + JSON.stringify property names and values containing ASCII + characters that require escaping +---*/ + +var char_to_json = { + '"': '\\"', + "\\": "\\\\", + "\x00": "\\u0000", + "\x01": "\\u0001", + "\x02": "\\u0002", + "\x03": "\\u0003", + "\x04": "\\u0004", + "\x05": "\\u0005", + "\x06": "\\u0006", + "\x07": "\\u0007", + "\x08": "\\b", + "\x09": "\\t", + "\x0A": "\\n", + "\x0B": "\\u000b", + "\x0C": "\\f", + "\x0D": "\\r", + "\x0E": "\\u000e", + "\x0F": "\\u000f", + "\x10": "\\u0010", + "\x11": "\\u0011", + "\x12": "\\u0012", + "\x13": "\\u0013", + "\x14": "\\u0014", + "\x15": "\\u0015", + "\x16": "\\u0016", + "\x17": "\\u0017", + "\x18": "\\u0018", + "\x19": "\\u0019", + "\x1A": "\\u001a", + "\x1B": "\\u001b", + "\x1C": "\\u001c", + "\x1D": "\\u001d", + "\x1E": "\\u001e", + "\x1F": "\\u001f" +} + +var chars = Object.keys(char_to_json).join(""); +var chars_reversed = Object.keys(char_to_json).reverse().join(""); +var jsonChars = Object.values(char_to_json).join(""); +var jsonChars_reversed = Object.values(char_to_json).reverse().join(""); +var json = JSON.stringify({ + ["name" + chars + chars_reversed]: chars_reversed + chars + "value" +}); + +for (var char in char_to_json) { + var count = json.split(char_to_json[char]).length - 1; + assert.sameValue(count, 4, + "Every ASCII 0x" + char.charCodeAt(0).toString(16) + " serializes to " + char_to_json[char]); +} + +assert.sameValue( + json, + `{"${"name" + jsonChars + jsonChars_reversed}":"${jsonChars_reversed + jsonChars + "value"}"}`, + "JSON.stringify(objectUsingControlCharacters)" +);