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/. */
8
* Date: 09 November 2002
9
* SUMMARY: JS should treat --> as a single-line comment indicator.
10
* Whitespace may occur before the --> on the same line.
12
* See http://bugzilla.mozilla.org/show_bug.cgi?id=31255
13
* and http://bugzilla.mozilla.org/show_bug.cgi?id=179366 (Rhino version)
15
* Note: <!--, --> are the HTML multi-line comment opener, closer.
16
* JS already accepted <!-- as a single-line comment indicator.
19
//-----------------------------------------------------------------------------
21
var BUGNUMBER = 31255;
22
var summary = 'JS should treat --> as a single-line comment indicator';
26
var actualvalues = [];
28
var expectedvalues = [];
31
<!-- HTML comment start is already a single-line JS comment indicator
32
var x = 1; <!-- until end-of-line
34
status = inSection(1);
39
--> HTML comment end is JS comments until end-of-line
40
--> but only if it follows a possible whitespace after line start
41
--> so in the following --> should not be treated as comments
45
status = inSection(2);
52
//-----------------------------------------------------------------------------
54
//-----------------------------------------------------------------------------
60
statusitems[UBound] = status;
61
actualvalues[UBound] = actual;
62
expectedvalues[UBound] = expect;
70
printBugNumber(BUGNUMBER);
73
for (var i=0; i<UBound; i++)
75
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);