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

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 // Copyright 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * Calling a function as a constructor is inadmissible as long as this.any_Function is called before it is declared
     6  *
     7  * @path ch13/13.2/S13.2.2_A9.js
     8  * @description Calling a function as a constructor
     9  */
    11 function FACTORY(){
    12    this.id = 0;
    14    this.id = this.func();
    16    this.func = function (){
    17       return 5;
    18    }
    20 }
    21 //////////////////////////////////////////////////////////////////////////////
    22 //CHECK#1
    23 try {
    24 	var obj = new FACTORY();
    25 	$ERROR('#1: var obj = new FACTORY() lead to throwing exception');
    26 } catch (e) {
    27     if (e instanceof Test262Error) throw e;
    28 }
    29 //
    30 //////////////////////////////////////////////////////////////////////////////

mercurial