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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma/LexicalConventions/7.3-1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +/**
    1.11 +   File Name:          7.3-1.js
    1.12 +   ECMA Section:       7.3 Comments
    1.13 +   Description:
    1.14 +
    1.15 +
    1.16 +   Author:             christine@netscape.com
    1.17 +   Date:               12 november 1997
    1.18 +
    1.19 +*/
    1.20 +var SECTION = "7.3-1";
    1.21 +var VERSION = "ECMA_1";
    1.22 +startTest();
    1.23 +var TITLE   = "Comments";
    1.24 +
    1.25 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.26 +
    1.27 +var testcase;
    1.28 +
    1.29 +testcase = new TestCase( SECTION,
    1.30 +			 "a comment with a line terminator string, and text following",
    1.31 +			 "pass",
    1.32 +			 "pass");
    1.33 +
    1.34 +// "\u000A" testcase.actual = "fail";
    1.35 +
    1.36 +
    1.37 +testcase = new TestCase( SECTION,
    1.38 +			 "// test \\n testcase.actual = \"pass\"",
    1.39 +			 "pass",
    1.40 +			 "" );
    1.41 +
    1.42 +var x = "// test \n testcase.actual = 'pass'";
    1.43 +
    1.44 +testcase.actual = eval(x);
    1.45 +
    1.46 +test();
    1.47 +
    1.48 +// XXX bc replace test()
    1.49 +function test() {
    1.50 +  for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
    1.51 +    gTestcases[gTc].passed = writeTestCaseResult(
    1.52 +      gTestcases[gTc].expect,
    1.53 +      gTestcases[gTc].actual,
    1.54 +      gTestcases[gTc].description +":  "+
    1.55 +      gTestcases[gTc].actual );
    1.56 +
    1.57 +    gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : " ignored chars after line terminator of single-line comment";
    1.58 +  }
    1.59 +  stopTest();
    1.60 +  return ( gTestcases );
    1.61 +}

mercurial