summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvrubezhny2013-11-13 14:08:29 (EST)
committervrubezhny2013-12-19 16:25:45 (EST)
commit895f804aa0c4b8873aa485d02256321ba486d32f (patch)
tree41df50bc398a3d7b18a6d7c27ca7d8458b8cbc18
parent8569735fe21fd8df2b1ef6f7e70455c7511222ab (diff)
downloadwebtools.jsdt.core-895f804aa0c4b8873aa485d02256321ba486d32f.zip
webtools.jsdt.core-895f804aa0c4b8873aa485d02256321ba486d32f.tar.gz
webtools.jsdt.core-895f804aa0c4b8873aa485d02256321ba486d32f.tar.bz2
Bug 406519 - [validation] Valid JavaScript code flagged as error (regexp, infinity, non-breaking space)v201312192231
Issue is fixed by specifiyng the characters u000b (VERTICAL TAB) and u00a0 (NO-BREAK SPACE) as the Whitespace ones Signed-off-by: vrubezhny <vrubezhny@exadel.com>
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/AbstractCommentParser.java18
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/JavadocParser.java8
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java10
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/PublicScanner.java10
4 files changed, 30 insertions, 16 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/AbstractCommentParser.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/AbstractCommentParser.java
index ab4db6b..489680b 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/AbstractCommentParser.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/AbstractCommentParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -289,9 +289,11 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
this.inlineTagStart = previousPosition;
break;
case '*' :
- case '\u000c' : /* FORM FEED */
- case ' ' : /* SPACE */
- case '\t' : /* HORIZONTAL TABULATION */
+ case '\t' : /* HORIZONTAL TABULATION */
+ case '\u000b' : /* FORM FEED */
+ case '\u000c' : /* VERTICAL TAB */
+ case ' ' : /* SPACE */
+ case '\u00a0' : /* NO-BREAK SPACE */
// do nothing for space or '*' characters
break;
default :
@@ -1440,9 +1442,11 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
this.index = previousPosition;
return true;
- case '\u000c' : /* FORM FEED */
- case ' ' : /* SPACE */
- case '\t' : /* HORIZONTAL TABULATION */
+ case '\t' : /* HORIZONTAL TABULATION */
+ case '\u000b' : /* FORM FEED */
+ case '\u000c' : /* VERTICAL TAB */
+ case ' ' : /* SPACE */
+ case '\u00a0' : /* NO-BREAK SPACE */
if (this.starPosition >= 0) break nextChar;
break;
case '*':
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/JavadocParser.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/JavadocParser.java
index b328b4d..385777c 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/JavadocParser.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/JavadocParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -149,9 +149,11 @@ public class JavadocParser extends AbstractCommentParser {
char c = readChar(); // consider unicodes
switch (c) {
case '*' :
- case '\u000c' : /* FORM FEED */
- case ' ' : /* SPACE */
case '\t' : /* HORIZONTAL TABULATION */
+ case '\u000b' : /* FORM FEED */
+ case '\u000c' : /* VERTICAL TAB */
+ case ' ' : /* SPACE */
+ case '\u00a0' : /* NO-BREAK SPACE */
case '\n' : /* LINE FEED */
case '\r' : /* CR */
// do nothing for space or '*' characters
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java
index b841426..acec785 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -978,11 +978,13 @@ public int scanIdentifier() throws InvalidInputException {
//isWhiteSpace =
// (this.currentCharacter == ' ') || ScannerHelper.isWhitespace(this.currentCharacter);
switch (this.currentCharacter) {
+ case 9 : /* \ u0009: HORIZONTAL TABULATION */
case 10 : /* \ u000a: LINE FEED */
+ case 11 : /* \ u000b: VERTICAL TAB */
case 12 : /* \ u000c: FORM FEED */
case 13 : /* \ u000d: CARRIAGE RETURN */
case 32 : /* \ u0020: SPACE */
- case 9 : /* \ u0009: HORIZONTAL TABULATION */
+ case 160: /* \ u00a0: NO-BREAK SPACE */
isWhiteSpace = true;
break;
default :
@@ -1113,11 +1115,13 @@ public int getNextToken() throws InvalidInputException {
//isWhiteSpace =
// (this.currentCharacter == ' ') || ScannerHelper.isWhitespace(this.currentCharacter);
switch (this.currentCharacter) {
+ case 9 : /* \ u0009: HORIZONTAL TABULATION */
case 10 : /* \ u000a: LINE FEED */
+ case 11 : /* \ u000b: VERTICAL TAB */
case 12 : /* \ u000c: FORM FEED */
case 13 : /* \ u000d: CARRIAGE RETURN */
case 32 : /* \ u0020: SPACE */
- case 9 : /* \ u0009: HORIZONTAL TABULATION */
+ case 160: /* \ u00a0: NO-BREAK SPACE */
isWhiteSpace = true;
break;
default :
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/PublicScanner.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/PublicScanner.java
index 4dea3a3..067f33d 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/PublicScanner.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/PublicScanner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -971,11 +971,13 @@ public int scanIdentifier() throws InvalidInputException {
//isWhiteSpace =
// (this.currentCharacter == ' ') || ScannerHelper.isWhitespace(this.currentCharacter);
switch (this.currentCharacter) {
+ case 9 : /* \ u0009: HORIZONTAL TABULATION */
case 10 : /* \ u000a: LINE FEED */
+ case 11 : /* \ u000b: VERTICAL TAB */
case 12 : /* \ u000c: FORM FEED */
case 13 : /* \ u000d: CARRIAGE RETURN */
case 32 : /* \ u0020: SPACE */
- case 9 : /* \ u0009: HORIZONTAL TABULATION */
+ case 160: /* \ u00a0: NO-BREAK SPACE */
isWhiteSpace = true;
break;
default :
@@ -1088,11 +1090,13 @@ public int getNextToken() throws InvalidInputException {
//isWhiteSpace =
// (this.currentCharacter == ' ') || ScannerHelper.isWhitespace(this.currentCharacter);
switch (this.currentCharacter) {
+ case 9 : /* \ u0009: HORIZONTAL TABULATION */
case 10 : /* \ u000a: LINE FEED */
+ case 11 : /* \ u000b: VERTICAL TAB */
case 12 : /* \ u000c: FORM FEED */
case 13 : /* \ u000d: CARRIAGE RETURN */
case 32 : /* \ u0020: SPACE */
- case 9 : /* \ u0009: HORIZONTAL TABULATION */
+ case 160: /* \ u00a0: NO-BREAK SPACE */
isWhiteSpace = true;
break;
default :