Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/S11.1.5_A1.3.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 Evaluate the production ObjectLiteral: { StringLiteral :
7 AssignmentExpression}
8 es5id: 11.1.5_A1.3
9 description: >
10 Checking various properteis and contents of the object defined
11 with "var object = {"x" : true}"
12 ---*/
13
14 var object = {"x" : true};
15
16 //CHECK#1
17 if (typeof object !== "object") {
18 $ERROR('#1: var object = {"x" : true}; typeof object === "object". Actual: ' + (typeof object));
19 }
20
21 //CHECK#2
22 if (object instanceof Object !== true) {
23 $ERROR('#2: var object = {"x" : true}; object instanceof Object === true');
24 }
25
26 //CHECK#3
27 if (object.toString !== Object.prototype.toString) {
28 $ERROR('#3: var object = {"x" : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString));
29 }
30
31 //CHECK#4
32 if (object["x"] !== true) {
33 $ERROR('#4: var object = {"x" : true}; object["x"] === true');
34 }
35
36 //CHECK#5
37 if (object.x !== true) {
38 $ERROR('#5: var object = {"x" : true}; object.x === true');
39 }