|
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_A14.js |
|
8 * @description Calling a function as a constructor after it has been declared by eval |
|
9 * @noStrict |
|
10 */ |
|
11 |
|
12 function FACTORY(){ |
|
13 this.id = 0; |
|
14 |
|
15 eval("function func(){return \"id_string\";}"); |
|
16 |
|
17 this.id = func(); |
|
18 |
|
19 } |
|
20 ////////////////////////////////////////////////////////////////////////////// |
|
21 //CHECK#1 |
|
22 try { |
|
23 var obj = new FACTORY(); |
|
24 } catch (e) { |
|
25 $ERROR('#1: var obj = new FACTORY() does not lead to throwing exception'); |
|
26 } |
|
27 // |
|
28 ////////////////////////////////////////////////////////////////////////////// |
|
29 |