Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/S11.1.5_A3.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: "Evaluate the production ObjectLiteral: { PropertyNameAndValueList }"
6 es5id: 11.1.5_A3
7 description: >
8 Creating the object defined with "var object = {0 : 1, "1" : "x",
9 o : {}}"
10 ---*/
11
12 var object = {0 : 1, "1" : "x", o : {}};
13
14 //CHECK#1
15 if (object[0] !== 1) {
16 $ERROR('#1: var object = {0 : 1; "1" : "x"; o : {}}; object[0] === 1. Actual: ' + (object[0]));
17 }
18
19 //CHECK#2
20 if (object["1"] !== "x") {
21 $ERROR('#2: var object = {0 : 1; "1" : "x"; o : {}}; object["1"] === "x". Actual: ' + (object["1"]));
22 }
23
24 //CHECK#3
25 if (typeof object.o !== "object") {
26 $ERROR('#1: var object = {0 : 1; "1" : "x"; o : {}}; typeof object.o === "object". Actual: ' + (typeof object.o));
27 }