aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.2.3.2.json
blob: ad38ccac64b8f230f615254ca4a20ebcdaa0479c (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
{
 "testCollection": {
  "name": "15.2.3.2",
  "numTests": 37,
  "tests": [
   {
    "id": "15.2.3.2-0-1",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-0-1.js",
    "description": "Object.getPrototypeOf must exist as a function",
    "test": "assertTrue((typeof(Object.getPrototypeOf) === \"function\"));\n"
   },
   {
    "id": "15.2.3.2-0-2",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-0-2.js",
    "description": "Object.getPrototypeOf must exist as a function taking 1 parameter",
    "test": "assertTrue((Object.getPrototypeOf.length === 1));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-0-3",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-0-3.js",
    "description": "Object.getPrototypeOf must take 1 parameter",
    "test": "assertTrue((function testcase() {\n  try\n  {\n    Object.getPrototypeOf();\n  }\n  catch(e)\n  {\n    if(e instanceof TypeError)\n      return true;\n  }\n }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-1-2",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-1-2.js",
    "description": "Object.getPrototypeOf throws TypeError if 'O' is null",
    "test": "assertTrue((function testcase() {\n        try {\n            Object.getPrototypeOf(null);\n            return false;\n        } catch (e) {\n            return (e instanceof TypeError);\n        }\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-1-3",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-1-3.js",
    "description": "Object.getPrototypeOf throws TypeError if 'O' is a boolean",
    "test": "assertTrue((function testcase() {\n        try {\n            Object.getPrototypeOf(true);\n            return false;\n        } catch (e) {\n            return (e instanceof TypeError);\n        }\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-1-4",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-1-4.js",
    "description": "Object.getPrototypeOf throws TypeError if 'O' is a string",
    "test": "assertTrue((function testcase() {\n        try {\n            Object.getPrototypeOf(\"abc\");\n            return false;\n        } catch (e) {\n            return (e instanceof TypeError);\n        }\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-1",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-1.js",
    "description": "Object.getPrototypeOf throws TypeError if type of first param is not Object",
    "test": "assertTrue((function testcase() {\n  try {\n    Object.getPrototypeOf(0);\n  }\n  catch (e) {\n    if (e instanceof TypeError) {\n      return true;\n    }\n  }\n }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-1",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-1.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Boolean)",
    "test": "assertTrue((Object.getPrototypeOf(Boolean) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-10",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-10.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (RegExp)",
    "test": "assertTrue((Object.getPrototypeOf(RegExp) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-11",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-11.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Error)",
    "test": "assertTrue((Object.getPrototypeOf(Error) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-12",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-12.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (EvalError)",
    "test": "assertTrue((Object.getPrototypeOf(EvalError) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-13",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-13.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (RangeError)",
    "test": "assertTrue((Object.getPrototypeOf(RangeError) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-14",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-14.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (ReferenceError)",
    "test": "assertTrue((Object.getPrototypeOf(ReferenceError) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-15",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-15.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (SyntaxError)",
    "test": "assertTrue((Object.getPrototypeOf(SyntaxError) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-16",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-16.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (TypeError)",
    "test": "assertTrue((Object.getPrototypeOf(TypeError) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-17",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-17.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (URIError)",
    "test": "assertTrue((Object.getPrototypeOf(URIError) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-18",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-18.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (JSON)",
    "test": "assertTrue((Object.getPrototypeOf(JSON) === Object.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-19",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-19.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Object object)",
    "test": "assertTrue((function testcase() {\n        var obj = {};\n\n        return Object.getPrototypeOf(obj) === Object.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-2",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-2.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (custom object)",
    "test": "assertTrue((function testcase() {\n  function base() {}\n\n  function derived() {}\n  derived.prototype = new base();\n\n  var d = new derived();\n  var x = Object.getPrototypeOf(d);\n  if (x.isPrototypeOf(d) === true) {\n    return true;\n  }\n }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-20",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-20.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Function Object)",
    "test": "assertTrue((function testcase() {\n        var obj = function (a, b) {\n            return a + b;\n        };\n\n        return Object.getPrototypeOf(obj) === Function.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-21",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-21.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Array object)",
    "test": "assertTrue((function testcase() {\n        var arr = [1, 2, 3];\n\n        return Object.getPrototypeOf(arr) === Array.prototype; \n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-22",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-22.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (String object)",
    "test": "assertTrue((function testcase() {\n        var obj = new String(\"abc\");\n\n        return Object.getPrototypeOf(obj) === String.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-23",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-23.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Boolean object)",
    "test": "assertTrue((function testcase() {\n        var obj = new Boolean(true);\n\n        return Object.getPrototypeOf(obj) === Boolean.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-24",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-24.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Number object)",
    "test": "assertTrue((function testcase() {\n        var obj = new Number(-3);\n\n        return Object.getPrototypeOf(obj) === Number.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-25",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-25.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Date object)",
    "test": "assertTrue((function testcase() {\n        var obj = new Date();\n\n        return Object.getPrototypeOf(obj) === Date.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-26",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-26.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (RegExp object)",
    "test": "assertTrue((function testcase() {\n        var obj = new RegExp();\n\n        return Object.getPrototypeOf(obj) === RegExp.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-27",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-27.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Error object)",
    "test": "assertTrue((function testcase() {\n        var obj = new Error();\n\n        return Object.getPrototypeOf(obj) === Error.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-28",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-28.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (the Arguments object)",
    "test": "assertTrue((function testcase() {\n        function fun() {\n            return arguments;\n        }\n        var obj = fun(1, true, 3);\n\n        return Object.getPrototypeOf(obj) === Object.prototype;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-3",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-3.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Object)",
    "test": "assertTrue((Object.getPrototypeOf(Object) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-30",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-30.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (the global object)",
    "test": "assertTrue((function testcase() {\n        var proto = Object.getPrototypeOf(fnGlobalObject());\n\n        return proto.isPrototypeOf(fnGlobalObject()) === true;\n    }).call(this));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-31",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-31.js",
    "description": "Object.getPrototypeOf returns null",
    "test": "assertTrue(((Object.getPrototypeOf(Object.prototype) === null)));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-4",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-4.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Function)",
    "test": "assertTrue((Object.getPrototypeOf(Function) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-5",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-5.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Array)",
    "test": "assertTrue((Object.getPrototypeOf(Array) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-6",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-6.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (String)",
    "test": "assertTrue((Object.getPrototypeOf(String) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-7",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-7.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Number)",
    "test": "assertTrue((Object.getPrototypeOf(Number) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-8",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-8.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Math)",
    "test": "assertTrue((Object.getPrototypeOf(Math) === Object.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   },
   {
    "id": "15.2.3.2-2-9",
    "path": "TestCases/chapter15/15.2/15.2.3/15.2.3.2/15.2.3.2-2-9.js",
    "description": "Object.getPrototypeOf returns the [[Prototype]] of its parameter (Date)",
    "test": "assertTrue((Object.getPrototypeOf(Date) === Function.prototype));\n",
    "precondition": "(fnExists(Object.getPrototypeOf))"
   }
  ]
 }
}