aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.11.4_Properties_of_the_Error_Prototype_Object.json
diff options
context:
space:
mode:
Diffstat (limited to 'website/resources/scripts/testcases2/15.11.4_Properties_of_the_Error_Prototype_Object.json')
-rw-r--r--website/resources/scripts/testcases2/15.11.4_Properties_of_the_Error_Prototype_Object.json80
1 files changed, 80 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/15.11.4_Properties_of_the_Error_Prototype_Object.json b/website/resources/scripts/testcases2/15.11.4_Properties_of_the_Error_Prototype_Object.json
new file mode 100644
index 000000000..82e83a4ba
--- /dev/null
+++ b/website/resources/scripts/testcases2/15.11.4_Properties_of_the_Error_Prototype_Object.json
@@ -0,0 +1,80 @@
+{
+ "testCollection": {
+ "name": "15.11.4_Properties_of_the_Error_Prototype_Object",
+ "numTests": 12,
+ "tests": [
+ {
+ "section": "15.11.4.1, 16",
+ "description": "Checking Error.prototype.constructor",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (Error.prototype.constructor !== Error) {\n\t$ERROR('#1: Error.prototype.constructor === Error. Actual: '+Error.prototype.constructor );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4.1_A1_T1"
+ },
+ {
+ "section": "15.11.4.1, 16",
+ "description": "Checking if creating \"new Error.prototype.constructor\" passes and checking its properties",
+ "test": "constr = Error.prototype.constructor;\n\nerr = new constr;\n\n//////////////////////////////////////////////////////////////////////////////\n// CHECK#0\nif (err === undefined) {\n\t$ERROR('#0: constr = Error.prototype.constructor; err = new constr; err === undefined');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (err.constructor !== Error) {\n\t$ERROR('#1: constr = Error.prototype.constructor; err = new constr; err.constructor === Error. Actual: '+err.constructor );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n// CHECK#2\nif (!(Error.prototype.isPrototypeOf(err))) {\n\t$ERROR('#2: constr = Error.prototype.constructor; err = new constr; Error.prototype.isPrototypeOf(err) return true. Actual: '+Error.prototype.isPrototypeOf(err));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n// CHECK#3\nError.prototype.toString=Object.prototype.toString;\nto_string_result = '[object '+ 'Error' +']';\nif (err.toString() !== to_string_result) {\n\t$ERROR('#3: constr = Error.prototype.constructor; err = new constr; Error.prototype.toString=Object.prototype.toString; err.toString() === \\'[object Error]\\'. Actual: '+err.toString() );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n// CHECK#4\nif (err.valueOf().toString() !== to_string_result) {\n\t$ERROR('#4: constr = Error.prototype.constructor; err = new constr; Error.prototype.toString=Object.prototype.toString; err.valueOf().toString() === \\'[object Error]\\'. Actual: '+err.valueOf().toString() );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4.1_A1_T2"
+ },
+ {
+ "section": "15.11.4.2, 16",
+ "description": "Checking Error.prototype.name",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (!Error.prototype.hasOwnProperty('name')) {\n\t$ERROR('#1: Error.prototype.hasOwnProperty(\\'name\\') return true. Actual: '+Error.prototype.hasOwnProperty('name'));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4.2_A1"
+ },
+ {
+ "section": "15.11.4.2, 16",
+ "description": "Checking value of Error.prototype.name",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (Error.prototype.name!==\"Error\") {\n\t$ERROR('#1: Error.prototype.name===\"Error\". Actual: '+Error.prototype.name);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4.2_A2"
+ },
+ {
+ "section": "15.11.4.3, 16",
+ "description": "Checking Error.prototype.message",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (!Error.prototype.hasOwnProperty('message')) {\n\t$ERROR('#1: Error.prototype.hasOwnProperty(\\'message\\') reurn true. Actual: '+Error.prototype.hasOwnProperty('message'));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4.3_A1"
+ },
+ {
+ "section": "15.11.4.3, 16",
+ "description": "Checking value of Error.prototype.message",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (typeof Error.prototype.message !== \"string\") {\n $ERROR('#1: typeof Error.prototype.message === \"string\". Actual: ' + Error.prototype.message);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4.3_A2"
+ },
+ {
+ "section": "15.11.4.4, 16",
+ "description": "Checking Error.prototype.toString",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (!Error.prototype.hasOwnProperty('toString')) {\n\t$ERROR('#1: Error.prototype.hasOwnProperty(\\'toString\\') return true. Actual: '+Error.prototype.hasOwnProperty('toString'));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4.4_A1"
+ },
+ {
+ "section": "15.11.4.4, 16",
+ "description": "Checking if call of Error.prototype.toSting() fails",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nvar err1=new Error(\"Error\");\ntry{\n\tvar toStr=err1.toString();\n}\ncatch(e){\n\t$ERROR('#1: var err1=new Error(\"Error\"); var toStr=err1.toString(); lead to throwing exception. Exception is '+e);\n}\nif (toStr===undefined) {\n\t$ERROR('#2: var err1=new Error(\"Error\"); var toStr=err1.toString(); toStr!==undefined. Actual: '+toStr);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4.4_A2"
+ },
+ {
+ "section": "15.11.4, 16",
+ "description": "Get Error.prototype and compare with Object.prototype",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (!Object.prototype.isPrototypeOf(Error.prototype)) {\n\t$ERROR('#1: Object.prototype.isPrototypeOf(Error.prototype) return true. Actual: '+Object.prototype.isPrototypeOf(Error.prototype));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4_A1"
+ },
+ {
+ "section": "15.11.4, 16",
+ "description": "Getting the value of the internal [[Class]] property using Error.prototype.toString() function",
+ "test": "Error.prototype.toString=Object.prototype.toString;\n__tostr = Error.prototype.toString();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__tostr !== \"[object Error]\") {\n\t$ERROR('#1: Error.prototype.toString=Object.prototype.toString; __tostr = Error.prototype.toString(); __tostr === \"[object Error]\". Actual: '+__tostr );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4_A2"
+ },
+ {
+ "section": "15.11.4, 16",
+ "description": "Checking if call of Error prototype as a function fails",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tError.prototype();\n\t$FAIL('#1: \"Error.prototype()\" lead to throwing exception');\n} catch (e) {}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4_A3"
+ },
+ {
+ "section": "15.11.4, 16",
+ "description": "Checking if creating \"new Error.prototype\" fails",
+ "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\t__instance = new Object.prototype;\n\t$FAIL('#1: \"__instance = new Object.prototype\" lead to throwing exception');\n} catch (e) {}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
+ "id": "S15.11.4_A4"
+ }
+ ]
+ }
+}