diff options
Diffstat (limited to 'website/resources/scripts/testcases2/15.5.4.10_String.prototype.match.json')
-rw-r--r-- | website/resources/scripts/testcases2/15.5.4.10_String.prototype.match.json | 236 |
1 files changed, 236 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/15.5.4.10_String.prototype.match.json b/website/resources/scripts/testcases2/15.5.4.10_String.prototype.match.json new file mode 100644 index 000000000..46b72607b --- /dev/null +++ b/website/resources/scripts/testcases2/15.5.4.10_String.prototype.match.json @@ -0,0 +1,236 @@ +{ + "testCollection": { + "name": "15.5.4.10_String.prototype.match", + "numTests": 38, + "tests": [ + { + "section": "15.5.4.10", + "description": "Checking if varying the String.prototype.match.length property fails", + "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(String.prototype.match.hasOwnProperty('length'))) {\n $FAIL('#1: String.prototype.match.hasOwnProperty(\\'length\\') return true. Actual: '+String.prototype.match.hasOwnProperty('length'));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nvar __obj = String.prototype.match.length;\n\nString.prototype.match.length = function(){return \"shifted\";};\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (String.prototype.match.length !== __obj) {\n $ERROR('#2: __obj = String.prototype.match.length; String.prototype.match.length = function(){return \"shifted\";}; String.prototype.match.length === __obj. Actual: '+String.prototype.match.length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A10" + }, + { + "section": "15.5.4.10", + "description": "Checking String.prototype.match.length", + "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(String.prototype.match.hasOwnProperty(\"length\"))) {\n $ERROR('#1: String.prototype.match.hasOwnProperty(\"length\") return true. Actual: '+String.prototype.match.hasOwnProperty(\"length\"));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (String.prototype.match.length !== 1) {\n $ERROR('#2: String.prototype.match.length === 1. Actual: '+String.prototype.match.length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A11" + }, + { + "section": "15.5.4.10", + "description": "Arguments is true, and instance is object", + "test": "var __instance = new Object(true);\n\n__instance.match = String.prototype.match;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__instance.match(true)[0] !== \"true\") {\n $ERROR('#1: __instance = new Object(true); __instance.match = String.prototype.match; __instance.match(true)[0] === \"true\". Actual: '+__instance.match(true)[0] );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T1" + }, + { + "section": "15.5.4.10", + "description": "Call match (regexp) function with object argument", + "test": "var __obj = {toString:function(){return \"\\u0041B\";}}\nvar __str = \"ABB\\u0041BABAB\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwith(__str){\n if (match(__obj)[0] !==\"AB\") {\n $ERROR('#1: var x; var __obj = {toString:function(){return \"\\u0041B\";}}; var __str = \"ABB\\u0041BABAB\"; match(__obj)[0] ===\"AB\". Actual: '+match(__obj)[0] );\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nvar x;\n", + "id": "S15.5.4.10_A1_T10" + }, + { + "section": "15.5.4.10", + "description": "Override toString function, toString throw exception, then call match (regexp) function with this object as argument", + "test": "var __obj = {toString:function(){throw \"intostr\";}}\nvar __str = {str__:\"ABB\\u0041BABAB\"};\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwith(__str){\n with(str__){\n try {\n var x = match(__obj);\n $FAIL('#1: \"var x = match(__obj)\" lead to throwing exception');\n } catch (e) {\n if (e!==\"intostr\") {\n $ERROR('#1.1: Exception === \"intostr\". Actual: '+e);\n }\n }\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T11" + }, + { + "section": "15.5.4.10", + "description": "Override toString and valueOf functions, valueOf throw exception, then call match (regexp) function with this object as argument", + "test": "var __obj = {toString:function(){return {};},valueOf:function(){throw \"intostr\";}}\nvar __str = new String(\"ABB\\u0041BABAB\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwith(__str){\n try {\n var x = match(__obj);\n $FAIL('#1: \"var x = match(__obj)\" lead to throwing exception');\n } catch (e) {\n if (e!==\"intostr\") {\n $ERROR('#1.1: Exception === \"intostr\". Actual: '+e);\n }\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T12" + }, + { + "section": "15.5.4.10", + "description": "Override toString and valueOf functions, then call match (regexp) function with this object as argument", + "test": "var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (\"ABB\\u0041B\\u0031ABAB\\u0031BBAA\".match(__obj)[0] !==\"1\") {\n $ERROR('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; \"ABB\\\\u0041B\\\\u0031ABAB\\\\u0031BBAA\".match(__obj)[0] ===\"1\". Actual: '+(\"ABB\\u0041B\\u0031ABAB\\u0031BBAA\".match(__obj)[0]) );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (\"ABB\\u0041B\\u0031ABAB\\u0031BBAA\".match(__obj).length !== 1) {\n $ERROR('#3: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; \"ABB\\\\u0041B\\\\u0031ABAB\\\\u0031BBAA\".match(__obj).length === 1. Actual: '+(\"ABB\\u0041B\\u0031ABAB\\u0031BBAA\".match(__obj).length) );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T13" + }, + { + "section": "15.5.4.10", + "description": "Call match (regexp) function with RegExp object as argument from string", + "test": "var __reg = new RegExp(\"77\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (\"ABB\\u0041BABAB\\u0037\\u0037BBAA\".match(__reg)[0] !== \"77\") {\n $ERROR('#1: var __reg = new RegExp(\"77\"); \"ABB\\\\u0041BABAB\\\\u0037\\\\u0037BBAA\".match(__reg)[0] === \"77\". Actual: '+(\"ABB\\u0041BABAB\\u0037\\u0037BBAA\".match(__reg)[0]) );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T14" + }, + { + "section": "15.5.4.10", + "description": "Argument is function that return boolean, and instance is Boolean object", + "test": "var __instance = new Boolean;\n\n__instance.match = String.prototype.match;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__instance.match(function(){return false;}())[0] !== \"false\") {\n $ERROR('#1: __instance = new Boolean; __instance.match = String.prototype.match; __instance.match(function(){return false;}())[0] === \"false\". Actual: '+__instance.match(function(){return false;}())[0] );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T2" + }, + { + "section": "15.5.4.10", + "description": "Checking by using eval", + "test": "var match = String.prototype.match;\n\nif (typeof toString === \"undefined\"){\n toString = Object.prototype.toString;\n}\n\nvar __class__ = toString();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (match(eval(\"\\\"bj\\\"\"))[0] !== \"bj\") {\n $ERROR('#1: match = String.prototype.match; match(eval(\"\\\\\"bj\\\\\"\"))[0] === \"bj\". Actual: '+match(eval(\"\\\"bj\\\"\"))[0] );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T3" + }, + { + "section": "15.5.4.10", + "description": "Call match (regexp) function without arguments of string", + "test": "var __matched = \"\".match();\n\nvar __expected = RegExp().exec(\"\"); \n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__matched.length !== __expected.length) {\n $ERROR('#1: __matched = \"\".match(); __expected = RegExp().exec(\"\"); __matched.length === __expected.length. Actual: '+__matched.length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__matched.index !== __expected.index) {\n $ERROR('#2: __matched = \"\".match(); __expected = RegExp().exec(\"\"); __matched.index === __expected.index. Actual: '+__matched.index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__matched.input !== __expected.input) {\n $ERROR('#3: __matched = \"\".match(); __expected = RegExp().exec(\"\"); __matched.input === __expected.input. Actual: '+__matched.input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__matched[index]!==__expected[index]) {\n $ERROR('#4.'+index+': __matched = \"\".match(); __expected = RegExp().exec(\"\"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T4" + }, + { + "section": "15.5.4.10", + "description": "Call match (regexp) function with null argument of function object", + "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n//since ToString(null) evaluates to \"null\" match(null) evaluates to match(\"null\")\nif (function(){return \"gnulluna\"}().match(null)[0] !== \"null\") {\n $ERROR('#1: function(){return \"gnulluna\"}().match(null)[0] === \"null\". Actual: '+function(){return \"gnulluna\"}().match(null)[0] );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T5" + }, + { + "section": "15.5.4.10", + "description": "Call match (regexp) function with x argument of new String object, where x is undefined variable", + "test": "var __matched = new String(\"undefined\").match(x);\n\nvar __expected = RegExp(x).exec(\"undefined\"); \n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__matched.length !== __expected.length) {\n $ERROR('#1: __matched = new String(\"undefined\").match(x); __expected = RegExp(x).exec(\"undefined\"); __matched.length === __expected.length. Actual: '+__matched.length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__matched.index !== __expected.index) {\n $ERROR('#2: __matched = new String(\"undefined\").match(x); __expected = RegExp(x).exec(\"undefined\"); __matched.index === __expected.index. Actual: '+__matched.index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__matched.input !== __expected.input) {\n $ERROR('#3: __matched = new String(\"undefined\").match(x); __expected = RegExp(x).exec(\"undefined\"); __matched.input === __expected.input. Actual: '+__matched.input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__matched[index]!==__expected[index]) {\n $ERROR('#4.'+index+': __matched = new String(\"undefined\").match(x); __expected = RegExp(x).exec(\"undefined\"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nvar x;\n\n", + "id": "S15.5.4.10_A1_T6" + }, + { + "section": "15.5.4.10", + "description": "Call match (regexp) function with undefined argument of string object", + "test": "var __matched = String(\"undefined\").match(undefined);\n\nvar __expected = RegExp(undefined).exec(\"undefined\"); \n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__matched.length !== __expected.length) {\n $ERROR('#1: __matched = String(\"undefined\").match(undefined); __expected = RegExp(undefined).exec(\"undefined\"); __matched.length === __expected.length. Actual: '+__matched.length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__matched.index !== __expected.index) {\n $ERROR('#2: __matched = String(\"undefined\").match(undefined); __expected = RegExp(undefined).exec(\"undefined\"); __matched.index === __expected.index. Actual: '+__matched.index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__matched.input !== __expected.input) {\n $ERROR('#3: __matched = String(\"undefined\").match(undefined); __expected = RegExp(undefined).exec(\"undefined\"); __matched.input === __expected.input. Actual: '+__matched.input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__matched[index]!==__expected[index]) {\n $ERROR('#4.'+index+': __matched = String(\"undefined\").match(undefined); __expected = RegExp(undefined).exec(\"undefined\"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T7" + }, + { + "section": "15.5.4.10", + "description": ": Call match (regexp) function with void 0 argument of string object;", + "test": "var __obj = {toString:function(){}};\n\nvar __matched = String(__obj).match(void 0);\n\nvar __expected = RegExp(void 0).exec(\"undefined\"); \n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__matched.length !== __expected.length) {\n $ERROR('#1: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec(\"undefined\"); __matched.length === __expected.length. Actual: '+__matched.length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__matched.index !== __expected.index) {\n $ERROR('#2: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec(\"undefined\"); __matched.index === __expected.index. Actual: '+__matched.index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__matched.input !== __expected.input) {\n $ERROR('#3: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec(\"undefined\"); __matched.input === __expected.input. Actual: '+__matched.input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__matched[index]!==__expected[index]) {\n $ERROR('#4.'+index+': __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec(\"undefined\"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T8" + }, + { + "section": "15.5.4.10", + "description": "Call match (regexp) function with function(){}() argument of string object", + "test": "var __obj = {\n valueOf:function(){},\n toString:void 0\n};\n\nvar __matched = new String(__obj).match(function(){}());\n\nvar __expected = RegExp(undefined).exec(\"undefined\"); \n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__matched.length !== __expected.length) {\n $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec(\"undefined\"); __matched.length === __expected.length. Actual: '+__matched.length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__matched.index !== __expected.index) {\n $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec(\"undefined\"); __matched.index === __expected.index. Actual: '+__matched.index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__matched.input !== __expected.input) {\n $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec(\"undefined\"); __matched.input === __expected.input. Actual: '+__matched.input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nfor(var index=0; index<__expected.length; index++) {\n if (__matched[index]!==__expected[index]) {\n $ERROR('#4.'+index+': __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec(\"undefined\"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A1_T9" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is 3", + "test": "var __string = \"1234567890\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(3)[0]!== \"3\") {\n $ERROR('#1: __string = \"1234567890\"; __string.match(3)[0]=== \"3\". Actual: '+__string.match(3)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__string.match(3).length !==1) {\n $ERROR('#2: __string = \"1234567890\"; __string.match(3).length ===1. Actual: '+__string.match(3).length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__string.match(3).index !==2) {\n $ERROR('#3: __string = \"1234567890\"; __string.match(3).index ===2. Actual: '+__string.match(3).index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (__string.match(3).input !==__string) {\n $ERROR('#4: __string = \"1234567890\"; __string.match(3).input ===__string. Actual: '+__string.match(3).input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T1" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/. Last match is undefined.\nAnd regular expression object have property lastIndex = tested_string.lastIndexOf(\"0\")", + "test": "var __string = \"Boston, MA 02134\";\n\nvar __matches=[\"02134\", \"02134\", undefined];\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/;\n\n__re.lastIndex = __string.lastIndexOf(\"0\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== 3) {\n $ERROR('#1: __string.match(__re).length=== 3. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__string.match(__re).index !==__string.lastIndexOf(\"0\")) {\n $ERROR('#2: __string.match(__re).index ===__string.lastIndexOf(\"0\"). Actual: '+__string.match(__re).index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nfor(var mi=0; mi<__matches.length; mi++) {\n if (__string.match(__re)[mi]!==__matches[mi]) {\n $ERROR('#3.'+mi+': __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T10" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/. Last match is undefined.\nAnd regular expression object have property lastIndex = tested_string.lastIndexOf(\"0\")+1", + "test": "var __string = \"Boston, MA 02134\";\n\nvar __matches=[\"02134\", \"02134\", undefined];\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/;\n\n__re.lastIndex = __string.lastIndexOf(\"0\")+1;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== 3) {\n $ERROR('#1: __string.match(__re).length=== 3. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__string.match(__re).index !==__string.lastIndexOf(\"0\")) {\n $ERROR('#2: __string.match(__re).index ===__string.lastIndexOf(\"0\"). Actual: '+__string.match(__re).index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nfor(var mi=0; mi<__matches.length; mi++) {\n if (__string.match(__re)[mi]!==__matches[mi]) {\n $ERROR('#3.'+mi+': __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T11" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is variable that have value /([\\d]{5})([-\\ ]?[\\d]{4})?$/g", + "test": "var __matches=[\"02134\"];\n\nvar __string = \"Boston, MA 02134\";\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/g;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== __matches.length) {\n $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__string.match(__re)[0]!==__matches[0]) {\n $ERROR('#2: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T12" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/g.\nAnd regular expression object have property lastIndex = 0", + "test": "var __matches=[\"02134\"];\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/g;\n__re.lastIndex = 0;\n\nvar __string = \"Boston, MA 02134\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== __matches.length) {\n $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__string.match(__re)[0]!==__matches[0]) {\n $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T13" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/g.\nAnd regular expression object have property lastIndex = tested_string.length", + "test": "var __string = \"Boston, MA 02134\";\n\nvar __matches=[\"02134\"];\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/g;\n\n__re.lastIndex = __string.length;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== __matches.length) {\n $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__string.match(__re)[0]!==__matches[0]) {\n $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T14" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/.\nAnd regular expression object have property lastIndex = tested_string.lastIndexOf(\"0\")", + "test": "var __string = \"Boston, MA 02134\";\n\nvar __matches=[\"02134\"];\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/g;\n\n__re.lastIndex = __string.lastIndexOf(\"0\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== __matches.length) {\n $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__string.match(__re)[0]!==__matches[0]) {\n $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T15" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/.\nAnd regular expression object have property lastIndex = tested_string.lastIndexOf(\"0\")+1", + "test": "var __string = \"Boston, MA 02134\";\n\nvar __matches=[\"02134\"];\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/g;\n\n__re.lastIndex = __string.lastIndexOf(\"0\")+1;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== __matches.length) {\n $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__string.match(__re)[0]!==__matches[0]) {\n $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T16" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /0./", + "test": "var __re = /0./;\n\nvar __num = 10203040506070809000;\n\nNumber.prototype.match = String.prototype.match;\n\n//__matches = [\"02\"];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__num.match(__re)[0]!== \"02\") {\n $ERROR('#1: __num.match(__re)[0]=== \"02\". Actual: '+__num.match(__re)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__num.match(__re).length !==1) {\n $ERROR('#2: __num.match(__re).length ===1. Actual: '+__num.match(__re).length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__num.match(__re).index !==1) {\n $ERROR('#3: __num.match(__re).index ===1. Actual: '+__num.match(__re).index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (__num.match(__re).input !==String(__num)) {\n $ERROR('#4: __num.match(__re).input ===String(__num). Actual: '+__num.match(__re).input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T17" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /0./.\nAnd regular expression object have property lastIndex = 0", + "test": "var __re = /0./;\n\n__re.lastIndex = 0;\n\nvar __num = 10203040506070809000;\n\nNumber.prototype.match = String.prototype.match;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__num.match(__re)[0]!== \"02\") {\n $ERROR('#1: __num.match(__re)[0]=== \"02\". Actual: '+__num.match(__re)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__num.match(__re).length !==1) {\n $ERROR('#2: __num.match(__re).length ===1. Actual: '+__num.match(__re).length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__num.match(__re).index !==1) {\n $ERROR('#3: __num.match(__re).index ===1. Actual: '+__num.match(__re).index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (__num.match(__re).input !==String(__num)) {\n $ERROR('#4: __num.match(__re).input ===String(__num). Actual: '+__num.match(__re).input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T18" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /34/g", + "test": "var __matches=[\"34\",\"34\",\"34\"];\n\nvar __string = \"343443444\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(/34/g).length!== 3) {\n $ERROR('#1: __string = \"343443444\"; __string.match(/34/g).length=== 3. Actual: '+__string.match(/34/g).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nfor(var mi=0; mi<__matches.length; mi++) {\n if (__string.match(/34/g)[mi]!==__matches[mi]) {\n $ERROR('#2.'+mi+': __matches=[\"34\",\"34\",\"34\"]; __string = \"343443444\"; __string.match(/34/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/34/g)[mi]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T2" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /\\d{1}/g", + "test": "var __matches=[\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\"];\n\nvar __string = \"123456abcde7890\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(/\\d{1}/g).length!== 10) {\n $ERROR('#1: __string = \"123456abcde7890\"; __string.match(/\\\\d{1}/g).length=== 10. Actual: '+__string.match(/\\d{1}/g).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nfor(var mi=0; mi<__matches.length; mi++) {\n if (__string.match(/\\d{1}/g)[mi]!==__matches[mi]) {\n $ERROR('#2.'+mi+': __matches=[\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\"]; __string = \"123456abcde7890\"; __string.match(/\\\\d{1}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\\d{1}/g)[mi]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T3" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /\\d{2}/g", + "test": "var __matches=[\"12\", \"34\", \"56\", \"78\", \"90\"];\n\nvar __string = \"123456abcde7890\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(/\\d{2}/g).length!== 5) {\n $ERROR('#1: __string = \"123456abcde7890\"; __string.match(/\\\\d{2}/g).length=== 5. Actual: '+__string.match(/\\d{2}/g).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nfor(var mi=0; mi<__matches.length; mi++) {\n if (__string.match(/\\d{2}/g)[mi]!==__matches[mi]) {\n $ERROR('#2.'+mi+': __matches=[\"12\", \"34\", \"56\", \"78\", \"90\"]; __string = \"123456abcde7890\"; __string.match(/\\\\d{2}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\\d{2}/g)[mi]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T4" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /\\D{2}/g", + "test": "var __matches=[\"ab\", \"cd\"];\n\nvar __string = \"123456abcde7890\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(/\\D{2}/g).length!== 2) {\n $ERROR('#1: __string = \"123456abcde7890\"; __string.match(/\\\\D{2}/g).length=== 2. Actual: '+__string.match(/\\D{2}/g).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nfor(var mi=0; mi<__matches.length; mi++) {\n if (__string.match(/\\D{2}/g)[mi]!==__matches[mi]) {\n $ERROR('#2.'+mi+': __matches=[\"ab\", \"cd\"]; __string = \"123456abcde7890\"; __string.match(/\\\\D{2}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\\D{2}/g)[mi]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T5" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/. Last match is void 0", + "test": "var __string = \"Boston, Mass. 02134\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[0]!== \"02134\") {\n $ERROR('#1: __string = \"Boston, Mass. 02134\"; __string.match(/([\\\\d]{5})([-\\\\ ]?[\\\\d]{4})?$/)[0]=== \"02134\". Actual: '+__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[1]!== \"02134\") {\n $ERROR('#2: __string = \"Boston, Mass. 02134\"; __string.match(/([\\\\d]{5})([-\\\\ ]?[\\\\d]{4})?$/)[1]=== \"02134\". Actual: '+__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[1]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[2]!== void 0) {\n $ERROR('#3: __string = \"Boston, Mass. 02134\"; __string.match(/([\\\\d]{5})([-\\\\ ]?[\\\\d]{4})?$/)[2]=== void 0. Actual: '+__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[2]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).length !==3) {\n $ERROR('#4: __string = \"Boston, Mass. 02134\"; __string.match(/([\\\\d]{5})([-\\\\ ]?[\\\\d]{4})?$/).length ===3. Actual: '+__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).length );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#5\nif (__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).index !==14) {\n $ERROR('#5: __string = \"Boston, Mass. 02134\"; __string.match(/([\\\\d]{5})([-\\\\ ]?[\\\\d]{4})?$/).index ===14. Actual: '+__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#6\nif (__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).input !==__string) {\n $ERROR('#6: __string = \"Boston, Mass. 02134\"; __string.match(/([\\\\d]{5})([-\\\\ ]?[\\\\d]{4})?$/).input ===__string. Actual: '+__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).input );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T6" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/g", + "test": "var __matches=[\"02134\"];\n\nvar __string = \"Boston, Mass. 02134\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/g).length!== 1) {\n $ERROR('#1: __string = \"Boston, Mass. 02134\"; __string.match(/([\\\\d]{5})([-\\\\ ]?[\\\\d]{4})?$/g).length=== 1. Actual: '+__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/g).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/g)[0]!==__matches[0]) {\n $ERROR('#2: __matches=[\"02134\"]; __string = \"Boston, Mass. 02134\"; __string.match(/([\\\\d]{5})([-\\\\ ]?[\\\\d]{4})?$/g)[0]===__matches[0]. Actual: '+__string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/g)[0]);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T7" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/. Last match is undefined.\nAnd regular expression object have property lastIndex = 0", + "test": "var __matches=[\"02134\", \"02134\", undefined];\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/;\n__re.lastIndex = 0;\n\nvar __string = \"Boston, MA 02134\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== 3) {\n $ERROR('#1: __string = \"Boston, MA 02134\"; __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/; __string.match(__re).length=== 3. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__string.match(__re).index !==__string.lastIndexOf(\"0\")) {\n $ERROR('#2: __string = \"Boston, MA 02134\"; __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/; __re.lastIndex = 0; __string.match(__re).index ===__string.lastIndexOf(\"0\"). Actual: '+__string.match(__re).index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nfor(var mi=0; mi<__matches.length; mi++) {\n if (__string.match(__re)[mi]!==__matches[mi]) {\n $ERROR('#3.'+mi+': __string = \"Boston, MA 02134\"; __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/; __matches=[\"02134\", \"02134\", undefined]; __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T8" + }, + { + "section": "15.5.4.10, 15.10.6.2", + "description": "Regular expression is /([\\d]{5})([-\\ ]?[\\d]{4})?$/. Last match is undefined.\nAnd regular expression object have property lastIndex = tested_string.length", + "test": "var __string = \"Boston, MA 02134\";\n\nvar __matches=[\"02134\", \"02134\", undefined];\n\nvar __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/;\n\n__re.lastIndex = __string.length;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__string.match(__re).length!== 3) {\n $ERROR('#1: __string = \"Boston, MA 02134\"; __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/; __string.match(__re).length=== 3. Actual: '+__string.match(__re).length);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__string.match(__re).index !==__string.lastIndexOf(\"0\")) {\n $ERROR('#2: __string = \"Boston, MA 02134\"; __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/; __re.lastIndex = __string.length; __string.match(__re).index ===__string.lastIndexOf(\"0\"). Actual: '+__string.match(__re).index );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nfor(var mi=0; mi<__matches.length; mi++) {\n if (__string.match(__re)[mi]!==__matches[mi]) {\n $ERROR('#3.'+mi+': __string = \"Boston, MA 02134\"; __re = /([\\d]{5})([-\\ ]?[\\d]{4})?$/; __matches=[\"02134\", \"02134\", undefined]; __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]);\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A2_T9" + }, + { + "section": "15.5.4.10, 13.2", + "description": "Checking String.prototype.match.prototype", + "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (String.prototype.match.prototype !== undefined) {\n $ERROR('#1: String.prototype.match.prototype === undefined. Actual: '+String.prototype.match.prototype );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A6" + }, + { + "section": "15.5.4.10, 13.2", + "description": "Checking if creating \"String.prototype.match object\" fails", + "test": "var __FACTORY = String.prototype.match;\n\ntry {\n var __instance = new __FACTORY;\n $FAIL('#1: __FACTORY = String.prototype.match; __FACTORY = String.prototype.match; __instance = new __FACTORY lead to throwing exception');\n} catch (e) {}\n", + "id": "S15.5.4.10_A7" + }, + { + "section": "15.5.4.10", + "description": "Checking if enumerating the String.prototype.match.length property fails", + "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#0\nif (!(String.prototype.match.hasOwnProperty('length'))) {\n $FAIL('#0: String.prototype.match.hasOwnProperty(\\'length\\') return true. Actual: '+String.prototype.match.hasOwnProperty('length'));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (String.prototype.match.propertyIsEnumerable('length')) {\n $ERROR('#1: String.prototype.match.propertyIsEnumerable(\\'length\\') return false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n// CHECK#2\nvar count=0;\n\nfor (p in String.prototype.match){\n if (p===\"length\") count++;\n}\n\nif (count !== 0) {\n $ERROR('#2: count=0; for (p in String.prototype.match){if (p===\"length\") count++;}; count === 0. Actual: '+count );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A8" + }, + { + "section": "15.5.4.10", + "description": "Checking if deleting the String.prototype.match.length property fails", + "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#0\nif (!(String.prototype.match.hasOwnProperty('length'))) {\n $FAIL('#0: String.prototype.match.hasOwnProperty(\\'length\\') return true. Actual: '+String.prototype.match.hasOwnProperty('length'));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (delete String.prototype.match.length) {\n $ERROR('#1: delete String.prototype.match.length return false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (!(String.prototype.match.hasOwnProperty('length'))) {\n $FAIL('#2: delete String.prototype.match.length; String.prototype.match.hasOwnProperty(\\'length\\') return true. Actual: '+String.prototype.match.hasOwnProperty('length'));\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S15.5.4.10_A9" + } + ] + } +} |