S13.2.2_A13.js (881B)
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_A13 9 description: > 10 Calling a function as a constructor after it has been declared by 11 eval 12 ---*/ 13 14 function FACTORY(){ 15 this.id = 0; 16 17 this.id = func(); 18 19 eval("function func(){return \"id_string\";}"); 20 21 } 22 ////////////////////////////////////////////////////////////////////////////// 23 //CHECK#1 24 try { 25 var obj = new FACTORY(); 26 throw new Test262Error('#1: var obj = new FACTORY() lead to throwing exception'); 27 } catch (e) { 28 if (e instanceof Test262Error) throw e; 29 } 30 // 31 ////////////////////////////////////////////////////////////////////////////// 32 33 reportCompare(0, 0);