S11.1.5_A1.4.js (1194B)
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: { Identifier : 7 AssignmentExpression} 8 es5id: 11.1.5_A1.4 9 description: > 10 Checking various properteis and contents of the object defined 11 with "var object = {prop : true}" 12 ---*/ 13 14 var object = {prop : true}; 15 16 //CHECK#1 17 if (typeof object !== "object") { 18 throw new Test262Error('#1: var object = {prop : true}; typeof object === "object". Actual: ' + (typeof object)); 19 } 20 21 //CHECK#2 22 if (object instanceof Object !== true) { 23 throw new Test262Error('#2: var object = {prop : true}; object instanceof Object === true'); 24 } 25 26 //CHECK#3 27 if (object.toString !== Object.prototype.toString) { 28 throw new Test262Error('#3: var object = {prop : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString)); 29 } 30 31 //CHECK#4 32 if (object["prop"] !== true) { 33 throw new Test262Error('#4: var object = {prop : true}; object["prop"] === true'); 34 } 35 36 //CHECK#5 37 if (object.prop !== true) { 38 throw new Test262Error('#5: var object = {prop : true}; object.prop === true'); 39 } 40 41 reportCompare(0, 0);