Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /**
5 * Since a function is an object, it might be set to [[Prototype]] property of a new created object through [[Construct]] property
6 *
7 * @path ch13/13.2/S13.2.2_A1_T1.js
8 * @description Declaring a function with "function __func()"
9 */
11 var __MONSTER="monster";
12 var __PREDATOR="predator";
14 function __PROTO(){};
16 try{
17 __PROTO.type=__MONSTER;
18 }
19 catch(e){
20 $ERROR('#0: __PROTO.type=__MONSTER does not lead to throwing exception')
21 }
23 function __FACTORY(){this.name=__PREDATOR};
25 __FACTORY.prototype=__PROTO;
27 var __monster = new __FACTORY();
29 //////////////////////////////////////////////////////////////////////////////
30 //CHECK#1
31 if (!(__PROTO.isPrototypeOf(__monster))) {
32 $ERROR('#1: __PROTO.isPrototypeOf(__monster) must be true');
33 }
34 //
35 //////////////////////////////////////////////////////////////////////////////
37 //////////////////////////////////////////////////////////////////////////////
38 //CHECK#2
39 if (__monster.type !==__MONSTER) {
40 $ERROR('#2: __monster.type ===__MONSTER. Actual: __monster.type ==='+__monster.type);
41 }
42 //
43 //////////////////////////////////////////////////////////////////////////////