• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:          12.9-1-n.js
24    ECMA Section:       12.9 The return statement
25    Description:
26
27    Author:             christine@netscape.com
28    Date:               12 november 1997
29*/
30    var SECTION = "12.9-1-n";
31    var VERSION = "ECMA_1";
32    startTest();
33    var testcases = getTestCases();
34
35    writeHeaderToLog( SECTION + " The return statement");
36    test();
37
38function test() {
39    for ( tc=0; tc < testcases.length; tc++ ) {
40
41        testcases[tc].actual = eval( testcases[tc].actual );
42
43        testcases[tc].passed = writeTestCaseResult(
44                            testcases[tc].expect,
45                            testcases[tc].actual,
46                            testcases[tc].description +" = "+
47                            testcases[tc].actual );
48
49        testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
50    }
51    stopTest();
52    return ( testcases );
53}
54function getTestCases() {
55    var array = new Array();
56    var item = 0;
57
58    array[item++] = new TestCase(   SECTION,
59                                    "return",
60                                    "error",
61                                    "return" );
62
63    return ( array );
64}
65