Community
Participate
Working Groups
Build Identifier: 20100218-1602 The JavaScript validator tries to validates every script tag in a JSP file, no matter the 'type' or 'language' attributes value. SOLUTION: The problem is in file org.eclipse.wst.jsdt.web.core.javascript.JsTranslator, line 278, because if the 'type' or 'language' attributes are not javascript it applies the default JavaScript configuration for the file (by default true), no matter this attributes exist or not. It is solved if you change this line for: ******************************************************************************* if (NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("type")) || NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("language")) || (nh.getAttributeValue("type")==null && nh.getAttributeValue("language")==null && isGlobalJs())) { //$NON-NLS-1$ //$NON-NLS-2$ ******************************************************************************* testing that the 'type' and 'language' attributes don't exist before applying the default script configuration. I apologize if this is not the place to write the solution but I don't know where to do it. Thanx a lot. Reproducible: Always Steps to Reproduce: 1.Write a small script in a JSP file in vbscript with the right 'type' (text/vbscript) or 'language' (vbs or vbscript) attribute. Example: <script language="vbs"> function confirmation(msg) v=msgbox(msg, vbquestion+vbyesnocancel,"Attention") select case v case 6 v="yes" case 7 v="no" case 2 v="cancel" end select confirmation=v end function </script> 2.Run the JavaScript validator 3.The validator "detects" a lot of problems as it is not JavaScript code
Hi Koke, What you should do is create a patch and attach it to this bug. Then one of the committers will review it. Right-click on your project -> Team -> Create patch...
Created attachment 169475 [details] This the unified diff of my file with the bug solved I hope I have generated it right. I am not used to this.
Thank you. We will review the patch in the next week. Chris
This is working for me. Please have a look Nitin.
Patch checked in.