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