aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.10.7_Properties_of_RegExp_Instances.json
blob: 55829bd9cbe6eff821c91c6d7442c4c70f8f3e9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
 "testCollection": {
  "name": "15.10.7_Properties_of_RegExp_Instances",
  "numTests": 6,
  "tests": [
   {
    "section": "15.10.7",
    "description": "Checking if call of RegExp instance fails",
    "test": "//CHECK#1\ntry {\n\t$ERROR('#1.1: /[^a]*/() throw TypeError. Actual: ' + (/[^a]*/()));\n} catch (e) {\n\tif ((e instanceof TypeError) !== true) {\n\t\t$ERROR('#1.2: /[^a]*/() throw TypeError. Actual: ' + (e));\n\t}\n}\n\n",
    "id": "S15.10.7_A1_T1"
   },
   {
    "section": "15.10.7",
    "description": "Checking if call of RegExp(\"a|b\",\"g\")() fails",
    "test": "//CHECK#1\ntry {\n  $ERROR('#1.1: RegExp(\"a|b\",\"g\")() throw TypeError. Actual: ' + (RegExp(\"a|b\",\"g\")()));\n} catch (e) {\n  if ((e instanceof TypeError) !== true) {\n    $ERROR('#1.2: RegExp(\"a|b\",\"g\")() throw TypeError. Actual: ' + (e));\n  }\n}\n\n\n",
    "id": "S15.10.7_A1_T2"
   },
   {
    "section": "15.10.7",
    "description": "Checking if creating new RegExp instance fails",
    "test": "//CHECK#1\ntry {\n  $ERROR('#1.1: new /z/() throw TypeError. Actual: ' + (new /z/()));\n} catch (e) {\n  if ((e instanceof TypeError) !== true) {\n    $ERROR('#1.2: new /z/() throw TypeError. Actual: ' + (e));\n  }\n}\n\n",
    "id": "S15.10.7_A2_T1"
   },
   {
    "section": "15.10.7",
    "description": "Checking if creating \"new RegExp\" instance fails",
    "test": "//CHECK#1\ntry {\n  $ERROR('#1.1: new new RegExp throw TypeError. Actual: ' + (new new RegExp));\n} catch (e) {\n  if ((e instanceof TypeError) !== true) {\n    $ERROR('#1.2: new new RegExp throw TypeError. Actual: ' + (e));\n  }\n}\n\n",
    "id": "S15.10.7_A2_T2"
   },
   {
    "section": "15.10.7",
    "description": "Checking type of RegExp instance with operators typeof, instanceof and check it constructor.\nRegExp instance is /[^a]* /",
    "test": "__re = /[^a]*/;\n\n//CHECK#1\nif (typeof __re !== \"object\") {\n\t$ERROR('#1: __re = /[^a]*/; typeof __re === \"object\". Actual: ' + (typeof __re));\n}\n\n//CHECK#1\nif (__re.constructor !== RegExp) {\n\t$ERROR('#2: __re = /[^a]*/; __re.constructor === RegExp. Actual: ' + (__re.constructor));\n}\n\n//CHECK#3\nif ((__re instanceof RegExp) !== true) {\n\t$ERROR('#3: __re = /[^a]*/; (__re instanceof RegExp) === true');\n}\n\n",
    "id": "S15.10.7_A3_T1"
   },
   {
    "section": "15.10.7",
    "description": "Checking type of RegExp instance with operators typeof, instanceof and check it constructor.\nRegExp instance is new RegExp",
    "test": "__re = new RegExp;\n\n//CHECK#1\nif (typeof __re !== \"object\") {\n\t$ERROR('#1: __re = new RegExp; typeof __re === \"object\". Actual: ' + (typeof __re));\n}\n\n//CHECK#1\nif (__re.constructor !== RegExp) {\n\t$ERROR('#2: __re = new RegExp; __re.constructor === RegExp. Actual: ' + (__re.constructor));\n}\n\n//CHECK#3\nif ((__re instanceof RegExp) !== true) {\n\t$ERROR('#3: __re = new RegExp; (__re instanceof RegExp) === true');\n}\n\n",
    "id": "S15.10.7_A3_T2"
   }
  ]
 }
}