summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvrubezhny2013-11-27 07:50:59 (EST)
committervrubezhny2013-11-27 07:50:59 (EST)
commitfe0bf12d61302a2aee8c15dc60c68ff635a2a34d (patch)
tree42268bd8e91c7138801c81f4ad974e69e17dc667
parentc8c8d3c5ef286399cb2370d9ff2cad8da75d7329 (diff)
downloadwebtools.jsdt.core-fe0bf12d61302a2aee8c15dc60c68ff635a2a34d.zip
webtools.jsdt.core-fe0bf12d61302a2aee8c15dc60c68ff635a2a34d.tar.gz
webtools.jsdt.core-fe0bf12d61302a2aee8c15dc60c68ff635a2a34d.tar.bz2
Bug 422390 - [syntax coloring][regression] "Function declarations" setting broke anonymous function body coloringrefs/changes/62/18962/1
org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(AbstractMethodDeclaration) is made not to use org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.getName() method to get the function name, because the methor may return inferred method name instead of null in case of function expressions. org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.selector modifier is returned to 'public' due to allow it's usage in ASTConverter.convert() Signed-off-by: vrubezhny <vrubezhny@exadel.com>
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java6
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java
index f9d250c..e03f6b8 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java
@@ -348,11 +348,11 @@ class ASTConverter {
int start = methodDeclaration.sourceStart;
int end;
SimpleName methodName =null;
- char[] name = methodDeclaration.getName();
- if (name!=null)
+ if (methodDeclaration.selector != null) // We couldn't use inferred method name here, so
+ // do not use methodDeclaration.getName() here!
{
methodName = new SimpleName(this.ast);
- methodName.internalSetIdentifier(new String(name));
+ methodName.internalSetIdentifier(new String(methodDeclaration.selector));
end = retrieveIdentifierEndPosition(start, methodDeclaration.sourceEnd);
methodName.setSourceRange(start, end == -1 ? 0 : end - start + 1);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java
index 3070898..f736075 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 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
@@ -62,7 +62,7 @@ public abstract class AbstractMethodDeclaration extends Statement
/**
* <p>The function selector</p>
*/
- protected char[] selector;
+ public char[] selector;
/**
* <p><code>true</code> if this function is defined as an anonymous function,