js/src/tests/js1_5/Regress/regress-110286.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_5/Regress/regress-110286.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,122 @@
     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 + * Date: 16 Nov 2001
    1.12 + * SUMMARY: multiline comments containing "/*" should not be syntax errors
    1.13 + * See http://bugzilla.mozilla.org/show_bug.cgi?id=110286
    1.14 + *
    1.15 + */
    1.16 +//-----------------------------------------------------------------------------
    1.17 +var UBound = 0;
    1.18 +var BUGNUMBER = 110286;
    1.19 +var summary = 'Multiline comments containing "/*" should not be syntax errors';
    1.20 +var status = '';
    1.21 +var statusitems = [];
    1.22 +var actual = '';
    1.23 +var actualvalues = [];
    1.24 +var expect= '';
    1.25 +var expectedvalues = [];
    1.26 +
    1.27 +
    1.28 +status = inSection(1);
    1.29 +actual = eval("/* /* */3");
    1.30 +expect = 3;
    1.31 +addThis();
    1.32 +
    1.33 +status = inSection(2);
    1.34 +actual = eval("3/* /* */");
    1.35 +expect = 3;
    1.36 +addThis();
    1.37 +
    1.38 +status = inSection(3);
    1.39 +actual = eval("/* 3/* */");
    1.40 +expect = undefined;
    1.41 +addThis();
    1.42 +
    1.43 +status = inSection(4);
    1.44 +actual = eval("/* /*3 */");
    1.45 +expect = undefined;
    1.46 +addThis();
    1.47 +
    1.48 +status = inSection(5);
    1.49 +var passed = true;
    1.50 +try
    1.51 +{
    1.52 +  eval("/* blah blah /* blah blah */");
    1.53 +}
    1.54 +catch(e)
    1.55 +{
    1.56 +  passed = false;
    1.57 +}
    1.58 +actual = passed;
    1.59 +expect = true;
    1.60 +addThis();
    1.61 +
    1.62 +
    1.63 +status = inSection(6);
    1.64 +try
    1.65 +{
    1.66 +  /*
    1.67 +    /*A/* /* /*A/*
    1.68 +    /* blah blah /*
    1.69 +    /* blah blah /*
    1.70 +    /* /*A/* /*A/*
    1.71 +  */
    1.72 +  var result = 'PASSED';
    1.73 +}
    1.74 +catch(e)
    1.75 +{
    1.76 +  var result = 'FAILED';
    1.77 +}
    1.78 +actual = result;
    1.79 +expect = 'PASSED';
    1.80 +addThis();
    1.81 +
    1.82 +
    1.83 +status = inSection(7);
    1.84 +var str = 'ABC';
    1.85 +/*
    1.86 + *    /*
    1.87 + *    /*
    1.88 + *    /*
    1.89 + *    /*
    1.90 + *
    1.91 + */
    1.92 +str += 'DEF';
    1.93 +actual = str;
    1.94 +expect = 'ABCDEF';
    1.95 +addThis();
    1.96 +
    1.97 +
    1.98 +
    1.99 +//-----------------------------------------------------------------------------
   1.100 +test();
   1.101 +//-----------------------------------------------------------------------------
   1.102 +
   1.103 +
   1.104 +function addThis()
   1.105 +{
   1.106 +  statusitems[UBound] = status;
   1.107 +  actualvalues[UBound] = actual;
   1.108 +  expectedvalues[UBound] = expect;
   1.109 +  UBound++;
   1.110 +}
   1.111 +
   1.112 +
   1.113 +function test()
   1.114 +{
   1.115 +  enterFunc ('test');
   1.116 +  printBugNumber(BUGNUMBER);
   1.117 +  printStatus (summary);
   1.118 +
   1.119 +  for (var i = 0; i < UBound; i++)
   1.120 +  {
   1.121 +    reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
   1.122 +  }
   1.123 +
   1.124 +  exitFunc ('test');
   1.125 +}

mercurial