Home | History | Annotate | Download | only in Exceptions
      1 /**
      2     File Name:          statement-001.js
      3     Corresponds To:     12.6.2-9-n.js
      4     ECMA Section:       12.6.2 The for Statement
      5 
      6                         1. first expression is not present.
      7                         2. second expression is not present
      8                         3. third expression is not present
      9 
     10 
     11     Author:             christine (at) netscape.com
     12     Date:               15 september 1997
     13 */
     14 
     15     var SECTION = "statement-001.js";
     16 //     var SECTION = "12.6.2-9-n";
     17     var VERSION = "ECMA_1";
     18     var TITLE   = "The for statment";
     19 
     20     startTest();
     21     writeHeaderToLog( SECTION + " "+ TITLE);
     22 
     23     var testcases = new Array();
     24     var tc = 0;
     25 
     26     var result = "Failed";
     27     var exception = "No exception thrown";
     28     var expect = "Passed";
     29 
     30     try {
     31         eval("for (i) {\n}");
     32     } catch ( e ) {
     33         result = expect;
     34         exception = e.toString();
     35     }
     36 
     37     testcases[tc++] = new TestCase(
     38         SECTION,
     39         "for(i) {}" +
     40         " (threw " + exception +")",
     41         expect,
     42         result );
     43 
     44     test();
     45