blob: c4235d3b7c9b9d6f6e0504920a4f3f7f9d27a2fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{
"testCollection": {
"name": "15.10.7.5_lastIndex",
"numTests": 2,
"tests": [
{
"section": "15.10.7.5",
"description": "Checking if enumerating the lastIndex property of RegExp instance fails",
"test": "__re = new RegExp(\"A?B\");\n\n//CHECK#0\nif (__re.hasOwnProperty('lastIndex') !== true) {\n $FAIL('#0: __re = new RegExp(\"A?B\"); __re.hasOwnProperty(\\'lastIndex\\') === true');\n}\n\n //CHECK#1\nif (__re.propertyIsEnumerable('lastIndex') !== false) {\n $ERROR('#1: __re = new RegExp(\"A?B\"); __re.propertyIsEnumerable(\\'lastIndex\\') === false');\n}\n\n //CHECK#2\ncount = 0\nfor (p in __re){\n if (p===\"lastIndex\") count++ \n}\n\nif (count !== 0) {\n $ERROR('#2: count = 0; __re = new RegExp(\"A?B\"); for (p in __re){ if (p===\"lastIndex\") count++; } count === 0. Actual: ' + (count));\n} \n",
"id": "S15.10.7.5_A8"
},
{
"section": "15.10.7.5",
"description": "Checking if deleting the lastIndex property fails",
"test": "__re = new RegExp;\n\n//CHECK#0\nif (__re.hasOwnProperty('lastIndex') !== true) {\n $FAIL('#0: __re = new RegExp; __re.hasOwnProperty(\\'lastIndex\\') === true');\n}\n\n//CHECK#1\nif ((delete __re.lastIndex) !== false) {\n $ERROR('#1: __re = new RegExp; (delete __re.lastIndex) === false');\n}\n\n//CHECK#2\nif (__re.hasOwnProperty('lastIndex') !== true) {\n $ERROR('#2: __re = new RegExp;delete __re.lastIndex === true; __re.hasOwnProperty(\\'lastIndex\\') === true');\n}\n\n",
"id": "S15.10.7.5_A9"
}
]
}
}
|