This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 226471

Summary: Expected an operand but found eof
Product: javascript Reporter: unai
Component: EditorAssignee: Petr Pisl <ppisl>
Status: STARTED ---    
Severity: normal CC: andreban
Priority: P3 Keywords: REGRESSION
Version: 7.3   
Hardware: PC   
OS: Windows XP x64   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Screenshot

Description unai 2013-02-21 15:59:30 UTC
Created attachment 131683 [details]
Screenshot

Error shows up for javascript in .JSP files which were OK for NetBeans 7.2.1.

Projects that were fine for NB 7.2 are now invalid for NB 7.3: have to switch back to 7.2 until upgrade gets seamless.
Comment 1 unai 2013-02-21 16:34:44 UTC
Ok, the problem is with the
-->
that ends the javascript-containing comment used to hide the code from very old user-agents not recognizing that script element.

NetBeans 7.2 (and all major rendering engines -- Trident, Gecko, Presto, WebKit, KHTML) allowed for
-->
while NetBeans 7.3 only allows for
//-->
(which actually is the right way to do it, but no javascript engine has ever complained about the missing //, and neither did NB7.2, so it looks like a regression. Sort of.).
Comment 2 Petr Pisl 2013-02-21 21:19:17 UTC
NetBeans 7.3 uses different JavaScript parser - Nashorn. It's more strict than Rhino that was used in NetBeans 7.2 - Rhino parser. 

Simple reproducible case:

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript"> 
            <!--
            var result = 20;
            -->
        </script>
    </head>
    <body>
    </body>
</html>

I will see what I can do on the NetBeans site.
Comment 3 unai 2013-08-22 14:28:28 UTC
(I accidentally created the bug as P4 instead of default's P3)