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

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

mercurial