aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/12.14.1.json
blob: c3caa2c3aef46ed3fcfc2a2e3c90d69545ab5959 (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
45
46
47
48
49
50
51
52
53
{
 "testCollection": {
  "name": "12.14.1",
  "numTests": 6,
  "tests": [
   {
    "id": "12.14.1-1-s",
    "path": "TestCases/chapter12/12.14/12.14.1/12.14.1-1-s.js",
    "description": "Strict Mode - SyntaxError is thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is eval",
    "test": "assertTrue((function testcase() {\n        \"use strict\";\n\n        try {\n            eval(\"\\\n                   try {} catch (eval) { }\\\n            \");\n            return false;\n        } catch (e) {\n            return e instanceof SyntaxError;\n        }\n    }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "12.14.1-2-s",
    "path": "TestCases/chapter12/12.14/12.14.1/12.14.1-2-s.js",
    "description": "Strict Mode - SyntaxError is thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is arguments",
    "test": "assertTrue((function testcase() {\n        \"use strict\";\n\n        try {\n            eval(\"\\\n                   try {} catch (arguments) { }\\\n            \");\n            return false;\n        } catch (e) {\n            return e instanceof SyntaxError;\n        }\n    }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "12.14.1-3-s",
    "path": "TestCases/chapter12/12.14/12.14.1/12.14.1-3-s.js",
    "description": "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL but throws SyntaxError if it is eval",
    "test": "assertTrue((function testcase() {\n        \"use strict\";\n\n       try{ eval(\" try { \\\n             throw new Error(\\\"...\\\");\\\n             return false;\\\n         } catch (EVAL) {\\\n             try\\\n             {\\\n               throw new Error(\\\"...\\\");\\\n             }catch(eval)\\\n             {\\\n                 return EVAL instanceof Error;\\\n              }\\\n         }\");\n         return false;\n        } catch(e) {\n             return e instanceof SyntaxError;\n        }\n    }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "12.14.1-4-s",
    "path": "TestCases/chapter12/12.14/12.14.1/12.14.1-4-s.js",
    "description": "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL",
    "test": "assertTrue((function testcase() {\n        \"use strict\";\n\n        try {\n            throw new Error(\"...\");\n            return false;\n        } catch (EVAL) {\n            return EVAL instanceof Error;\n        }\n    }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "12.14.1-5-s",
    "path": "TestCases/chapter12/12.14/12.14.1/12.14.1-5-s.js",
    "description": "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is Arguments",
    "test": "assertTrue((function testcase() {\n        \"use strict\";\n\n        try {\n            throw new Error(\"...\");\n            return false;\n        } catch (Arguments) {\n            return Arguments instanceof Error;\n        }\n    }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "12.14.1-6-s",
    "path": "TestCases/chapter12/12.14/12.14.1/12.14.1-6-s.js",
    "description": "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is ARGUMENTS",
    "test": "assertTrue((function testcase() {\n        \"use strict\";\n\n        try {\n            throw new Error(\"...\");\n            return false;\n        } catch (ARGUMENTS) {\n            return ARGUMENTS instanceof Error;\n        }\n    }).call(this));\n",
    "strict_only": ""
   }
  ]
 }
}