tor-browser

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

S8.12.3_A1.js (1293B)


      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    [[Get]](P) method should return value when property P does not exist in
      7    instance but prototype contain it
      8 es5id: 8.12.3_A1
      9 description: >
     10    Try to get P when property P does not exist in instance but
     11    prototype contain it
     12 ---*/
     13 
     14 //Establish foo object 
     15 function FooObj(){}; FooObj.prototype.propFoo="some";
     16 
     17 // Invoke instance of foo object
     18 var __obj= new FooObj;
     19 
     20 //////////////////////////////////////////////////////////////////////////////
     21 //CHECK#1
     22 if (__obj.propFoo !== "some"){
     23  throw new Test262Error('#1: function FooObj(){}; FooObj.prototype.propFoo="some"; var __obj= new FooObj; __obj.propFoo === "some". Actual: ' + (__obj.propFoo));
     24 }
     25 //
     26 //////////////////////////////////////////////////////////////////////////////
     27 
     28 //////////////////////////////////////////////////////////////////////////////
     29 //CHECK#2
     30 if (__obj['propFoo'] !== "some"){
     31  throw new Test262Error('#1: function FooObj(){}; FooObj.prototype.propFoo="some"; var __obj= new FooObj; __obj[\'propFoo\'] === "some". Actual: ' + (__obj['propFoo']));
     32 }
     33 //
     34 //////////////////////////////////////////////////////////////////////////////
     35 
     36 reportCompare(0, 0);