js/src/tests/test262/ch13/13.2/S13.2.2_A9.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:c0eaa310d24c
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 * Calling a function as a constructor is inadmissible as long as this.any_Function is called before it is declared
6 *
7 * @path ch13/13.2/S13.2.2_A9.js
8 * @description Calling a function as a constructor
9 */
10
11 function FACTORY(){
12 this.id = 0;
13
14 this.id = this.func();
15
16 this.func = function (){
17 return 5;
18 }
19
20 }
21 //////////////////////////////////////////////////////////////////////////////
22 //CHECK#1
23 try {
24 var obj = new FACTORY();
25 $ERROR('#1: var obj = new FACTORY() lead to throwing exception');
26 } catch (e) {
27 if (e instanceof Test262Error) throw e;
28 }
29 //
30 //////////////////////////////////////////////////////////////////////////////
31

mercurial