Debian Codegraph @

js/src/tests/non262/regress/regress-110286.js

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