Merge pull request #1096 from lyzadanger/esid-builtins-encodeuricomponent

Add `esid` to built-ins/encodeURIComponent
This commit is contained in:
Leo Balter 2017-06-30 10:29:19 -04:00 committed by GitHub
commit 2cd4c42d40
29 changed files with 180 additions and 123 deletions

View File

@ -4,6 +4,8 @@
/*---
info: If string.charAt(k) in [0xDC00 - 0xDFFF], throw URIError
es5id: 15.1.3.4_A1.1_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests
includes: [decimalToHexString.js]
---*/
@ -14,31 +16,31 @@ var indexP;
var indexO = 0;
for (var index = 0xDC00; index <= 0xDFFF; index++) {
count++;
count++;
var hex = decimalToHexString(index);
try {
encodeURIComponent(String.fromCharCode(index));
} 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 string.charAt(k) in [0xDC00 - 0xDFFF], throw URIError
es5id: 15.1.3.4_A1.1_T2
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests
includes: [decimalToHexString.js]
---*/
@ -14,31 +16,31 @@ var indexP;
var indexO = 0;
for (var index = 0xDC00; index <= 0xDFFF; index++) {
count++;
count++;
var hex = decimalToHexString(index);
try {
encodeURIComponent(String.fromCharCode(index, 0x0041));
} 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

@ -6,6 +6,8 @@ info: >
If string.charAt(k) in [0xD800 - 0xDBFF] and string.length = k + 1, throw
URIError
es5id: 15.1.3.4_A1.2_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests
includes: [decimalToHexString.js]
---*/
@ -16,31 +18,31 @@ var indexP;
var indexO = 0;
for (var index = 0xD800; index <= 0xDBFF; index++) {
count++;
count++;
var hex = decimalToHexString(index);
try {
encodeURIComponent(String.fromCharCode(index));
} 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 string.charAt(k) in [0xD800 - 0xDBFF] and string.length = k + 1, throw
URIError
es5id: 15.1.3.4_A1.2_T2
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests
includes: [decimalToHexString.js]
---*/
@ -16,31 +18,31 @@ var indexP;
var indexO = 0;
for (var index = 0xD800; index <= 0xDBFF; index++) {
count++;
count++;
var hex = decimalToHexString(index);
try {
encodeURIComponent(String.fromCharCode(0x0041, index));
} 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 string.charAt(k) in [0xD800 - 0xDBFF] and string.charAt(k+1) not in
[0xDC00 - 0xDFFF], throw URIError
es5id: 15.1.3.4_A1.3_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: >
Complex tests, string.charAt(k+1) in [0x0000, 0xD7FF, 0xD800,
0xDBFE, 0xDBFF, 0xE000, 0xFFFF]
@ -19,37 +21,37 @@ var indexP;
var indexO = 0;
for (var index = 0xD800; index <= 0xDBFF; index++) {
count++;
count++;
var res = true;
for (var indexC = 0; indexC < chars.length; indexC++) {
var hex = decimalToHexString(index);
try {
encodeURIComponent(String.fromCharCode(index, chars[indexC]));
} catch (e) {
encodeURIComponent(String.fromCharCode(index, chars[indexC]));
} catch (e) {
if ((e instanceof URIError) === true) continue;
}
res = false;
}
if (res !== 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) {
@ -60,6 +62,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 string.charAt(k) in [0x0000 - 0x007F]\[uriUnescaped], return 1 octet
(00000000 0zzzzzzz -> 0zzzzzzz)
es5id: 15.1.3.4_A2.1_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests, use RFC 3629
includes: [decimalToHexString.js]
---*/
@ -16,33 +18,33 @@ var count = 0;
var indexP;
var indexO = 0;
l :
l :
for (var index = 0x0000; index <= 0x007F; index++) {
count++;
var str = String.fromCharCode(index);
for (var indexC = 0; indexC < uriUnescaped.length; indexC++) {
if (uriUnescaped[indexC] === str) continue l;
}
}
if (encodeURIComponent(str).toUpperCase() === decimalToPercentHexString(index)) continue l;
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) {
@ -53,6 +55,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 string.charAt(k) in [0x0080 - 0x07FF], return 2 octets (00000yyy
yyzzzzzz -> 110yyyyy 10zzzzzz)
es5id: 15.1.3.4_A2.2_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests, use RFC 3629
includes: [decimalToHexString.js]
---*/
@ -13,33 +15,33 @@ includes: [decimalToHexString.js]
var errorCount = 0;
var count = 0;
var indexP;
var indexO = 0;
var indexO = 0;
l:
for (var index = 0x0080; index <= 0x07FF; index++) {
count++;
count++;
var hex1 = decimalToPercentHexString(0x0080 + (index & 0x003F));
var hex2 = decimalToPercentHexString(0x00C0 + (index & 0x07C0) / 0x0040);
var str = String.fromCharCode(index);
if (encodeURIComponent(str).toUpperCase() === hex2 + hex1) 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) {
@ -50,6 +52,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 string.charAt(k) in [0x0800 - 0xD7FF], return 3 octets (xxxxyyyy
yyzzzzzz -> 1110xxxx 10yyyyyy 10zzzzzz)
es5id: 15.1.3.4_A2.3_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests, use RFC 3629
includes: [decimalToHexString.js]
---*/
@ -13,34 +15,34 @@ includes: [decimalToHexString.js]
var errorCount = 0;
var count = 0;
var indexP;
var indexO = 0;
var indexO = 0;
for (var index = 0x0800; index <= 0xD7FF; index++) {
count++;
count++;
var hex1 = decimalToPercentHexString(0x0080 + (index & 0x003F));
var hex2 = decimalToPercentHexString(0x0080 + (index & 0x0FC0) / 0x0040);
var hex3 = decimalToPercentHexString(0x00E0 + (index & 0xF000) / 0x1000);
var str = String.fromCharCode(index);
if (encodeURIComponent(str).toUpperCase() === hex3 + hex2 + hex1) 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) {
if ((indexP - indexO) !== 0) {
@ -50,6 +52,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: >
[0xDC00 <EFBFBD> 0xDFFF], return 4 octets (000wwwxx xxxxyyyy yyzzzzzz ->
11110www 10xxxxxx 10yyyyyy 10zzzzzz)
es5id: 15.1.3.4_A2.4_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: >
Complex tests, use RFC 3629, string.charAt(k+1) in [0xDC00,
0xDDFF, 0xDFFF]
@ -17,7 +19,7 @@ var chars = [0xDC00, 0xDDFF, 0xDFFF];
var errorCount = 0;
var count = 0;
var indexP;
var indexO = 0;
var indexO = 0;
for (var index = 0xD800; index <= 0xDBFF; index++) {
var res = true;
for (var indexC = 0; indexC < chars.length; indexC++) {
@ -31,27 +33,27 @@ for (var index = 0xD800; index <= 0xDBFF; index++) {
res = false;
}
if (res !== true) {
if (indexO === 0) {
if (res !== true) {
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++;
}
count++;
count++;
}
if (errorCount > 0) {
@ -62,6 +64,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: >
[0xDC00 <EFBFBD> 0xDFFF], return 4 octets (000wwwxx xxxxyyyy yyzzzzzz ->
11110www 10xxxxxx 10yyyyyy 10zzzzzz)
es5id: 15.1.3.4_A2.4_T2
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: >
Complex tests, use RFC 3629, string.charAt(k) in [0xD800, 0xDBFF,
0xD9FF]
@ -17,7 +19,7 @@ var chars = [0xD800, 0xDBFF, 0xD9FF];
var errorCount = 0;
var count = 0;
var indexP;
var indexO = 0;
var indexO = 0;
for (var index = 0xDC00; index <= 0xDFFF; index++) {
var res = true;
for (var indexC = 0; indexC < chars.length; indexC++) {
@ -31,27 +33,27 @@ for (var index = 0xDC00; index <= 0xDFFF; index++) {
res = false;
}
if (res !== true) {
if (indexO === 0) {
if (res !== true) {
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++;
}
count++;
count++;
}
if (errorCount > 0) {
@ -62,6 +64,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 string.charAt(k) in [0xE000 - 0xFFFF], return 3 octets (xxxxyyyy
yyzzzzzz -> 1110xxxx 10yyyyyy 10zzzzzz)
es5id: 15.1.3.4_A2.5_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests, use RFC 3629
includes: [decimalToHexString.js]
---*/
@ -13,33 +15,33 @@ includes: [decimalToHexString.js]
var errorCount = 0;
var count = 0;
var indexP;
var indexO = 0;
var indexO = 0;
for (var index = 0xE000; index <= 0xFFFF; index++) {
count++;
count++;
var hex1 = decimalToPercentHexString(0x0080 + (index & 0x003F));
var hex2 = decimalToPercentHexString(0x0080 + (index & 0x0FC0) / 0x0040);
var hex3 = decimalToPercentHexString(0x00E0 + (index & 0xF000) / 0x1000);
var str = String.fromCharCode(index);
if (encodeURIComponent(str).toUpperCase() === hex3 + hex2 + hex1) 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) {
@ -50,6 +52,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: unescapedURIComponentSet not containing uriReserved
es5id: 15.1.3.4_A3.1_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Complex tests
---*/
@ -13,5 +15,5 @@ for (var indexC = 0; indexC < 10; indexC++) {
var str = uriReserved_[indexC];
if (encodeURIComponent(str) !== uriReserved[indexC]) {
$ERROR('#' + (indexC + 1) + ': unescapedURIComponentSet not containing' + str);
}
}
}

View File

@ -6,13 +6,15 @@ info: >
unescapedURIComponentSet containing one instance of each character valid
in uriUnescaped
es5id: 15.1.3.4_A3.2_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: "Complex tests, uriUnescaped :: uriAlpha"
---*/
var uriAlpha = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
for (var indexC = 0; indexC < uriAlpha.length; indexC++) {
var str = uriAlpha[indexC];
var str = uriAlpha[indexC];
if (encodeURIComponent(str) !== str) {
$ERROR('#' + (indexC + 1) + ': unescapedURISet containing ' + str);
}
}
}

View File

@ -6,13 +6,15 @@ info: >
unescapedURIComponentSet containing one instance of each character valid
in uriUnescaped
es5id: 15.1.3.4_A3.2_T2
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: "Complex tests, uriUnescaped :: DecimalDigit"
---*/
var DecimalDigit = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
for (var indexC = 0; indexC < DecimalDigit.length; indexC++) {
var str = DecimalDigit[indexC];
var str = DecimalDigit[indexC];
if (encodeURIComponent(str) !== str) {
$ERROR('#' + (indexC + 1) + ': unescapedURISet containing' + str);
}
}
}

View File

@ -6,13 +6,15 @@ info: >
unescapedURIComponentSet containing one instance of each character valid
in uriUnescaped
es5id: 15.1.3.4_A3.2_T3
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: "Complex tests, uriUnescaped :: uriMark"
---*/
var uriMark = ["-", "_", ".", "!", "~", "*", "'", "(", ")"];
for (var indexC = 0; indexC < uriMark.length; indexC++) {
var str = uriMark[indexC];
var str = uriMark[indexC];
if (encodeURIComponent(str) !== str) {
$ERROR('#' + (indexC + 1) + ': unescapedURISet containing' + str);
}
}
}

View File

@ -4,6 +4,8 @@
/*---
info: unescapedURIComponentSet not containing "#"
es5id: 15.1.3.4_A3.3_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: encodeURIComponent("#") === "%23"
---*/

View File

@ -4,6 +4,8 @@
/*---
info: URI tests
es5id: 15.1.3.4_A4_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Checking ENGLISH ALPHABET
---*/

View File

@ -4,6 +4,8 @@
/*---
info: URI tests
es5id: 15.1.3.4_A4_T2
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Checking RUSSIAN ALPHABET
---*/

View File

@ -4,6 +4,8 @@
/*---
info: URI tests
es5id: 15.1.3.4_A4_T3
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Checking URL with Line Terminator
---*/

View File

@ -4,6 +4,8 @@
/*---
info: URI tests
es5id: 15.1.3.4_A4_T4
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Test some url
---*/
@ -20,7 +22,7 @@ if (encodeURIComponent("http://unipro.ru") !== "http%3A%2F%2Funipro.ru") {
//CHECK#3
if (encodeURIComponent("http://www.google.ru/support/jobs/bin/static.py?page=why-ru.html&sid=liveandwork") !== "http%3A%2F%2Fwww.google.ru%2Fsupport%2Fjobs%2Fbin%2Fstatic.py%3Fpage%3Dwhy-ru.html%26sid%3Dliveandwork") {
$ERROR('#3: http://www.google.ru/support/jobs/bin/static.py?page=why-ru.html&sid=liveandwork"');
}
}
//CHECK#4
if (encodeURIComponent("http://en.wikipedia.org/wiki/UTF-8#Description") !== "http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FUTF-8%23Description") {

View File

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

View File

@ -6,6 +6,8 @@ info: >
The length property of encodeURIComponent does not have the attribute
DontDelete
es5id: 15.1.3.4_A5.2
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Checking use hasOwnProperty, delete
---*/

View File

@ -4,6 +4,8 @@
/*---
info: The length property of encodeURIComponent has the attribute ReadOnly
es5id: 15.1.3.4_A5.3
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Checking if varying the length property fails
includes: [propertyHelper.js]
---*/

View File

@ -4,6 +4,8 @@
/*---
info: The length property of encodeURIComponent is 1
es5id: 15.1.3.4_A5.4
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: encodeURIComponent.length === 1
---*/

View File

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

View File

@ -4,6 +4,8 @@
/*---
info: The encodeURIComponent property has not prototype property
es5id: 15.1.3.4_A5.6
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: Checking encodeURIComponent.prototype
---*/

View File

@ -4,6 +4,8 @@
/*---
info: The encodeURIComponent property can't be used as constructor
es5id: 15.1.3.4_A5.7
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
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.4_A6_T1
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: If Type(value) is Object, evaluate ToPrimitive(value, String)
---*/
@ -17,7 +19,7 @@ if (encodeURIComponent(object) !== "%5Bobject%20Object%5D") {
var object = {valueOf: function() {return ""}, toString: function() {return "^"}};
if (encodeURIComponent(object) !== "%5E") {
$ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object)));
}
}
//CHECK#3
var object = {valueOf: function() {return "^"}, toString: function() {return {}}};
@ -57,11 +59,11 @@ try {
var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}};
encodeURIComponent(object);
$ERROR('#7.1: var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}}; encodeURIComponent(object) throw "error". Actual: ' + (encodeURIComponent(object)));
}
}
catch (e) {
if (e !== "error") {
$ERROR('#7.2: var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}}; encodeURIComponent(object) throw "error". Actual: ' + (e));
}
}
}
//CHECK#8
@ -69,9 +71,9 @@ try {
var object = {valueOf: function() {return {}}, toString: function() {return {}}};
encodeURIComponent(object);
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; encodeURIComponent(object) throw TypeError. Actual: ' + (encodeURIComponent(object)));
}
}
catch (e) {
if ((e instanceof TypeError) !== true) {
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; encodeURIComponent(object) throw TypeError. Actual: ' + (e));
}
}
}

View File

@ -3,6 +3,7 @@
/*---
es6id: 18.2.6.5
esid: sec-encodeuricomponent-uricomponent
description: >
encodeURIComponent.name is "encodeURIComponent".
info: >