js/src/tests/ecma_2/Exceptions/lexical-004.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /**
     8    File Name:          lexical-004.js
     9    Corresponds To:     ecma/LexicalExpressions/7.4.1-1-n.js
    10    ECMA Section:       7.4.1
    12    Description:
    14    Reserved words cannot be used as identifiers.
    16    ReservedWord ::
    17    Keyword
    18    FutureReservedWord
    19    NullLiteral
    20    BooleanLiteral
    22    Author:             christine@netscape.com
    23    Date:               12 november 1997
    25 */
    26 var SECTION = "lexical-004";
    27 var VERSION = "JS1_4";
    28 var TITLE   = "Keywords";
    30 startTest();
    31 writeHeaderToLog( SECTION + " "+ TITLE);
    33 var result = "Failed";
    34 var exception = "No exception thrown";
    35 var expect = "Passed";
    37 try {
    38   eval("var null = true;");
    39 } catch ( e ) {
    40   result = expect;
    41   exception = e.toString();
    42 }
    44 new TestCase(
    45   SECTION,
    46   "var null = true" +
    47   " (threw " + exception +")",
    48   expect,
    49   result );
    51 test();

mercurial