Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-110286.js

raw symbols SCIP
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/. */
5
6 /*
7 *
8 * Date: 16 Nov 2001
9 * SUMMARY: multiline comments containing "/*" should not be syntax errors
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=110286
11 *
12 */
13 //-----------------------------------------------------------------------------
14 var gTestfile = 'regress-110286.js';
15 var UBound = 0;
16 var BUGNUMBER = 110286;
17 var summary = 'Multiline comments containing "/*" should not be syntax errors';
18 var status = '';
19 var statusitems = [];
20 var actual = '';
21 var actualvalues = [];
22 var expect= '';
23 var expectedvalues = [];
24
25
26 status = inSection(1);
27 actual = eval("/* /* */3");
28 expect = 3;
29 addThis();
30
31 status = inSection(2);
32 actual = eval("3/* /* */");
33 expect = 3;
34 addThis();
35
36 status = inSection(3);
37 actual = eval("/* 3/* */");
38 expect = undefined;
39 addThis();
40
41 status = inSection(4);
42 actual = eval("/* /*3 */");
43 expect = undefined;
44 addThis();
45
46 status = inSection(5);
47 var passed = true;
48 try
49 {
50 eval("/* blah blah /* blah blah */");
51 }
52 catch(e)
53 {
54 passed = false;
55 }
56 actual = passed;
57 expect = true;
58 addThis();
59
60
61 status = inSection(6);
62 try
63 {
64 /*
65 /*A/* /* /*A/*
66 /* blah blah /*
67 /* blah blah /*
68 /* /*A/* /*A/*
69 */
70 var result = 'PASSED';
71 }
72 catch(e)
73 {
74 var result = 'FAILED';
75 }
76 actual = result;
77 expect = 'PASSED';
78 addThis();
79
80
81 status = inSection(7);
82 var str = 'ABC';
83 /*
84 * /*
85 * /*
86 * /*
87 * /*
88 *
89 */
90 str += 'DEF';
91 actual = str;
92 expect = 'ABCDEF';
93 addThis();
94
95
96
97 //-----------------------------------------------------------------------------
98 test();
99 //-----------------------------------------------------------------------------
100
101
102 function addThis()
103 {
104 statusitems[UBound] = status;
105 actualvalues[UBound] = actual;
106 expectedvalues[UBound] = expect;
107 UBound++;
108 }
109
110
111 function test()
112 {
113 enterFunc ('test');
114 printBugNumber(BUGNUMBER);
115 printStatus (summary);
116
117 for (var i = 0; i < UBound; i++)
118 {
119 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
120 }
121
122 exitFunc ('test');
123 }