aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/14.1.json
blob: 23c5c1f9dcc4fc78e49eb975c9b6b72b20e9baf0 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{
 "testCollection": {
  "name": "14.1",
  "numTests": 17,
  "tests": [
   {
    "id": "14.1-1-s",
    "path": "TestCases/chapter14/14.1/14.1-1-s.js",
    "description": "'use strict' directive - correct usage",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    'use strict';\n     return(this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-10-s",
    "path": "TestCases/chapter14/14.1/14.1-10-s.js",
    "description": "other directives - may follow 'use strict' directive ",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n     \"use strict\";\n     \"bogus directive\";\n     return (this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-11-s",
    "path": "TestCases/chapter14/14.1/14.1-11-s.js",
    "description": "comments may preceed 'use strict' directive ",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n     // comment\n     /* comment */ \"use strict\";\n\n   return(this === undefined);\n   \n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-12-s",
    "path": "TestCases/chapter14/14.1/14.1-12-s.js",
    "description": "comments may follow 'use strict' directive ",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n     \"use strict\";    /* comment */   // comment\n     \n     return (this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-13-s",
    "path": "TestCases/chapter14/14.1/14.1-13-s.js",
    "description": "semicolon insertion works for'use strict' directive ",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    \"use strict\"     \n     return (this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-14-s",
    "path": "TestCases/chapter14/14.1/14.1-14-s.js",
    "description": "semicolon insertion may come before 'use strict' directive ",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    \"another directive\"\n    \"use strict\" ;    \n    return (this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-15-s",
    "path": "TestCases/chapter14/14.1/14.1-15-s.js",
    "description": "blank lines may come before 'use strict' directive ",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n\n\n\n\n\n\n    \"use strict\" ;    \n    return (this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-16-s",
    "path": "TestCases/chapter14/14.1/14.1-16-s.js",
    "description": "'use strict' directive - not recognized if it follow an empty statement",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    ; 'use strict';\n     return (this !== undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "14.1-17-s",
    "path": "TestCases/chapter14/14.1/14.1-17-s.js",
    "description": "'use strict' directive - not recognized if it follow some other statment empty statement",
    "test": "/// Copyright (c) 2009 Microsoft Corporation \n/// \n/// Redistribution and use in source and binary forms, with or without modification, are permitted provided\n/// that the following conditions are met: \n///    * Redistributions of source code must retain the above copyright notice, this list of conditions and\n///      the following disclaimer. \n///    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and \n///      the following disclaimer in the documentation and/or other materials provided with the distribution.  \n///    * Neither the name of Microsoft nor the names of its contributors may be used to\n///      endorse or promote products derived from this software without specific prior written permission.\n/// \n/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.assertTrue((function testcase() {\n\n  function foo()\n  {\n    var x;\n    'use strict';\n    return (this !== undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "14.1-2-s",
    "path": "TestCases/chapter14/14.1/14.1-2-s.js",
    "description": "\"use strict\" directive - correct usage double quotes",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    \"use strict\";\n     return (this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-3-s",
    "path": "TestCases/chapter14/14.1/14.1-3-s.js",
    "description": "'use strict' directive - not recognized if it contains extra whitespace",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    '  use    strict   ';\n     return (this !== undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "14.1-4-s",
    "path": "TestCases/chapter14/14.1/14.1-4-s.js",
    "description": "'use strict' directive - not recognized if contains Line Continuation",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    'use str\\\nict';\n     return (this !== undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "14.1-5-s",
    "path": "TestCases/chapter14/14.1/14.1-5-s.js",
    "description": "'use strict' directive - not recognized if contains a EscapeSequence",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    'use\\u0020strict';\n     return(this !== undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "14.1-6-s",
    "path": "TestCases/chapter14/14.1/14.1-6-s.js",
    "description": "'use strict' directive - not recognized if contains a <TAB> instead of a space",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    'use\tstrict';\n     return (this !== undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "14.1-7-s",
    "path": "TestCases/chapter14/14.1/14.1-7-s.js",
    "description": "'use strict' directive - not recognized if upper case",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n    'Use Strict';\n     return (this !== undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "strict_only": ""
   },
   {
    "id": "14.1-8-s",
    "path": "TestCases/chapter14/14.1/14.1-8-s.js",
    "description": "'use strict' directive - may follow other directives",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n     \"bogus directive\";\n     \"use strict\";\n     return (this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   },
   {
    "id": "14.1-9-s",
    "path": "TestCases/chapter14/14.1/14.1-9-s.js",
    "description": "'use strict' directive - may occur multiple times",
    "test": "assertTrue((function testcase() {\n\n  function foo()\n  {\n     'use strict';\n     \"use strict\";\n     return (this === undefined);\n  }\n\n  return foo.call(undefined);\n }).call(this));\n",
    "precondition": "(fnSupportsStrict())",
    "strict_only": ""
   }
  ]
 }
}