Merge pull request #1107 from lyzadanger/esid-builtins-decodeURIComponent

Add `esid` to built-ins/decodeURIComponent
This commit is contained in:
Leo Balter 2017-06-30 10:41:43 -04:00 committed by GitHub
commit 6e78d1805d
53 changed files with 440 additions and 335 deletions

View File

@ -6,6 +6,8 @@ info: >
If B = 110xxxxx (n = 2) and string.charAt(k + 4) and
string.charAt(k + 5) do not represent hexadecimal digits, throw URIError
es5id: 15.1.3.2_A1.10_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests
---*/
@ -16,15 +18,15 @@ for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try {
decodeURIComponent("%C0%" + String.fromCharCode(indexJ, indexJ));
result = false;
} catch (e) {
result = false;
} catch (e) {
if ((e instanceof URIError) !== true) {
result = false;
result = false;
}
}
}
}
}
}
}
if (result !== true) {
if (result !== true) {
$ERROR('#1: If B = 110xxxxx (n = 2) and (string.charAt(k + 4) and string.charAt(k + 5)) do not represent hexadecimal digits, throw URIError');
}

View File

@ -7,6 +7,8 @@ info: >
string.charAt(k + 5)) or (string.charAt(k + 7) and
string.charAt(k + 8)) do not represent hexadecimal digits, throw URIError
es5id: 15.1.3.2_A1.11_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests, string.charAt(k + 4) and string.charAt(k + 5) do
not represent hexadecimal digits
@ -19,15 +21,15 @@ for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try {
decodeURIComponent("%E0%" + String.fromCharCode(indexJ, indexJ) + "%A0");
result = false;
} catch (e) {
result = false;
} catch (e) {
if ((e instanceof URIError) !== true) {
result = false;
result = false;
}
}
}
}
}
}
}
if (result !== true) {
if (result !== true) {
$ERROR('#1: If B = 1110xxxx (n = 3) and (string.charAt(k + 4) and string.charAt(k + 5)) do not represent hexadecimal digits, throw URIError');
}

View File

@ -7,6 +7,8 @@ info: >
string.charAt(k + 5)) or (string.charAt(k + 7) and
string.charAt(k + 8)) do not represent hexadecimal digits, throw URIError
es5id: 15.1.3.2_A1.11_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests, string.charAt(k + 7) and string.charAt(k + 8) do
not represent hexadecimal digits
@ -19,15 +21,15 @@ for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try {
decodeURIComponent("%E0%" + "%A0" + String.fromCharCode(indexJ, indexJ));
result = false;
} catch (e) {
result = false;
} catch (e) {
if ((e instanceof URIError) !== true) {
result = false;
result = false;
}
}
}
}
}
}
}
if (result !== true) {
if (result !== true) {
$ERROR('#1: If B = 1110xxxx (n = 3) and (string.charAt(k + 7) and string.charAt(k + 8)) do not represent hexadecimal digits, throw URIError');
}

View File

@ -8,6 +8,8 @@ info: >
string.charAt(k + 8)) or (string.charAt(k + 10) and
string.charAt(k + 11)) do not represent hexadecimal digits, throw URIError
es5id: 15.1.3.2_A1.12_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests, string.charAt(k + 4) and string.charAt(k + 5) do
not represent hexadecimal digits
@ -20,15 +22,15 @@ for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try {
decodeURIComponent("%F0%" + String.fromCharCode(indexJ, indexJ) + "%A0%A0");
result = false;
} catch (e) {
result = false;
} catch (e) {
if ((e instanceof URIError) !== true) {
result = false;
result = false;
}
}
}
}
}
}
}
if (result !== true) {
if (result !== true) {
$ERROR('#1: If B = 11110xxx (n = 4) and (string.charAt(k + 4) and string.charAt(k + 5)) do not represent hexadecimal digits, throw URIError');
}

View File

@ -8,6 +8,8 @@ info: >
string.charAt(k + 8)) or (string.charAt(k + 10) and
string.charAt(k + 11)) do not represent hexadecimal digits, throw URIError
es5id: 15.1.3.2_A1.12_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests, string.charAt(k + 7) and string.charAt(k + 7) do
not represent hexadecimal digits
@ -20,15 +22,15 @@ for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try {
decodeURIComponent("%F0%" + "%A0" + String.fromCharCode(indexJ, indexJ) + "%A0");
result = false;
} catch (e) {
result = false;
} catch (e) {
if ((e instanceof URIError) !== true) {
result = false;
result = false;
}
}
}
}
}
}
}
if (result !== true) {
if (result !== true) {
$ERROR('#1: If B = 11110xxx (n = 4) and (string.charAt(k + 7) and string.charAt(k + 8)) do not represent hexadecimal digits, throw URIError');
}

View File

@ -8,6 +8,8 @@ info: >
string.charAt(k + 8)) or (string.charAt(k + 10) and
string.charAt(k + 11)) do not represent hexadecimal digits, throw URIError
es5id: 15.1.3.2_A1.12_T3
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests, string.charAt(k + 10) and string.charAt(k + 11) do
not represent hexadecimal digits
@ -20,15 +22,15 @@ for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try {
decodeURIComponent("%F0%" + "%A0%A0" + String.fromCharCode(indexJ, indexJ));
result = false;
} catch (e) {
result = false;
} catch (e) {
if ((e instanceof URIError) !== true) {
result = false;
result = false;
}
}
}
}
}
}
}
if (result !== true) {
if (result !== true) {
$ERROR('#1: If B = 11110xxx (n = 4) and (string.charAt(k + 10) and string.charAt(k + 11)) do not represent hexadecimal digits, throw URIError');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 110xxxxx (n = 2) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.13_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xC0 - 0xDF], C = [0x00, 0x7F]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xC0; indexB <= 0xDF; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + hexC);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 110xxxxx (n = 2) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.13_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xC0 - 0xDF], C = [0xC0, 0xFF]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xC0; indexB <= 0xDF; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + hexC);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 1110xxxx (n = 3) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.14_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xE0 - 0xEF], C = [0x00, 0x7F]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xE0; indexB <= 0xEF; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + hexC + "%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 1110xxxx (n = 3) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.14_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xE0 - 0xEF], C = [0x00, 0x7F]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xE0; indexB <= 0xEF; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + "%A0" + hexC);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 1110xxxx (n = 3) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.14_T3
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xE0 - 0xEF], C = [0xC0, 0xFF]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xE0; indexB <= 0xEF; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + hexC + "%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 1110xxxx (n = 3) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.14_T4
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xE0 - 0xEF], C = [0xC0, 0xFF]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xE0; indexB <= 0xEF; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + "%A0" + hexC);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.15_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xF0 - 0x0F7], C = [0x00, 0x7F]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + hexC + "%A0%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.15_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xF0 - 0x0F7], C = [0x00, 0x7F]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + "%A0" + hexC + "%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.15_T3
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xF0 - 0x0F7], C = [0x00, 0x7F]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + "%A0%A0" + hexC);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.15_T4
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xF0 - 0x0F7], C = [0xC0, 0xFF]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + hexC + "%A0%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.15_T5
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xF0 - 0x0F7], C = [0xC0, 0xFF]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + "%A0" + hexC + "%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
throw URIError
es5id: 15.1.3.2_A1.15_T6
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xF0 - 0x0F7], C = [0xC0, 0xFF]
includes: [decimalToHexString.js]
---*/
@ -16,37 +18,37 @@ var indexP;
var indexO = 0;
for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
count++;
count++;
var hexB = decimalToPercentHexString(indexB);
var result = true;
for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
var hexC = decimalToPercentHexString(indexC);
try {
decodeURIComponent(hexB + "%A0%A0" + hexC);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = indexB;
} else {
if ((indexB - indexP) !== 1) {
if ((indexB - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = indexB;
}
}
}
indexP = indexB;
errorCount++;
errorCount++;
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -4,6 +4,8 @@
/*---
info: If string.charAt(k) equal "%" and k + 2 >= string.length, throw URIError
es5id: 15.1.3.2_A1.1_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests
---*/

View File

@ -6,6 +6,8 @@ info: >
If B = string.charAt(k+1) + string.charAt(k+2) do not represent
hexadecimal digits, throw URIError
es5id: 15.1.3.2_A1.2_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests
---*/
@ -17,14 +19,14 @@ for (var indexI = 0; indexI < interval.length; indexI++) {
try {
decodeURIComponent("%" + String.fromCharCode(indexJ) + "1");
result = false;
} catch (e) {
} catch (e) {
if ((e instanceof URIError) !== true) {
result = false;
}
}
}
}
}
}
}
if (result !== true) {
if (result !== true) {
$ERROR('#1: If string.charAt(k+1) does not represent hexadecimal digits, throw URIError');
}

View File

@ -6,6 +6,8 @@ info: >
If B = string.charAt(k+1) + string.charAt(k+2) do not represent
hexadecimal digits, throw URIError
es5id: 15.1.3.2_A1.2_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests
---*/
@ -17,14 +19,14 @@ for (var indexI = 0; indexI < interval.length; indexI++) {
try {
decodeURIComponent("%" + "1" + String.fromCharCode(indexJ));
result = false;
} catch (e) {
} catch (e) {
if ((e instanceof URIError) !== true) {
result = false;
}
}
}
}
}
}
}
if (result !== true) {
if (result !== true) {
$ERROR('#1: If string.charAt(k+2) does not represent hexadecimal digits, throw URIError');
}

View File

@ -4,6 +4,8 @@
/*---
info: If B = 10xxxxxx or B = 11111xxx, throw URIError
es5id: 15.1.3.2_A1.3_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = 10xxxxxx -> B in [0x80 - 0xBF]
includes: [decimalToHexString.js]
---*/
@ -14,31 +16,31 @@ var indexP;
var indexO = 0;
for (var index = 0x80; index <= 0xBF; index++) {
count++;
count++;
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -49,6 +51,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -4,6 +4,8 @@
/*---
info: If B = 10xxxxxx or B = 11111xxx, throw URIError
es5id: 15.1.3.2_A1.3_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = 11111xxx -> B in [0xF8 - 0xFF]
includes: [decimalToHexString.js]
---*/
@ -14,31 +16,31 @@ var indexP;
var indexO = 0;
for (var index = 0xF8; index <= 0xFF; index++) {
count++;
count++;
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -49,6 +51,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -4,6 +4,8 @@
/*---
info: If B = 110xxxxx (n = 2) and (k + 2) + 3 >= length, throw URIError
es5id: 15.1.3.2_A1.4_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xC0 - 0xDF]
includes: [decimalToHexString.js]
---*/
@ -14,39 +16,39 @@ var indexP;
var indexO = 0;
for (var index = 0xC0; index <= 0xDF; index++) {
count++;
count++;
var str = "";
var result = true;
for (var len = 0; len < 3; len++) {
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + str);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
str = str + "1";
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
}
errorCount++;
}
}
if (errorCount > 0) {
@ -57,6 +59,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -4,6 +4,8 @@
/*---
info: If B = 1110xxxx (n = 3) and (k + 2) + 6 >= length, throw URIError
es5id: 15.1.3.2_A1.5_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xE0 - 0xEF]
includes: [decimalToHexString.js]
---*/
@ -14,39 +16,39 @@ var indexP;
var indexO = 0;
for (var index = 0xE0; index <= 0xEF; index++) {
count++;
count++;
var str = "";
var result = true;
for (var len = 0; len < 6; len++) {
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + str);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
str = str + "1";
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
}
errorCount++;
}
}
if (errorCount > 0) {
@ -57,6 +59,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -4,6 +4,8 @@
/*---
info: If B = 11110xxx (n = 4) and (k + 2) + 9 >= length, throw URIError
es5id: 15.1.3.2_A1.6_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xF0 - 0xF7]
includes: [decimalToHexString.js]
---*/
@ -14,39 +16,39 @@ var indexP;
var indexO = 0;
for (var index = 0xF0; index <= 0xF7; index++) {
count++;
count++;
var str = "";
var result = true;
for (var len = 0; len < 9; len++) {
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + str);
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
result = false;
str = str + "1";
}
if (result !== true) {
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
}
errorCount++;
}
}
if (errorCount > 0) {
@ -57,6 +59,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 110xxxxx (n = 2) and string.charAt(k + 3) not equal "%", throw
URIError
es5id: 15.1.3.2_A1.7_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests. B = [0xC0 - 0xDF]
includes: [decimalToHexString.js]
---*/
@ -16,31 +18,31 @@ var indexP;
var indexO = 0;
for (var index = 0xC0; index <= 0xDF; index++) {
count++;
count++;
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + "111");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -51,6 +53,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 1110xxxx (n = 3) and string.charAt(k + 3),
string.charAt(k + 6) not equal "%", throw URIError
es5id: 15.1.3.2_A1.8_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests. B = [0xE0 - 0xEF], string.charAt(k + 3) not equal "%"
includes: [decimalToHexString.js]
@ -17,31 +19,31 @@ var indexP;
var indexO = 0;
for (var index = 0xE0; index <= 0xEF; index++) {
count++;
count++;
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + "111%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -52,6 +54,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 1110xxxx (n = 3) and string.charAt(k + 3),
string.charAt(k + 6) not equal "%", throw URIError
es5id: 15.1.3.2_A1.8_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests. B = [0xE0 - 0xEF], string.charAt(k + 6) not equal "%"
includes: [decimalToHexString.js]
@ -17,31 +19,31 @@ var indexP;
var indexO = 0;
for (var index = 0xE0; index <= 0xEF; index++) {
count++;
count++;
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + "%A0111");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -52,6 +54,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and string.charAt(k + 3),
string.charAt(k + 6), string.charAt(k + 9) not equal "%", throw URIError
es5id: 15.1.3.2_A1.9_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests. B = [0xF0 - 0x0F7], string.charAt(k + 3) not equal "%"
includes: [decimalToHexString.js]
@ -17,31 +19,31 @@ var indexP;
var indexO = 0;
for (var index = 0xF0; index <= 0xF7; index++) {
count++;
count++;
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + "111%A0%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -52,6 +54,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and string.charAt(k + 3),
string.charAt(k + 6), string.charAt(k + 9) not equal "%", throw URIError
es5id: 15.1.3.2_A1.9_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests. B = [0xF0 - 0x0F7], string.charAt(k + 6) not equal "%"
includes: [decimalToHexString.js]
@ -17,31 +19,31 @@ var indexP;
var indexO = 0;
for (var index = 0xF0; index <= 0xF7; index++) {
count++;
count++;
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + "%A0111%A0");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -52,6 +54,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B = 11110xxx (n = 4) and string.charAt(k + 3),
string.charAt(k + 6), string.charAt(k + 9) not equal "%", throw URIError
es5id: 15.1.3.2_A1.9_T3
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
Complex tests. B = [0xF0 - 0x0F7], string.charAt(k + 9) not equal "%"
includes: [decimalToHexString.js]
@ -17,31 +19,31 @@ var indexP;
var indexO = 0;
for (var index = 0xF0; index <= 0xF7; index++) {
count++;
count++;
var hex = decimalToPercentHexString(index);
try {
decodeURIComponent(hex + "%A0%A0111");
} catch (e) {
if ((e instanceof URIError) === true) continue;
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -52,6 +54,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -4,6 +4,8 @@
/*---
info: If string.charAt(k) not equal "%", return this char
es5id: 15.1.3.2_A2.1_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests
includes: [decimalToHexString.js]
---*/
@ -14,20 +16,20 @@ var count = 0;
for (var indexI = 0; indexI <= 65535; indexI++) {
if (indexI !== 0x25) {
var hex = decimalToHexString(indexI);
try {
try {
var str = String.fromCharCode(indexI);
if (decodeURIComponent(str) !== str) {
if (decodeURIComponent(str) !== str) {
$ERROR('#' + hex + ' ');
errorCount++;
}
}
} catch (e){
$ERROR('#' + hex + ' ');
errorCount++;
}
}
count++;
}
}
}
if (errorCount > 0) {
if (errorCount > 0) {
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count);
}

View File

@ -4,6 +4,8 @@
/*---
info: If B1 = 0xxxxxxxx ([0x00 - 0x7F]), return B1
es5id: 15.1.3.2_A2.2_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests, use RFC 3629
includes: [decimalToHexString.js]
---*/
@ -15,28 +17,28 @@ var indexO = 0;
for (var indexB1 = 0x00; indexB1 <= 0x7F; indexB1++) {
count++;
var hexB1 = decimalToPercentHexString(indexB1);
var index = indexB1;
var index = indexB1;
var hex = String.fromCharCode(index);
if (decodeURIComponent(hexB1) === hex) continue;
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
if (errorCount > 0) {
@ -47,6 +49,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -6,6 +6,8 @@ info: >
If B1 = 110xxxxx ([0xC0 - 0xDF]), B2 = 10xxxxxx ([0x80 - 0xBF), without
B1 = [0xC0, 0xC1], return UTF8(B1, B2)
es5id: 15.1.3.2_A2.3_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests, use RFC 3629
includes: [decimalToHexString.js]
---*/
@ -20,27 +22,27 @@ for (var indexB1 = 0xC2; indexB1 <= 0xDF; indexB1++) {
for (var indexB2 = 0x80; indexB2 <= 0xBF; indexB2++) {
count++;
var hexB1_B2 = hexB1 + decimalToPercentHexString(indexB2);
var index = (indexB1 & 0x1F) * 0x40 + (indexB2 & 0x3F);
var index = (indexB1 & 0x1F) * 0x40 + (indexB2 & 0x3F);
if (decodeURIComponent(hexB1_B2) === String.fromCharCode(index)) continue;
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
}
@ -52,6 +54,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -7,6 +7,8 @@ info: >
without [B1, B2] = [0xE0, 0x80 - 0x9F], [0xED, 0xA0 - 0xBF] (0xD800 -
0xDFFF), return UTF8(B1, B2, B3)
es5id: 15.1.3.2_A2.4_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests, use RFC 3629
includes: [decimalToHexString.js]
---*/
@ -20,33 +22,33 @@ for (var indexB1 = 0xE0; indexB1 <= 0xEF; indexB1++) {
var hexB1 = decimalToPercentHexString(indexB1);
for (var indexB2 = 0x80; indexB2 <= 0xBF; indexB2++) {
if ((indexB1 === 0xE0) && (indexB2 <= 0x9F)) continue;
if ((indexB1 === 0xED) && (0xA0 <= indexB2)) continue;
if ((indexB1 === 0xED) && (0xA0 <= indexB2)) continue;
var hexB1_B2 = hexB1 + decimalToPercentHexString(indexB2);
for (var indexB3 = 0x80; indexB3 <= 0xBF; indexB3++) {
count++;
var hexB1_B2_B3 = hexB1_B2 + decimalToPercentHexString(indexB3);
var index = (indexB1 & 0x0F) * 0x1000 + (indexB2 & 0x3F) * 0x40 + (indexB3 & 0x3F);
var index = (indexB1 & 0x0F) * 0x1000 + (indexB2 & 0x3F) * 0x40 + (indexB3 & 0x3F);
if (decodeURIComponent(hexB1_B2_B3) === String.fromCharCode(index)) continue;
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
}
errorCount++;
}
}
}
@ -58,6 +60,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -7,6 +7,8 @@ info: >
0xBF]), without [B1, B2] = [0xF0, 0x80 - 0x9F], [0xF4, 0x90 - 0xBF],
return UTF8(B1, B2, B3, B4)
es5id: 15.1.3.2_A2.5_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests, use RFC 3629
includes: [decimalToHexString.js]
---*/
@ -19,7 +21,7 @@ var indexO = 0;
for (var indexB1 = 0xF0; indexB1 <= 0xF4; indexB1++) {
var hexB1 = decimalToPercentHexString(indexB1);
for (var indexB2 = 0x80; indexB2 <= 0xBF; indexB2++) {
if ((indexB1 === 0xF0) && (indexB2 <= 0x9F)) continue;
if ((indexB1 === 0xF0) && (indexB2 <= 0x9F)) continue;
if ((indexB1 === 0xF4) && (indexB2 >= 0x90)) continue;
var hexB1_B2 = hexB1 + decimalToPercentHexString(indexB2);
for (var indexB3 = 0x80; indexB3 <= 0xBF; indexB3++) {
@ -29,29 +31,29 @@ for (var indexB1 = 0xF0; indexB1 <= 0xF4; indexB1++) {
count++;
var index = (indexB1 & 0x07) * 0x40000 + (indexB2 & 0x3F) * 0x1000 + (indexB3 & 0x3F) * 0x40 + (indexB4 & 0x3F);
var L = ((index - 0x10000) & 0x03FF) + 0xDC00;
var H = (((index - 0x10000) >> 10) & 0x03FF) + 0xD800;
var H = (((index - 0x10000) >> 10) & 0x03FF) + 0xD800;
if (decodeURIComponent(hexB1_B2_B3_B4) === String.fromCharCode(H, L)) continue;
if (indexO === 0) {
if (indexO === 0) {
indexO = index;
} else {
if ((index - indexP) !== 1) {
if ((index - indexP) !== 1) {
if ((indexP - indexO) !== 0) {
var hexP = decimalToHexString(indexP);
var hexO = decimalToHexString(indexO);
$ERROR('#' + hexO + '-' + hexP + ' ');
}
}
else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
indexO = index;
}
}
}
indexP = index;
errorCount++;
errorCount++;
}
}
}
}
}
@ -63,6 +65,6 @@ if (errorCount > 0) {
} else {
var hexP = decimalToHexString(indexP);
$ERROR('#' + hexP + ' ');
}
}
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
}

View File

@ -4,6 +4,8 @@
/*---
info: Let reservedURIComponentSet be the empty string
es5id: 15.1.3.2_A3_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
uriReserved and "#" not in reservedURIComponentSet. HexDigit in
[0..9, A..F]

View File

@ -4,6 +4,8 @@
/*---
info: Let reservedURIComponentSet be the empty string
es5id: 15.1.3.2_A3_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
uriReserved and "#" not in reservedURIComponentSet. HexDigit in
[0..9, a..f]

View File

@ -4,6 +4,8 @@
/*---
info: Let reservedURIComponentSet be the empty string
es5id: 15.1.3.2_A3_T3
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex test
---*/

View File

@ -4,6 +4,8 @@
/*---
info: URI tests
es5id: 15.1.3.2_A4_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Checking ENGLISH ALPHABET
---*/

View File

@ -4,6 +4,8 @@
/*---
info: URI tests
es5id: 15.1.3.2_A4_T2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Checking RUSSIAN ALPHABET
---*/

View File

@ -4,6 +4,8 @@
/*---
info: URI tests
es5id: 15.1.3.2_A4_T3
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Checking URL with Line Terminator
---*/

View File

@ -4,6 +4,8 @@
/*---
info: URI tests
es5id: 15.1.3.2_A4_T4
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Test some url
---*/
@ -20,7 +22,7 @@ if (decodeURIComponent("http://unipro.ru") !== "http://unipro.ru") {
//CHECK#3
if (decodeURIComponent("http:%2f%2Fwww.google.ru/support/jobs/bin/static.py%3Fpage%3dwhy-ru.html%26sid%3Dliveandwork") !== "http://www.google.ru/support/jobs/bin/static.py?page=why-ru.html&sid=liveandwork") {
$ERROR('#3: http:%2f%2Fwww.google.ru/support/jobs/bin/static.py%3Fpage3dwhy-ru.html%26sid3Dliveandwork"');
}
}
//CHECK#4
if (decodeURIComponent("http:%2F%2Fen.wikipedia.org/wiki/UTF-8%23Description") !== "http://en.wikipedia.org/wiki/UTF-8#Description") {

View File

@ -4,6 +4,8 @@
/*---
info: The length property of decodeURIComponent has the attribute DontEnum
es5id: 15.1.3.2_A5.1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Checking use propertyIsEnumerable, for-in
---*/
@ -17,7 +19,7 @@ var result = true;
for (var p in decodeURIComponent){
if (p === "length") {
result = false;
}
}
}
if (result !== true) {

View File

@ -6,6 +6,8 @@ info: >
The length property of decodeURIComponent does not have the attribute
DontDelete
es5id: 15.1.3.2_A5.2
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Checking use hasOwnProperty, delete
---*/

View File

@ -4,6 +4,8 @@
/*---
info: The length property of decodeURIComponent has the attribute ReadOnly
es5id: 15.1.3.2_A5.3
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Checking if varying the length property fails
includes: [propertyHelper.js]
---*/

View File

@ -4,6 +4,8 @@
/*---
info: The length property of decodeURIComponent is 1
es5id: 15.1.3.2_A5.4
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: decodeURIComponent.length === 1
---*/

View File

@ -4,6 +4,8 @@
/*---
info: The decodeURIComponent property has the attribute DontEnum
es5id: 15.1.3.2_A5.5
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Checking use propertyIsEnumerable, for-in
---*/
@ -17,7 +19,7 @@ var result = true;
for (var p in this){
if (p === "decodeURIComponent") {
result = false;
}
}
}
if (result !== true) {

View File

@ -4,6 +4,8 @@
/*---
info: The decodeURIComponent property has not prototype property
es5id: 15.1.3.2_A5.6
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: Checking decodeURIComponent.prototype
---*/

View File

@ -4,6 +4,8 @@
/*---
info: The decodeURIComponent property can't be used as constructor
es5id: 15.1.3.2_A5.7
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
If property does not implement the internal [[Construct]] method,
throw a TypeError exception

View File

@ -4,6 +4,8 @@
/*---
info: Operator use ToString
es5id: 15.1.3.2_A6_T1
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: If Type(value) is Object, evaluate ToPrimitive(value, String)
---*/
@ -17,7 +19,7 @@ if (decodeURIComponent(object) !== "[object Object]") {
var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}};
if (decodeURIComponent(object) !== "^") {
$ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object)));
}
}
//CHECK#3
var object = {valueOf: function() {return "%5E"}, toString: function() {return {}}};
@ -57,11 +59,11 @@ try {
var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}};
decodeURIComponent(object);
$ERROR('#7.1: var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; decodeURIComponent(object) throw "error". Actual: ' + (decodeURIComponent(object)));
}
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; decodeURIComponent(object) throw "error". Actual: ' + (e));
}
}
}
//CHECK#8
@ -69,9 +71,9 @@ try {
var object = {valueOf: function() {return {}}, toString: function() {return {}}};
decodeURIComponent(object);
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; decodeURIComponent(object) throw TypeError. Actual: ' + (decodeURIComponent(object)));
}
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; decodeURIComponent(object) throw TypeError. Actual: ' + (e));
}
}
}

View File

@ -3,6 +3,7 @@
/*---
es6id: 18.2.6.3
esid: sec-decodeuricomponent-encodeduricomponent
description: >
decodeURIComponent.name is "decodeURIComponent".
info: >