michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Calling a function as a constructor is inadmissible as long as this.any_Function is called before it is declared michael@0: * michael@0: * @path ch13/13.2/S13.2.2_A9.js michael@0: * @description Calling a function as a constructor michael@0: */ michael@0: michael@0: function FACTORY(){ michael@0: this.id = 0; michael@0: michael@0: this.id = this.func(); michael@0: michael@0: this.func = function (){ michael@0: return 5; michael@0: } michael@0: michael@0: } michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: try { michael@0: var obj = new FACTORY(); michael@0: $ERROR('#1: var obj = new FACTORY() lead to throwing exception'); michael@0: } catch (e) { michael@0: if (e instanceof Test262Error) throw e; michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: