aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/11.1.2_Identifier_Reference.json
blob: 4c30bea7b74f5a591d1a015a006fba7e6b51f6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
 "testCollection": {
  "name": "11.1.2_Identifier_Reference",
  "numTests": 2,
  "tests": [
   {
    "section": "11.1.2",
    "description": "Creating variables without defining it",
    "test": "//CHECK#1\nif (this.x !== undefined) {\n  $ERROR('#1: this.x === undefined. Actual: ' + (this.x));\n}\n\n//CHECK#2\nvar object = new Object();\nif (object.prop !== undefined) {\n  $ERROR('#2: var object = new Object(); object.prop === undefined. Actual: ' + (object.prop));\n}\n\n//CHECK#3\nthis.y++;\nif (isNaN(y) !== true) {\n  $ERROR('#3: this.y++; y === Not-a-Number. Actual: ' + (y));\n}\n",
    "id": "S11.1.2_A1_T1"
   },
   {
    "section": "11.1.2",
    "description": "Trying to generate ReferenceError",
    "test": "//CHECK#1\ntry {\n  this.z;\n  z;\n  $ERROR('#1.1: this.z; z === undefined throw ReferenceError. Actual: ' + (z));\n} catch(e) {\n  if ((e instanceof ReferenceError) !== true) {\n    $ERROR('#1.2: this.z; z === undefined throw ReferenceError. Actual: ' + (e));\n  }\n}\n",
    "id": "S11.1.2_A1_T2"
   }
  ]
 }
}