js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A2.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:8f7e0e7ca209
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 * Properties of the [[Prototype]] object
6 * are visible as properties of the child object for the purposes of get access, but not for put access
7 *
8 * @path ch08/8.6/8.6.2/S8.6.2_A2.js
9 * @description Check visibility properties of the child object for the purposes of get access, but not for put access
10 */
11
12 //Establish foo object
13 function FooObj(){};
14 FooObj.prototype.prop="some";
15
16 // Invoke instance of foo object
17 var foo= new FooObj;
18
19 //////////////////////////////////////////////////////////////////////////////
20 //CHECK#1
21 if (foo.prop !== "some"){
22 $ERROR('#1: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop === "some". Actual: ' + (foo.prop));
23 }
24 //
25 //////////////////////////////////////////////////////////////////////////////
26
27 //////////////////////////////////////////////////////////////////////////////
28 //CHECK#2
29 foo.prop=true;
30 // Invoke another instance of foo object
31 var foo__ = new FooObj;
32 if (foo__.prop !== "some"){
33 $ERROR('#2: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop=true; var foo__ = new FooObj; foo__.prop === "some". Actual: ' + (foo__.prop));
34 }
35 //
36 //////////////////////////////////////////////////////////////////////////////
37

mercurial