Home | History | Annotate | Download | only in Math
      1 /* The contents of this file are subject to the Netscape Public
      2  * License Version 1.1 (the "License"); you may not use this file
      3  * except in compliance with the License. You may obtain a copy of
      4  * the License at http://www.mozilla.org/NPL/
      5  *
      6  * Software distributed under the License is distributed on an "AS
      7  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
      8  * implied. See the License for the specific language governing
      9  * rights and limitations under the License.
     10  *
     11  * The Original Code is Mozilla Communicator client code, released March
     12  * 31, 1998.
     13  *
     14  * The Initial Developer of the Original Code is Netscape Communications
     15  * Corporation. Portions created by Netscape are
     16  * Copyright (C) 1998 Netscape Communications Corporation. All
     17  * Rights Reserved.
     18  *
     19  * Contributor(s):
     20  *
     21  */
     22 /**
     23     File Name:          15.8-2.js
     24     ECMA Section:       15.8 The Math Object
     25 
     26     Description:
     27 
     28     The Math object is merely a single object that has some named properties,
     29     some of which are functions.
     30 
     31     The value of the internal [[Prototype]] property of the Math object is the
     32     Object prototype object (15.2.3.1).
     33 
     34     The Math object does not have a [[Construct]] property; it is not possible
     35     to use the Math object as a constructor with the new operator.
     36 
     37     The Math object does not have a [[Call]] property; it is not possible to
     38     invoke the Math object as a function.
     39 
     40     Recall that, in this specification, the phrase "the number value for x" has
     41     a technical meaning defined in section 8.5.
     42 
     43     Author:             christine (at) netscape.com
     44     Date:               12 november 1997
     45 
     46 */
     47 
     48     var SECTION = "15.8-2-n";
     49     var VERSION = "ECMA_1";
     50     startTest();
     51     var TITLE   = "The Math Object";
     52 
     53     writeHeaderToLog( SECTION + " "+ TITLE);
     54 
     55     var testcases = getTestCases();
     56     test();
     57 
     58 
     59 function getTestCases() {
     60     var array = new Array();
     61     var item = 0;
     62     array[item++] = new TestCase( SECTION,
     63                                  "MYMATH = new Math()",
     64                                  "error",
     65                                  "MYMATH = new Math()" );
     66 
     67     return ( array );
     68 }
     69 function test() {
     70     for ( tc=0; tc < testcases.length; tc++ ) {
     71         testcases[tc].actual = eval( testcases[tc].actual );
     72 
     73         testcases[tc].passed = writeTestCaseResult(
     74                             testcases[tc].expect,
     75                             testcases[tc].actual,
     76                             testcases[tc].description +" = "+
     77                             testcases[tc].actual );
     78 
     79         testcases[tc].reason += "Math does not have the [Construct] property";
     80     }
     81     stopTest();
     82     return ( testcases );
     83 }
     84