tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

S11.1.5_A1.3.js (1178B)


      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  throw new Test262Error('#1: var object = {"x" : 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 = {"x" : true}; object instanceof Object === true');
     24 }
     25 
     26 //CHECK#3
     27 if (object.toString !== Object.prototype.toString) {
     28  throw new Test262Error('#3: var object = {"x" : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString));
     29 }
     30 
     31 //CHECK#4
     32 if (object["x"] !== true) {
     33  throw new Test262Error('#4: var object = {"x" : true}; object["x"] === true');
     34 }
     35 
     36 //CHECK#5
     37 if (object.x !== true) {
     38  throw new Test262Error('#5: var object = {"x" : true}; object.x === true');
     39 }
     40 
     41 reportCompare(0, 0);