From d649f8da838efdf41e604ff7da0cba6cbdaa5199 Mon Sep 17 00:00:00 2001 From: Hyukmin Kwon Date: Thu, 16 Aug 2012 13:07:16 +0900 Subject: [PATCH] [Title] Fixed resolving typeof expression bug. [Type] [Module] MarkOccurrence [Priority] [Jira#] [Redmine#] #5419 [Problem] [Cause] [Solution] [TestCase] --- .../eclipse/wst/jsdt/internal/compiler/ast/UnaryExpression.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/UnaryExpression.java b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/UnaryExpression.java index 8c780e2..2b55dc4 100644 --- a/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/UnaryExpression.java +++ b/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/UnaryExpression.java @@ -59,11 +59,10 @@ public class UnaryExpression extends OperatorExpression implements IUnaryExpress } public TypeBinding resolveType(BlockScope scope) { - TypeBinding expressionType = null; - if (getOperator()==TYPEOF && (this.expression instanceof SingleNameReference)) + TypeBinding expressionType = this.expression.resolveType(scope); + if (getOperator()==TYPEOF && (this.expression instanceof SingleNameReference) && expressionType == null) expressionType=TypeBinding.UNKNOWN; - else - expressionType = this.expression.resolveType(scope); + if (expressionType == null) { this.constant = Constant.NotAConstant; return null; -- 2.7.4