2005-08-19 Florian Gross <flgr@ccan.de>
[mono.git] / mcs / class / Microsoft.JScript / Test / Mozilla / ecma_2 / Exceptions / lexical-031.js
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /**
3    File Name:          lexical-031.js
4    Corresponds To:     7.4.2-8-n.js
5    ECMA Section:       7.4.2
6
7    Description:
8    The following tokens are ECMAScript keywords and may not be used as
9    identifiers in ECMAScript programs.
10
11    Syntax
12
13    Keyword :: one of
14    break          for         new         var
15    continue       function    return      void
16    delete         if          this        while
17    else           in          typeof      with
18
19    This test verifies that the keyword cannot be used as an identifier.
20    Functioinal tests of the keyword may be found in the section corresponding
21    to the function of the keyword.
22
23    Author:             christine@netscape.com
24    Date:               12 november 1997
25
26 */
27 var SECTION = "lexical-031";
28 var VERSION = "JS1_4";
29 var TITLE   = "Keywords";
30
31 startTest();
32 writeHeaderToLog( SECTION + " "+ TITLE);
33
34 var result = "Failed";
35 var exception = "No exception thrown";
36 var expect = "Passed";
37
38 try {
39   eval("var return;");
40 } catch ( e ) {
41   result = expect;
42   exception = e.toString();
43 }
44
45 new TestCase(
46   SECTION,
47   "var return" +
48   " (threw " + exception +")",
49   expect,
50   result );
51
52 test();
53
54