parsing bug for javascript comments

RESOLVED INVALID

Status

RESOLVED INVALID
16 years ago
9 years ago

People

(Reporter: steele, Assigned: hewitt)

Tracking

Trunk
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826

The following HTML code "should" work (does for I.E. 6 and Netscape 6.2) but the
JavaScript Console complains about the trailing --> 

   <a href="http://validator.w3.org/check/referer">Valid XHTML 1.1 document</a>
   <script type="text/javaScript">
    <!-- /* <![CDATA[ */
    document.write(", last modified on " + document.lastModified);
    /* ]]> */ --> 
   </script>


Reproducible: Always

Steps to Reproduce:
1. enter the javaScript code I show and see that the last modification date is
not shown, the JavaScript Console says the trailing --> is a syntax error
2.
3.

Actual Results:  
No last modification date is shown due to a JavaScript Syntax error

Expected Results:  
Show the last modification date (i.e. allow --> as the last non-white space
characters in a JavaScript block)

Yes, I KNOW that 
// ]]>  --> 
would work, but I want to use the same comment structures for marking PCDATA as
CDATA in style and script blocks

Comment 1

16 years ago
--> has no meaning in JavaScript. You have to comment it out.

either // ]]> -->
or /* ]]> --> */


INVALID
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → INVALID
Product: Core → SeaMonkey

Updated

9 years ago
Component: Error Console → Error Console
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.