S13.2.2_A14.js (850B)
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 info: | 6 Calling a function as a constructor is inadmissible as long as 7 this.any_Function is declared by eval and called 8 es5id: 13.2.2_A14 9 description: > 10 Calling a function as a constructor after it has been declared by 11 eval 12 flags: [noStrict] 13 ---*/ 14 15 function FACTORY(){ 16 this.id = 0; 17 18 eval("function func(){return \"id_string\";}"); 19 20 this.id = func(); 21 22 } 23 ////////////////////////////////////////////////////////////////////////////// 24 //CHECK#1 25 try { 26 var obj = new FACTORY(); 27 } catch (e) { 28 throw new Test262Error('#1: var obj = new FACTORY() does not lead to throwing exception'); 29 } 30 // 31 ////////////////////////////////////////////////////////////////////////////// 32 33 reportCompare(0, 0);