built-ins/decode/* - built-ins/eval/*: make all indentation consistent (depth & character) (#1423)

This commit is contained in:
Rick Waldron 2018-02-15 15:50:18 -05:00 committed by Leo Balter
parent 1b30a976e8
commit b85474508c
71 changed files with 587 additions and 305 deletions

View File

@ -16,36 +16,36 @@ function otherScope(msg)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
var err1=Error('msg1'); var err1 = Error('msg1');
if(err1.message!=="msg1"){ if (err1.message !== "msg1") {
$ERROR('#1: var err1=Error(\'msg1\'); err1.message==="msg1". Actual: '+err1.message); $ERROR('#1: var err1=Error(\'msg1\'); err1.message==="msg1". Actual: ' + err1.message);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#2 //CHECK#2
var err2=otherScope('msg2'); var err2 = otherScope('msg2');
if(err2.message!=="msg2"){ if (err2.message !== "msg2") {
$ERROR('#2: function otherScope(msg){return Error(msg);} var err2=otherScope(\'msg2\'); err2.message==="msg2". Actual: '+err2.message); $ERROR('#2: function otherScope(msg){return Error(msg);} var err2=otherScope(\'msg2\'); err2.message==="msg2". Actual: ' + err2.message);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#3 //CHECK#3
var err3=otherScope(); var err3 = otherScope();
if(err3.hasOwnProperty('message')){ if (err3.hasOwnProperty('message')) {
$ERROR('#3: function otherScope(msg){return Error(msg);} var err3=otherScope(); err3.hasOwnProperty("message"). Actual: '+err3.message); $ERROR('#3: function otherScope(msg){return Error(msg);} var err3=otherScope(); err3.hasOwnProperty("message"). Actual: ' + err3.message);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#4 //CHECK#4
var err4=eval("Error('msg4')"); var err4 = eval("Error('msg4')");
if(err4.message!=="msg4"){ if (err4.message !== "msg4") {
$ERROR('#4: var err4=eval("Error(\'msg4\')"); err4.message==="msg4". Actual: '+err4.message); $ERROR('#4: var err4=eval("Error(\'msg4\')"); err4.message==="msg4". Actual: ' + err4.message);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -11,9 +11,9 @@ description: Checking prototype of the newly constructed Error object
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
var err1=Error('msg1'); var err1 = Error('msg1');
if(!Error.prototype.isPrototypeOf(err1)){ if (!Error.prototype.isPrototypeOf(err1)) {
$ERROR('#1: var err1=Error(\'msg1\'); Error.prototype.isPrototypeOf(err1) return true. Actual: '+Error.prototype.isPrototypeOf(err1)); $ERROR('#1: var err1=Error(\'msg1\'); Error.prototype.isPrototypeOf(err1) return true. Actual: ' + Error.prototype.isPrototypeOf(err1));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -11,10 +11,10 @@ description: >
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
Error.prototype.toString=Object.prototype.toString; Error.prototype.toString = Object.prototype.toString;
var err1=Error(); var err1 = Error();
if(err1.toString()!=='[object '+ 'Error' +']'){ if (err1.toString() !== '[object ' + 'Error' + ']') {
$ERROR('#1: Error.prototype.toString=Object.prototype.toString; var err1=Error(); err1.toString()===\'[object Error]\'. Actual: '+err1.toString()); $ERROR('#1: Error.prototype.toString=Object.prototype.toString; var err1=Error(); err1.toString()===\'[object Error]\'. Actual: ' + err1.toString());
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -11,10 +11,10 @@ description: Checking constructor of the newly constructed Error object
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
Error.prototype.toString=Object.prototype.toString; Error.prototype.toString = Object.prototype.toString;
var err1=Error(); var err1 = Error();
if(err1.constructor!==Error){ if (err1.constructor !== Error) {
$ERROR('#1: Error.prototype.toString=Object.prototype.toString; var err1=Error(); err1.constructor===Error. Actual: '+err1.constructor); $ERROR('#1: Error.prototype.toString=Object.prototype.toString; var err1=Error(); err1.constructor===Error. Actual: ' + err1.constructor);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -16,36 +16,36 @@ function otherScope(msg)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
var err1=new Error('msg1'); var err1 = new Error('msg1');
if(err1.message!=="msg1"){ if (err1.message !== "msg1") {
$ERROR('#1: var err1=new Error(\'msg1\'); err1.message==="msg1". Actual: '+err1.message); $ERROR('#1: var err1=new Error(\'msg1\'); err1.message==="msg1". Actual: ' + err1.message);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#2 //CHECK#2
var err2=otherScope('msg2'); var err2 = otherScope('msg2');
if(err2.message!=="msg2"){ if (err2.message !== "msg2") {
$ERROR('#2: function otherScope(msg){return new Error(msg);} var err2=otherScope(\'msg2\'); err2.message==="msg2". Actual: '+err2.message); $ERROR('#2: function otherScope(msg){return new Error(msg);} var err2=otherScope(\'msg2\'); err2.message==="msg2". Actual: ' + err2.message);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#3 //CHECK#3
var err3=otherScope(); var err3 = otherScope();
if(err3.hasOwnProperty('message')){ if (err3.hasOwnProperty('message')) {
$ERROR('#3: function otherScope(msg){return new Error(msg);} var err3=otherScope(); err3.hasOwnProperty("message"). Actual: '+err3.message); $ERROR('#3: function otherScope(msg){return new Error(msg);} var err3=otherScope(); err3.hasOwnProperty("message"). Actual: ' + err3.message);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#4 //CHECK#4
var err4=eval("new Error('msg4')"); var err4 = eval("new Error('msg4')");
if(err4.message!=="msg4"){ if (err4.message !== "msg4") {
$ERROR('#4: var err4=eval("new Error(\'msg4\')"); err4.message==="msg4". Actual: '+err4.message); $ERROR('#4: var err4=eval("new Error(\'msg4\')"); err4.message==="msg4". Actual: ' + err4.message);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -11,9 +11,9 @@ description: Checking prototype of the newly constructed Error object
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
var err1=new Error('msg1'); var err1 = new Error('msg1');
if(!Error.prototype.isPrototypeOf(err1)){ if (!Error.prototype.isPrototypeOf(err1)) {
$ERROR('#1: Error.prototype.isPrototypeOf(err1) return true. Actual: '+Error.prototype.isPrototypeOf(err1)); $ERROR('#1: Error.prototype.isPrototypeOf(err1) return true. Actual: ' + Error.prototype.isPrototypeOf(err1));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -11,10 +11,10 @@ description: >
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
Error.prototype.toString=Object.prototype.toString; Error.prototype.toString = Object.prototype.toString;
var err1=new Error(); var err1 = new Error();
if(err1.toString()!=='[object '+ 'Error' +']'){ if (err1.toString() !== '[object ' + 'Error' + ']') {
$ERROR('#1: err1.toString()===\'[object Error]\'. Actual: '+err1.toString()); $ERROR('#1: err1.toString()===\'[object Error]\'. Actual: ' + err1.toString());
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -13,17 +13,17 @@ description: >
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
var err1=Error("err"); var err1 = Error("err");
if(!Function.prototype.isPrototypeOf(err1.constructor)){ if (!Function.prototype.isPrototypeOf(err1.constructor)) {
$ERROR('#1: var err1=Error("err"); Function.prototype.isPrototypeOf(err1.constructor) return true. Actual:'+Function.prototype.isPrototypeOf(err1.constructor)); $ERROR('#1: var err1=Error("err"); Function.prototype.isPrototypeOf(err1.constructor) return true. Actual:' + Function.prototype.isPrototypeOf(err1.constructor));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#2 //CHECK#2
if(!Function.prototype.isPrototypeOf(Error.constructor)){ if (!Function.prototype.isPrototypeOf(Error.constructor)) {
$ERROR('#2: Function.prototype.isPrototypeOf(Error.constructor) return true. Actual:'+Function.prototype.isPrototypeOf(Error.constructor)); $ERROR('#2: Function.prototype.isPrototypeOf(Error.constructor) return true. Actual:' + Function.prototype.isPrototypeOf(Error.constructor));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -9,17 +9,17 @@ description: Checking length property
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
var err1=Error("err"); var err1 = Error("err");
if(err1.constructor.length!==1){ if (err1.constructor.length !== 1) {
$ERROR('#1: var err1=Error("err"); err1.constructor.length===1. Actual: '+err1.constructor.length); $ERROR('#1: var err1=Error("err"); err1.constructor.length===1. Actual: ' + err1.constructor.length);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#2 //CHECK#2
if(Error.constructor.length!==1){ if (Error.constructor.length !== 1) {
$ERROR('#2: Error.constructor.length===1. Actual: '+Error.constructor.length); $ERROR('#2: Error.constructor.length===1. Actual: ' + Error.constructor.length);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -8,7 +8,7 @@ description: Checking if deleting the Error.prototype property fails
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
var proto=Error.prototype; var proto = Error.prototype;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
verifyNotConfigurable(Error, "prototype"); verifyNotConfigurable(Error, "prototype");
@ -25,8 +25,8 @@ try {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#2 //CHECK#2
if(Error.prototype!==proto){ if (Error.prototype !== proto) {
$ERROR('#2: var proto=Error.prototype; delete Error.prototype; Error.prototype===proto. Actual: '+Error.prototype); $ERROR('#2: var proto=Error.prototype; delete Error.prototype; Error.prototype===proto. Actual: ' + Error.prototype);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -10,7 +10,7 @@ description: Checking if enumerating the Error.prototype property fails
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#0 //CHECK#0
if (!(Error.hasOwnProperty('prototype'))) { if (!(Error.hasOwnProperty('prototype'))) {
$ERROR('#0: Error.hasOwnProperty(\'prototype\') return true. Actual: '+Error.hasOwnProperty('prototype')); $ERROR('#0: Error.hasOwnProperty(\'prototype\') return true. Actual: ' + Error.hasOwnProperty('prototype'));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -19,7 +19,7 @@ if (!(Error.hasOwnProperty('prototype'))) {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#1 // CHECK#1
if (Error.propertyIsEnumerable('prototype')) { if (Error.propertyIsEnumerable('prototype')) {
$ERROR('#1: Error.propertyIsEnumerable(\'prototype\') return false. Actual: '+Error.propertyIsEnumerable('prototype')); $ERROR('#1: Error.propertyIsEnumerable(\'prototype\') return false. Actual: ' + Error.propertyIsEnumerable('prototype'));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -27,14 +27,14 @@ if (Error.propertyIsEnumerable('prototype')) {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#2 // CHECK#2
var cout=0; var cout = 0;
for (var p in Error){ for (var p in Error) {
if (p==="prototype") cout++; if (p === "prototype") cout++;
} }
if (cout !== 0) { if (cout !== 0) {
$ERROR('#2: cout === 0. Actual: '+cout ); $ERROR('#2: cout === 0. Actual: ' + cout);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -11,19 +11,21 @@ includes: [propertyHelper.js]
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
if (!(Error.hasOwnProperty('prototype'))) { if (!(Error.hasOwnProperty('prototype'))) {
$ERROR('#1: Error.hasOwnProperty(\'prototype\') return true. Actual: '+Error.hasOwnProperty('prototype')); $ERROR('#1: Error.hasOwnProperty(\'prototype\') return true. Actual: ' + Error.hasOwnProperty('prototype'));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
var __obj = Error.prototype; var __obj = Error.prototype;
verifyNotWritable(Error, "prototype", null, function(){return "shifted";}); verifyNotWritable(Error, "prototype", null, function() {
return "shifted";
});
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#2 //CHECK#2
if (Error.prototype !== __obj) { if (Error.prototype !== __obj) {
$ERROR('#2: __obj = Error.prototype; Error.prototype = function(){return "shifted";}; Error.prototype === __obj. Actual: '+Error.prototype ); $ERROR('#2: __obj = Error.prototype; Error.prototype = function(){return "shifted";}; Error.prototype === __obj. Actual: ' + Error.prototype);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -10,7 +10,7 @@ description: Checking Error.hasOwnProperty('prototype')
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
if (!(Error.hasOwnProperty('prototype'))) { if (!(Error.hasOwnProperty('prototype'))) {
$ERROR('#1: Error.hasOwnProperty(\'prototype\') return true. Actual: '+Error.hasOwnProperty('prototype')); $ERROR('#1: Error.hasOwnProperty(\'prototype\') return true. Actual: ' + Error.hasOwnProperty('prototype'));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -12,7 +12,7 @@ description: Get Error.prototype and compare with Object.prototype
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#1 // CHECK#1
if (!Object.prototype.isPrototypeOf(Error.prototype)) { if (!Object.prototype.isPrototypeOf(Error.prototype)) {
$ERROR('#1: Object.prototype.isPrototypeOf(Error.prototype) return true. Actual: '+Object.prototype.isPrototypeOf(Error.prototype)); $ERROR('#1: Object.prototype.isPrototypeOf(Error.prototype) return true. Actual: ' + Object.prototype.isPrototypeOf(Error.prototype));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -11,13 +11,13 @@ description: >
Error.prototype.toString() function Error.prototype.toString() function
---*/ ---*/
Error.prototype.toString=Object.prototype.toString; Error.prototype.toString = Object.prototype.toString;
var __tostr = Error.prototype.toString(); var __tostr = Error.prototype.toString();
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
if (__tostr !== "[object Object]") { if (__tostr !== "[object Object]") {
$ERROR('#1: Error.prototype.toString=Object.prototype.toString; __tostr = Error.prototype.toString(); __tostr === "[object Object]". Actual: '+__tostr ); $ERROR('#1: Error.prototype.toString=Object.prototype.toString; __tostr = Error.prototype.toString(); __tostr === "[object Object]". Actual: ' + __tostr);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -10,10 +10,10 @@ description: Checking if call of Error prototype as a function fails
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
try { try {
Error.prototype(); Error.prototype();
$ERROR('#1: "Error.prototype()" lead to throwing exception'); $ERROR('#1: "Error.prototype()" lead to throwing exception');
} catch (e) { } catch (e) {
if (e instanceof Test262Error) throw e; if (e instanceof Test262Error) throw e;
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -10,10 +10,10 @@ description: Checking if creating "new Error.prototype" fails
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
try { try {
var __instance = new Error.prototype; var __instance = new Error.prototype;
$ERROR('#1: "var __instance = new Error.prototype" lead to throwing exception'); $ERROR('#1: "var __instance = new Error.prototype" lead to throwing exception');
} catch (e) { } catch (e) {
if (e instanceof Test262Error) throw e; if (e instanceof Test262Error) throw e;
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -12,7 +12,7 @@ description: Checking Error.prototype.constructor
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//CHECK#1 //CHECK#1
if (Error.prototype.constructor !== Error) { if (Error.prototype.constructor !== Error) {
$ERROR('#1: Error.prototype.constructor === Error. Actual: '+Error.prototype.constructor ); $ERROR('#1: Error.prototype.constructor === Error. Actual: ' + Error.prototype.constructor);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -18,7 +18,7 @@ var err = new constr;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#0 // CHECK#0
if (err === undefined) { if (err === undefined) {
$ERROR('#0: constr = Error.prototype.constructor; err = new constr; err === undefined'); $ERROR('#0: constr = Error.prototype.constructor; err = new constr; err === undefined');
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -26,7 +26,7 @@ if (err === undefined) {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#1 // CHECK#1
if (err.constructor !== Error) { if (err.constructor !== Error) {
$ERROR('#1: constr = Error.prototype.constructor; err = new constr; err.constructor === Error. Actual: '+err.constructor ); $ERROR('#1: constr = Error.prototype.constructor; err = new constr; err.constructor === Error. Actual: ' + err.constructor);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -34,17 +34,17 @@ if (err.constructor !== Error) {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#2 // CHECK#2
if (!(Error.prototype.isPrototypeOf(err))) { if (!(Error.prototype.isPrototypeOf(err))) {
$ERROR('#2: constr = Error.prototype.constructor; err = new constr; Error.prototype.isPrototypeOf(err) return true. Actual: '+Error.prototype.isPrototypeOf(err)); $ERROR('#2: constr = Error.prototype.constructor; err = new constr; Error.prototype.isPrototypeOf(err) return true. Actual: ' + Error.prototype.isPrototypeOf(err));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#3 // CHECK#3
Error.prototype.toString=Object.prototype.toString; Error.prototype.toString = Object.prototype.toString;
var to_string_result = '[object '+ 'Error' +']'; var to_string_result = '[object ' + 'Error' + ']';
if (err.toString() !== to_string_result) { if (err.toString() !== to_string_result) {
$ERROR('#3: constr = Error.prototype.constructor; err = new constr; Error.prototype.toString=Object.prototype.toString; err.toString() === \'[object Error]\'. Actual: '+err.toString() ); $ERROR('#3: constr = Error.prototype.constructor; err = new constr; Error.prototype.toString=Object.prototype.toString; err.toString() === \'[object Error]\'. Actual: ' + err.toString());
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -52,7 +52,7 @@ if (err.toString() !== to_string_result) {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#4 // CHECK#4
if (err.valueOf().toString() !== to_string_result) { if (err.valueOf().toString() !== to_string_result) {
$ERROR('#4: constr = Error.prototype.constructor; err = new constr; Error.prototype.toString=Object.prototype.toString; err.valueOf().toString() === \'[object Error]\'. Actual: '+err.valueOf().toString() ); $ERROR('#4: constr = Error.prototype.constructor; err = new constr; Error.prototype.toString=Object.prototype.toString; err.valueOf().toString() === \'[object Error]\'. Actual: ' + err.valueOf().toString());
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -6,6 +6,6 @@ es5id: 15.11.4.3-1
description: Error.prototype.message is not enumerable. description: Error.prototype.message is not enumerable.
---*/ ---*/
for (var i in Error.prototype) { for (var i in Error.prototype) {
assert.notSameValue(i, "message", 'i'); assert.notSameValue(i, "message", 'i');
} }

View File

@ -10,7 +10,7 @@ description: Checking Error.prototype.message
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#1 // CHECK#1
if (!Error.prototype.hasOwnProperty('message')) { if (!Error.prototype.hasOwnProperty('message')) {
$ERROR('#1: Error.prototype.hasOwnProperty(\'message\') reurn true. Actual: '+Error.prototype.hasOwnProperty('message')); $ERROR('#1: Error.prototype.hasOwnProperty(\'message\') reurn true. Actual: ' + Error.prototype.hasOwnProperty('message'));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -6,6 +6,6 @@ es5id: 15.11.4.2-1
description: Error.prototype.name is not enumerable. description: Error.prototype.name is not enumerable.
---*/ ---*/
for (var i in Error.prototype) { for (var i in Error.prototype) {
assert.notSameValue(i, "name", 'i'); assert.notSameValue(i, "name", 'i');
} }

View File

@ -10,7 +10,7 @@ description: Checking Error.prototype.name
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#1 // CHECK#1
if (!Error.prototype.hasOwnProperty('name')) { if (!Error.prototype.hasOwnProperty('name')) {
$ERROR('#1: Error.prototype.hasOwnProperty(\'name\') return true. Actual: '+Error.prototype.hasOwnProperty('name')); $ERROR('#1: Error.prototype.hasOwnProperty(\'name\') return true. Actual: ' + Error.prototype.hasOwnProperty('name'));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -9,8 +9,8 @@ description: Checking value of Error.prototype.name
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#1 // CHECK#1
if (Error.prototype.name!=="Error") { if (Error.prototype.name !== "Error") {
$ERROR('#1: Error.prototype.name==="Error". Actual: '+Error.prototype.name); $ERROR('#1: Error.prototype.name==="Error". Actual: ' + Error.prototype.name);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -9,7 +9,7 @@ description: >
'msg' are non-empty string 'msg' are non-empty string
---*/ ---*/
var errObj = new Error("ErrorMessage"); var errObj = new Error("ErrorMessage");
errObj.name = "ErrorName"; errObj.name = "ErrorName";
assert.sameValue(errObj.toString(), "ErrorName: ErrorMessage", 'errObj.toString()'); assert.sameValue(errObj.toString(), "ErrorName: ErrorMessage", 'errObj.toString()');

View File

@ -8,6 +8,6 @@ description: >
absent and empty string is returned when 'msg' is undefined absent and empty string is returned when 'msg' is undefined
---*/ ---*/
var errObj = new Error(); var errObj = new Error();
assert.sameValue(errObj.toString(), "Error", 'errObj.toString()'); assert.sameValue(errObj.toString(), "Error", 'errObj.toString()');

View File

@ -9,6 +9,6 @@ description: >
string string
---*/ ---*/
var errObj = new Error("ErrorMessage"); var errObj = new Error("ErrorMessage");
assert.sameValue(errObj.toString(), "Error: ErrorMessage", 'errObj.toString()'); assert.sameValue(errObj.toString(), "Error: ErrorMessage", 'errObj.toString()');

View File

@ -8,7 +8,7 @@ description: >
empty string and 'msg' isn't undefined empty string and 'msg' isn't undefined
---*/ ---*/
var errObj = new Error("ErrorMessage"); var errObj = new Error("ErrorMessage");
errObj.name = ""; errObj.name = "";
assert.sameValue(errObj.toString(), "ErrorMessage", 'errObj.toString()'); assert.sameValue(errObj.toString(), "ErrorMessage", 'errObj.toString()');

View File

@ -11,8 +11,8 @@ description: >
var errObj = new Error(); var errObj = new Error();
errObj.name = ""; errObj.name = "";
if (errObj.name !== "") { if (errObj.name !== "") {
$ERROR("Expected errObj.name to be '', actually " + errObj.name); $ERROR("Expected errObj.name to be '', actually " + errObj.name);
} }
if (errObj.toString() !== "") { if (errObj.toString() !== "") {
$ERROR("Expected errObj.toString() to be '', actually " + errObj.toString()); $ERROR("Expected errObj.toString() to be '', actually " + errObj.toString());
} }

View File

@ -8,7 +8,7 @@ description: >
string and 'msg' is empty string string and 'msg' is empty string
---*/ ---*/
var errObj = new Error(); var errObj = new Error();
errObj.name = "ErrorName"; errObj.name = "ErrorName";
assert.sameValue(errObj.toString(), "ErrorName", 'errObj.toString()'); assert.sameValue(errObj.toString(), "ErrorName", 'errObj.toString()');

View File

@ -10,7 +10,7 @@ description: Checking Error.prototype.toString
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#1 // CHECK#1
if (!Error.prototype.hasOwnProperty('toString')) { if (!Error.prototype.hasOwnProperty('toString')) {
$ERROR('#1: Error.prototype.hasOwnProperty(\'toString\') return true. Actual: '+Error.prototype.hasOwnProperty('toString')); $ERROR('#1: Error.prototype.hasOwnProperty(\'toString\') return true. Actual: ' + Error.prototype.hasOwnProperty('toString'));
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -9,15 +9,15 @@ description: Checking if call of Error.prototype.toSting() fails
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// CHECK#1 // CHECK#1
var err1=new Error("Error"); var err1 = new Error("Error");
try{ try {
var toStr=err1.toString(); var toStr = err1.toString();
} }
catch(e){ catch (e) {
$ERROR('#1: var err1=new Error("Error"); var toStr=err1.toString(); lead to throwing exception. Exception is '+e); $ERROR('#1: var err1=new Error("Error"); var toStr=err1.toString(); lead to throwing exception. Exception is ' + e);
} }
if (toStr===undefined) { if (toStr === undefined) {
$ERROR('#2: var err1=new Error("Error"); var toStr=err1.toString(); toStr!==undefined. Actual: '+toStr); $ERROR('#2: var err1=new Error("Error"); var toStr=err1.toString(); toStr!==undefined. Actual: ' + toStr);
} }
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -13,7 +13,12 @@ description: Complex tests
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -16,7 +16,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -16,7 +16,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -17,7 +17,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -17,7 +17,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -17,7 +17,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -15,7 +15,7 @@ var result = true;
try { try {
decodeURI("%"); decodeURI("%");
result = false; result = false;
} catch(e) { } catch (e) {
if ((e instanceof URIError) !== true) { if ((e instanceof URIError) !== true) {
result = false; result = false;
} }
@ -25,7 +25,7 @@ try {
try { try {
decodeURI("%A"); decodeURI("%A");
result = false; result = false;
} catch(e) { } catch (e) {
if ((e instanceof URIError) !== true) { if ((e instanceof URIError) !== true) {
result = false; result = false;
} }
@ -35,7 +35,7 @@ try {
try { try {
decodeURI("%1"); decodeURI("%1");
result = false; result = false;
} catch(e) { } catch (e) {
if ((e instanceof URIError) !== true) { if ((e instanceof URIError) !== true) {
result = false; result = false;
} }
@ -45,7 +45,7 @@ try {
try { try {
decodeURI("% "); decodeURI("% ");
result = false; result = false;
} catch(e) { } catch (e) {
if ((e instanceof URIError) !== true) { if ((e instanceof URIError) !== true) {
result = false; result = false;
} }

View File

@ -13,7 +13,12 @@ description: Complex tests
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -13,7 +13,12 @@ description: Complex tests
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -22,7 +22,7 @@ for (var indexI = 0; indexI <= 65535; indexI++) {
$ERROR('#' + hex + ' '); $ERROR('#' + hex + ' ');
errorCount++; errorCount++;
} }
} catch (e){ } catch (e) {
$ERROR('#' + hex + ' '); $ERROR('#' + hex + ' ');
errorCount++; errorCount++;
} }

View File

@ -16,36 +16,36 @@ var indexP;
var indexO = 0; var indexO = 0;
var uriReserved = [";", "/", "?", ":", "@", "&", "=", "+", "$", ","]; var uriReserved = [";", "/", "?", ":", "@", "&", "=", "+", "$", ","];
l: l:
for (var indexB1 = 0x00; indexB1 <= 0x7F; indexB1++) { for (var indexB1 = 0x00; indexB1 <= 0x7F; indexB1++) {
count++; count++;
var hexB1 = decimalToPercentHexString(indexB1); var hexB1 = decimalToPercentHexString(indexB1);
var index = indexB1; var index = indexB1;
var hex = String.fromCharCode(index); var hex = String.fromCharCode(index);
for (var indexC = 0; indexC < uriReserved.length; indexC++) { for (var indexC = 0; indexC < uriReserved.length; indexC++) {
if (hex === uriReserved[indexC]) continue l; if (hex === uriReserved[indexC]) continue l;
}
if (hex === "#") continue;
if (decodeURI(hexB1) === hex) continue;
if (indexO === 0) {
indexO = index;
} else {
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;
} }
if (hex === "#") continue;
if (decodeURI(hexB1) === hex) continue;
if (indexO === 0) {
indexO = index;
} else {
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++;
} }
indexP = index;
errorCount++;
}
if (errorCount > 0) { if (errorCount > 0) {
if ((indexP - indexO) !== 0) { if ((indexP - indexO) !== 0) {

View File

@ -16,7 +16,7 @@ if (decodeURI.propertyIsEnumerable('length') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in decodeURI){ for (var p in decodeURI) {
if (p === "length") { if (p === "length") {
result = false; result = false;
} }

View File

@ -16,7 +16,7 @@ if (this.propertyIsEnumerable('decodeURI') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in this){ for (var p in this) {
if (p === "decodeURI") { if (p === "decodeURI") {
result = false; result = false;
} }

View File

@ -10,26 +10,51 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, String)
---*/ ---*/
//CHECK#1 //CHECK#1
var object = {valueOf: function() {return "%5E"}}; var object = {
valueOf: function() {
return "%5E"
}
};
if (decodeURI(object) !== "[object Object]") { if (decodeURI(object) !== "[object Object]") {
$ERROR('#1: var object = {valueOf: function() {return "%5E"}}; decodeURI(object) === [object Object]. Actual: ' + (decodeURI(object))); $ERROR('#1: var object = {valueOf: function() {return "%5E"}}; decodeURI(object) === [object Object]. Actual: ' + (decodeURI(object)));
} }
//CHECK#2 //CHECK#2
var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}}; var object = {
valueOf: function() {
return ""
},
toString: function() {
return "%5E"
}
};
if (decodeURI(object) !== "^") { if (decodeURI(object) !== "^") {
$ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object))); $ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
} }
//CHECK#3 //CHECK#3
var object = {valueOf: function() {return "%5E"}, toString: function() {return {}}}; var object = {
valueOf: function() {
return "%5E"
},
toString: function() {
return {}
}
};
if (decodeURI(object) !== "^") { if (decodeURI(object) !== "^") {
$ERROR('#3: var object = {valueOf: function() {return "%5E"}, toString: function() {return {}}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object))); $ERROR('#3: var object = {valueOf: function() {return "%5E"}, toString: function() {return {}}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
} }
//CHECK#4 //CHECK#4
try { try {
var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; var object = {
valueOf: function() {
throw "error"
},
toString: function() {
return "%5E"
}
};
if (decodeURI(object) !== "^") { if (decodeURI(object) !== "^") {
$ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object))); $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
} }
@ -43,20 +68,38 @@ catch (e) {
} }
//CHECK#5 //CHECK#5
var object = {toString: function() {return "%5E"}}; var object = {
toString: function() {
return "%5E"
}
};
if (decodeURI(object) !== "^") { if (decodeURI(object) !== "^") {
$ERROR('#5: var object = {toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object))); $ERROR('#5: var object = {toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
} }
//CHECK#6 //CHECK#6
var object = {valueOf: function() {return {}}, toString: function() {return "%5E"}} var object = {
valueOf: function() {
return {}
},
toString: function() {
return "%5E"
}
}
if (decodeURI(object) !== "^") { if (decodeURI(object) !== "^") {
$ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object))); $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
} }
//CHECK#7 //CHECK#7
try { try {
var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; var object = {
valueOf: function() {
return "%5E"
},
toString: function() {
throw "error"
}
};
decodeURI(object); decodeURI(object);
$ERROR('#7.1: var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; decodeURI(object) throw "error". Actual: ' + (decodeURI(object))); $ERROR('#7.1: var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; decodeURI(object) throw "error". Actual: ' + (decodeURI(object)));
} }
@ -68,7 +111,14 @@ catch (e) {
//CHECK#8 //CHECK#8
try { try {
var object = {valueOf: function() {return {}}, toString: function() {return {}}}; var object = {
valueOf: function() {
return {}
},
toString: function() {
return {}
}
};
decodeURI(object); decodeURI(object);
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; decodeURI(object) throw TypeError. Actual: ' + (decodeURI(object))); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; decodeURI(object) throw TypeError. Actual: ' + (decodeURI(object)));
} }

View File

@ -13,7 +13,12 @@ description: Complex tests
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -16,7 +16,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -16,7 +16,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -17,7 +17,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -17,7 +17,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -17,7 +17,12 @@ description: >
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -15,7 +15,7 @@ var result = true;
try { try {
decodeURIComponent("%"); decodeURIComponent("%");
result = false; result = false;
} catch(e) { } catch (e) {
if ((e instanceof URIError) !== true) { if ((e instanceof URIError) !== true) {
result = false; result = false;
} }
@ -25,7 +25,7 @@ try {
try { try {
decodeURIComponent("%A"); decodeURIComponent("%A");
result = false; result = false;
} catch(e) { } catch (e) {
if ((e instanceof URIError) !== true) { if ((e instanceof URIError) !== true) {
result = false; result = false;
} }
@ -35,7 +35,7 @@ try {
try { try {
decodeURIComponent("%1"); decodeURIComponent("%1");
result = false; result = false;
} catch(e) { } catch (e) {
if ((e instanceof URIError) !== true) { if ((e instanceof URIError) !== true) {
result = false; result = false;
} }
@ -45,7 +45,7 @@ try {
try { try {
decodeURIComponent("% "); decodeURIComponent("% ");
result = false; result = false;
} catch(e) { } catch (e) {
if ((e instanceof URIError) !== true) { if ((e instanceof URIError) !== true) {
result = false; result = false;
} }

View File

@ -13,7 +13,12 @@ description: Complex tests
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -13,7 +13,12 @@ description: Complex tests
//CHECK //CHECK
var result = true; var result = true;
var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]]; var interval = [
[0x00, 0x29],
[0x40, 0x40],
[0x47, 0x60],
[0x67, 0xFFFF]
];
for (var indexI = 0; indexI < interval.length; indexI++) { for (var indexI = 0; indexI < interval.length; indexI++) {
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
try { try {

View File

@ -22,7 +22,7 @@ for (var indexI = 0; indexI <= 65535; indexI++) {
$ERROR('#' + hex + ' '); $ERROR('#' + hex + ' ');
errorCount++; errorCount++;
} }
} catch (e){ } catch (e) {
$ERROR('#' + hex + ' '); $ERROR('#' + hex + ' ');
errorCount++; errorCount++;
} }

View File

@ -16,7 +16,7 @@ if (decodeURIComponent.propertyIsEnumerable('length') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in decodeURIComponent){ for (var p in decodeURIComponent) {
if (p === "length") { if (p === "length") {
result = false; result = false;
} }

View File

@ -16,7 +16,7 @@ if (this.propertyIsEnumerable('decodeURIComponent') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in this){ for (var p in this) {
if (p === "decodeURIComponent") { if (p === "decodeURIComponent") {
result = false; result = false;
} }

View File

@ -10,26 +10,51 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, String)
---*/ ---*/
//CHECK#1 //CHECK#1
var object = {valueOf: function() {return "%5E"}}; var object = {
valueOf: function() {
return "%5E"
}
};
if (decodeURIComponent(object) !== "[object Object]") { if (decodeURIComponent(object) !== "[object Object]") {
$ERROR('#1: var object = {valueOf: function() {return "%5E"}}; decodeURIComponent(object) === [object Object]. Actual: ' + (decodeURIComponent(object))); $ERROR('#1: var object = {valueOf: function() {return "%5E"}}; decodeURIComponent(object) === [object Object]. Actual: ' + (decodeURIComponent(object)));
} }
//CHECK#2 //CHECK#2
var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}}; var object = {
valueOf: function() {
return ""
},
toString: function() {
return "%5E"
}
};
if (decodeURIComponent(object) !== "^") { if (decodeURIComponent(object) !== "^") {
$ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object))); $ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object)));
} }
//CHECK#3 //CHECK#3
var object = {valueOf: function() {return "%5E"}, toString: function() {return {}}}; var object = {
valueOf: function() {
return "%5E"
},
toString: function() {
return {}
}
};
if (decodeURIComponent(object) !== "^") { if (decodeURIComponent(object) !== "^") {
$ERROR('#3: var object = {valueOf: function() {return "%5E"}, toString: function() {return {}}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object))); $ERROR('#3: var object = {valueOf: function() {return "%5E"}, toString: function() {return {}}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object)));
} }
//CHECK#4 //CHECK#4
try { try {
var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; var object = {
valueOf: function() {
throw "error"
},
toString: function() {
return "%5E"
}
};
if (decodeURIComponent(object) !== "^") { if (decodeURIComponent(object) !== "^") {
$ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object))); $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object)));
} }
@ -43,20 +68,38 @@ catch (e) {
} }
//CHECK#5 //CHECK#5
var object = {toString: function() {return "%5E"}}; var object = {
toString: function() {
return "%5E"
}
};
if (decodeURIComponent(object) !== "^") { if (decodeURIComponent(object) !== "^") {
$ERROR('#5: var object = {toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object))); $ERROR('#5: var object = {toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object)));
} }
//CHECK#6 //CHECK#6
var object = {valueOf: function() {return {}}, toString: function() {return "%5E"}} var object = {
valueOf: function() {
return {}
},
toString: function() {
return "%5E"
}
}
if (decodeURIComponent(object) !== "^") { if (decodeURIComponent(object) !== "^") {
$ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object))); $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "%5E"}}; decodeURIComponent(object) === "^". Actual: ' + (decodeURIComponent(object)));
} }
//CHECK#7 //CHECK#7
try { try {
var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; var object = {
valueOf: function() {
return "%5E"
},
toString: function() {
throw "error"
}
};
decodeURIComponent(object); decodeURIComponent(object);
$ERROR('#7.1: var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; decodeURIComponent(object) throw "error". Actual: ' + (decodeURIComponent(object))); $ERROR('#7.1: var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; decodeURIComponent(object) throw "error". Actual: ' + (decodeURIComponent(object)));
} }
@ -68,7 +111,14 @@ catch (e) {
//CHECK#8 //CHECK#8
try { try {
var object = {valueOf: function() {return {}}, toString: function() {return {}}}; var object = {
valueOf: function() {
return {}
},
toString: function() {
return {}
}
};
decodeURIComponent(object); decodeURIComponent(object);
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; decodeURIComponent(object) throw TypeError. Actual: ' + (decodeURIComponent(object))); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; decodeURIComponent(object) throw TypeError. Actual: ' + (decodeURIComponent(object)));
} }

View File

@ -19,38 +19,38 @@ var count = 0;
var indexP; var indexP;
var indexO = 0; var indexO = 0;
l : l:
for (var index = 0x0000; index <= 0x007F; index++) { for (var index = 0x0000; index <= 0x007F; index++) {
count++; count++;
var str = String.fromCharCode(index); var str = String.fromCharCode(index);
for (var indexC = 0; indexC < uriReserved.length; indexC++) { for (var indexC = 0; indexC < uriReserved.length; indexC++) {
if (uriReserved[indexC] === str) continue l; if (uriReserved[indexC] === str) continue l;
}
for (indexC = 0; indexC < uriUnescaped.length; indexC++) {
if (uriUnescaped[indexC] === str) continue l;
}
if ("#" === str) continue l;
if (encodeURI(str).toUpperCase() === decimalToPercentHexString(index)) continue l;
if (indexO === 0) {
indexO = index;
} else {
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;
} }
for (indexC = 0; indexC < uriUnescaped.length; indexC++) {
if (uriUnescaped[indexC] === str) continue l;
}
if ("#" === str) continue l;
if (encodeURI(str).toUpperCase() === decimalToPercentHexString(index)) continue l;
if (indexO === 0) {
indexO = index;
} else {
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++;
} }
indexP = index;
errorCount++;
}
if (errorCount > 0) { if (errorCount > 0) {
if ((indexP - indexO) !== 0) { if ((indexP - indexO) !== 0) {

View File

@ -17,32 +17,32 @@ var count = 0;
var indexP; var indexP;
var indexO = 0; var indexO = 0;
l: l:
for (var index = 0x0080; index <= 0x07FF; index++) { for (var index = 0x0080; index <= 0x07FF; index++) {
count++; count++;
var hex1 = decimalToPercentHexString(0x0080 + (index & 0x003F)); var hex1 = decimalToPercentHexString(0x0080 + (index & 0x003F));
var hex2 = decimalToPercentHexString(0x00C0 + (index & 0x07C0) / 0x0040); var hex2 = decimalToPercentHexString(0x00C0 + (index & 0x07C0) / 0x0040);
var str = String.fromCharCode(index); var str = String.fromCharCode(index);
if (encodeURI(str).toUpperCase() === hex2 + hex1) continue; if (encodeURI(str).toUpperCase() === hex2 + hex1) continue;
if (indexO === 0) { if (indexO === 0) {
indexO = index;
} else {
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; indexO = index;
} else {
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++;
} }
indexP = index;
errorCount++;
}
if (errorCount > 0) { if (errorCount > 0) {
if ((indexP - indexO) !== 0) { if ((indexP - indexO) !== 0) {

View File

@ -16,7 +16,7 @@ if (encodeURI.propertyIsEnumerable('length') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in encodeURI){ for (var p in encodeURI) {
if (p === "length") { if (p === "length") {
result = false; result = false;
} }

View File

@ -16,7 +16,7 @@ if (this.propertyIsEnumerable('encodeURI') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in this){ for (var p in this) {
if (p === "encodeURI") { if (p === "encodeURI") {
result = false; result = false;
} }

View File

@ -10,26 +10,51 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, String)
---*/ ---*/
//CHECK#1 //CHECK#1
var object = {valueOf: function() {return "^"}}; var object = {
valueOf: function() {
return "^"
}
};
if (encodeURI(object) !== "%5Bobject%20Object%5D") { if (encodeURI(object) !== "%5Bobject%20Object%5D") {
$ERROR('#1: var object = {valueOf: function() {return "^"}}; encodeURI(object) === %5Bobject%20Object%5D. Actual: ' + (encodeURI(object))); $ERROR('#1: var object = {valueOf: function() {return "^"}}; encodeURI(object) === %5Bobject%20Object%5D. Actual: ' + (encodeURI(object)));
} }
//CHECK#2 //CHECK#2
var object = {valueOf: function() {return ""}, toString: function() {return "^"}}; var object = {
valueOf: function() {
return ""
},
toString: function() {
return "^"
}
};
if (encodeURI(object) !== "%5E") { if (encodeURI(object) !== "%5E") {
$ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "^"}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object))); $ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "^"}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object)));
} }
//CHECK#3 //CHECK#3
var object = {valueOf: function() {return "^"}, toString: function() {return {}}}; var object = {
valueOf: function() {
return "^"
},
toString: function() {
return {}
}
};
if (encodeURI(object) !== "%5E") { if (encodeURI(object) !== "%5E") {
$ERROR('#3: var object = {valueOf: function() {return "^"}, toString: function() {return {}}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object))); $ERROR('#3: var object = {valueOf: function() {return "^"}, toString: function() {return {}}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object)));
} }
//CHECK#4 //CHECK#4
try { try {
var object = {valueOf: function() {throw "error"}, toString: function() {return "^"}}; var object = {
valueOf: function() {
throw "error"
},
toString: function() {
return "^"
}
};
if (encodeURI(object) !== "%5E") { if (encodeURI(object) !== "%5E") {
$ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "^"}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object))); $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "^"}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object)));
} }
@ -43,20 +68,38 @@ catch (e) {
} }
//CHECK#5 //CHECK#5
var object = {toString: function() {return "^"}}; var object = {
toString: function() {
return "^"
}
};
if (encodeURI(object) !== "%5E") { if (encodeURI(object) !== "%5E") {
$ERROR('#5: var object = {toString: function() {return "^"}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object))); $ERROR('#5: var object = {toString: function() {return "^"}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object)));
} }
//CHECK#6 //CHECK#6
var object = {valueOf: function() {return {}}, toString: function() {return "^"}} var object = {
valueOf: function() {
return {}
},
toString: function() {
return "^"
}
}
if (encodeURI(object) !== "%5E") { if (encodeURI(object) !== "%5E") {
$ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "^"}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object))); $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "^"}}; encodeURI(object) === "%5E". Actual: ' + (encodeURI(object)));
} }
//CHECK#7 //CHECK#7
try { try {
var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}}; var object = {
valueOf: function() {
return "^"
},
toString: function() {
throw "error"
}
};
encodeURI(object); encodeURI(object);
$ERROR('#7.1: var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}}; encodeURI(object) throw "error". Actual: ' + (encodeURI(object))); $ERROR('#7.1: var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}}; encodeURI(object) throw "error". Actual: ' + (encodeURI(object)));
} }
@ -68,7 +111,14 @@ catch (e) {
//CHECK#8 //CHECK#8
try { try {
var object = {valueOf: function() {return {}}, toString: function() {return {}}}; var object = {
valueOf: function() {
return {}
},
toString: function() {
return {}
}
};
encodeURI(object); encodeURI(object);
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; encodeURI(object) throw TypeError. Actual: ' + (encodeURI(object))); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; encodeURI(object) throw TypeError. Actual: ' + (encodeURI(object)));
} }

View File

@ -18,34 +18,34 @@ var count = 0;
var indexP; var indexP;
var indexO = 0; var indexO = 0;
l : l:
for (var index = 0x0000; index <= 0x007F; index++) { for (var index = 0x0000; index <= 0x007F; index++) {
count++; count++;
var str = String.fromCharCode(index); var str = String.fromCharCode(index);
for (var indexC = 0; indexC < uriUnescaped.length; indexC++) { for (var indexC = 0; indexC < uriUnescaped.length; indexC++) {
if (uriUnescaped[indexC] === str) continue l; if (uriUnescaped[indexC] === str) continue l;
}
if (encodeURIComponent(str).toUpperCase() === decimalToPercentHexString(index)) continue l;
if (indexO === 0) {
indexO = index;
} else {
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;
} }
if (encodeURIComponent(str).toUpperCase() === decimalToPercentHexString(index)) continue l;
if (indexO === 0) {
indexO = index;
} else {
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++;
} }
indexP = index;
errorCount++;
}
if (errorCount > 0) { if (errorCount > 0) {
if ((indexP - indexO) !== 0) { if ((indexP - indexO) !== 0) {

View File

@ -17,32 +17,32 @@ var count = 0;
var indexP; var indexP;
var indexO = 0; var indexO = 0;
l: l:
for (var index = 0x0080; index <= 0x07FF; index++) { for (var index = 0x0080; index <= 0x07FF; index++) {
count++; count++;
var hex1 = decimalToPercentHexString(0x0080 + (index & 0x003F)); var hex1 = decimalToPercentHexString(0x0080 + (index & 0x003F));
var hex2 = decimalToPercentHexString(0x00C0 + (index & 0x07C0) / 0x0040); var hex2 = decimalToPercentHexString(0x00C0 + (index & 0x07C0) / 0x0040);
var str = String.fromCharCode(index); var str = String.fromCharCode(index);
if (encodeURIComponent(str).toUpperCase() === hex2 + hex1) continue; if (encodeURIComponent(str).toUpperCase() === hex2 + hex1) continue;
if (indexO === 0) { if (indexO === 0) {
indexO = index;
} else {
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; indexO = index;
} else {
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++;
} }
indexP = index;
errorCount++;
}
if (errorCount > 0) { if (errorCount > 0) {
if ((indexP - indexO) !== 0) { if ((indexP - indexO) !== 0) {

View File

@ -16,7 +16,7 @@ if (encodeURIComponent.propertyIsEnumerable('length') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in encodeURIComponent){ for (var p in encodeURIComponent) {
if (p === "length") { if (p === "length") {
result = false; result = false;
} }

View File

@ -16,7 +16,7 @@ if (this.propertyIsEnumerable('encodeURIComponent') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in this){ for (var p in this) {
if (p === "encodeURIComponent") { if (p === "encodeURIComponent") {
result = false; result = false;
} }

View File

@ -10,26 +10,51 @@ description: If Type(value) is Object, evaluate ToPrimitive(value, String)
---*/ ---*/
//CHECK#1 //CHECK#1
var object = {valueOf: function() {return "^"}}; var object = {
valueOf: function() {
return "^"
}
};
if (encodeURIComponent(object) !== "%5Bobject%20Object%5D") { if (encodeURIComponent(object) !== "%5Bobject%20Object%5D") {
$ERROR('#1: var object = {valueOf: function() {return "^"}}; encodeURIComponent(object) === %5Bobject%20Object%5D. Actual: ' + (encodeURIComponent(object))); $ERROR('#1: var object = {valueOf: function() {return "^"}}; encodeURIComponent(object) === %5Bobject%20Object%5D. Actual: ' + (encodeURIComponent(object)));
} }
//CHECK#2 //CHECK#2
var object = {valueOf: function() {return ""}, toString: function() {return "^"}}; var object = {
valueOf: function() {
return ""
},
toString: function() {
return "^"
}
};
if (encodeURIComponent(object) !== "%5E") { if (encodeURIComponent(object) !== "%5E") {
$ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object))); $ERROR('#2: var object = {valueOf: function() {return ""}, toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object)));
} }
//CHECK#3 //CHECK#3
var object = {valueOf: function() {return "^"}, toString: function() {return {}}}; var object = {
valueOf: function() {
return "^"
},
toString: function() {
return {}
}
};
if (encodeURIComponent(object) !== "%5E") { if (encodeURIComponent(object) !== "%5E") {
$ERROR('#3: var object = {valueOf: function() {return "^"}, toString: function() {return {}}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object))); $ERROR('#3: var object = {valueOf: function() {return "^"}, toString: function() {return {}}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object)));
} }
//CHECK#4 //CHECK#4
try { try {
var object = {valueOf: function() {throw "error"}, toString: function() {return "^"}}; var object = {
valueOf: function() {
throw "error"
},
toString: function() {
return "^"
}
};
if (encodeURIComponent(object) !== "%5E") { if (encodeURIComponent(object) !== "%5E") {
$ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object))); $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object)));
} }
@ -43,20 +68,38 @@ catch (e) {
} }
//CHECK#5 //CHECK#5
var object = {toString: function() {return "^"}}; var object = {
toString: function() {
return "^"
}
};
if (encodeURIComponent(object) !== "%5E") { if (encodeURIComponent(object) !== "%5E") {
$ERROR('#5: var object = {toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object))); $ERROR('#5: var object = {toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object)));
} }
//CHECK#6 //CHECK#6
var object = {valueOf: function() {return {}}, toString: function() {return "^"}} var object = {
valueOf: function() {
return {}
},
toString: function() {
return "^"
}
}
if (encodeURIComponent(object) !== "%5E") { if (encodeURIComponent(object) !== "%5E") {
$ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object))); $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "^"}}; encodeURIComponent(object) === "%5E". Actual: ' + (encodeURIComponent(object)));
} }
//CHECK#7 //CHECK#7
try { try {
var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}}; var object = {
valueOf: function() {
return "^"
},
toString: function() {
throw "error"
}
};
encodeURIComponent(object); encodeURIComponent(object);
$ERROR('#7.1: var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}}; encodeURIComponent(object) throw "error". Actual: ' + (encodeURIComponent(object))); $ERROR('#7.1: var object = {valueOf: function() {return "^"}, toString: function() {throw "error"}}; encodeURIComponent(object) throw "error". Actual: ' + (encodeURIComponent(object)));
} }
@ -68,7 +111,14 @@ catch (e) {
//CHECK#8 //CHECK#8
try { try {
var object = {valueOf: function() {return {}}, toString: function() {return {}}}; var object = {
valueOf: function() {
return {}
},
toString: function() {
return {}
}
};
encodeURIComponent(object); encodeURIComponent(object);
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; encodeURIComponent(object) throw TypeError. Actual: ' + (encodeURIComponent(object))); $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; encodeURIComponent(object) throw TypeError. Actual: ' + (encodeURIComponent(object)));
} }

View File

@ -16,7 +16,7 @@ if (eval.propertyIsEnumerable('length') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (p in eval){ for (p in eval) {
if (p === "length") { if (p === "length") {
result = false; result = false;
} }

View File

@ -16,7 +16,7 @@ if (this.propertyIsEnumerable('eval') !== false) {
//CHECK#2 //CHECK#2
var result = true; var result = true;
for (var p in this){ for (var p in this) {
if (p === "eval") { if (p === "eval") {
result = false; result = false;
} }