js/src/tests/ecma/LexicalConventions/7.3-1.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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:          7.3-1.js
     9    ECMA Section:       7.3 Comments
    10    Description:
    13    Author:             christine@netscape.com
    14    Date:               12 november 1997
    16 */
    17 var SECTION = "7.3-1";
    18 var VERSION = "ECMA_1";
    19 startTest();
    20 var TITLE   = "Comments";
    22 writeHeaderToLog( SECTION + " "+ TITLE);
    24 var testcase;
    26 testcase = new TestCase( SECTION,
    27 			 "a comment with a line terminator string, and text following",
    28 			 "pass",
    29 			 "pass");
    31 // "\u000A" testcase.actual = "fail";
    34 testcase = new TestCase( SECTION,
    35 			 "// test \\n testcase.actual = \"pass\"",
    36 			 "pass",
    37 			 "" );
    39 var x = "// test \n testcase.actual = 'pass'";
    41 testcase.actual = eval(x);
    43 test();
    45 // XXX bc replace test()
    46 function test() {
    47   for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
    48     gTestcases[gTc].passed = writeTestCaseResult(
    49       gTestcases[gTc].expect,
    50       gTestcases[gTc].actual,
    51       gTestcases[gTc].description +":  "+
    52       gTestcases[gTc].actual );
    54     gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : " ignored chars after line terminator of single-line comment";
    55   }
    56   stopTest();
    57   return ( gTestcases );
    58 }

mercurial