| Summary: | [validation] Valid JavaScript code flagged as error (regexp, infinity, non-breaking space) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Mikael Hakman <mhakman> | ||||
| Component: | General | Assignee: | wst.javascript <wst.javascript-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Nitin Dahyabhai <thatnitind> | ||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | cmjaun, crimaniak, jacek.pospychala, mhakman, Olivier_Thomann, paul.beusterien, Viktor.Pracht | ||||
| Version: | 3.1.1 | ||||||
| Target Milestone: | Future | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
hi Mikael, thanks for the report. I'll reassign bug to JSDT because that's the project which does all the JavaScript files syntax parsing and analysis. Here is more then one error. First of all it's code from jquery so you can test it on any project with jquery. Case 2 - parser doesn't recognize ',' operator Case 3 - parser doesn't recognize RegExp constant syntax /.../ Case 1 - I don't think using typographics symbols in program code is good idea. Problems 2, 3, and 4 below have been fixed as of 3.2.4. I wasn't sure how to reproduce problem 1. If that is still an issue, please re-open with a specific code snippet to reproduce. I can't reopen the bug myself, but to reproduce issue 1, just replace a normal space by a non-breaking space. Here are some for copy-pasting: varĀ x; It's an issue because NBSP is explicitly defined in the ECMAScript spec as a valid whitespace character. Created attachment 227798 [details]
Snippet to reproduce issue 1
Since Bugzilla ate the NBSPs, here's an attachment, which hopefully preserves them.
|
Build Identifier: Eclipse 20090920-1017 ATF 0.3.0 1. Using Unicode A0 character (non-breaking space) in UTF-8 encoded JavaScript files gives "Invalid Character" error. Note this is not within string litterals but in plain code. 2. The following code gives "Syntax Error on token ',',.expected": while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { 3. The following code gives "String litteral is not properly closed by double quote": NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, 4. The following code gives "Syntax Error on token "infinity": var infinity = 1 / 0; Reproducible: Always Steps to Reproduce: 1. Download the qooxdoo SDK from http://qooxdoo.org/download (http://downloads.sourceforge.net/qooxdoo/qooxdoo-1.0-sdk.zip) 2. Unzip the file. 3. Create new JavaScript project in Eclipse. 4. Right-click on the project, set "Properties/Resource/Text file encoding" to UTF-8. 5. Import the whole Qooxdoo SDK into this project. 6. Rebuild.