diff options
Diffstat (limited to 'bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FunctionExpression.java')
-rw-r--r-- | bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FunctionExpression.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FunctionExpression.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FunctionExpression.java index 66ddc9bc..3c2e6a81 100644 --- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FunctionExpression.java +++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/FunctionExpression.java @@ -51,12 +51,20 @@ public class FunctionExpression extends Expression implements IFunctionExpressio public TypeBinding resolveType(BlockScope scope) { constant = Constant.NotAConstant; - this.methodDeclaration.scope=new MethodScope(scope,this.methodDeclaration,false); - this.methodDeclaration.binding=this.methodDeclaration.scope.createMethod(this.methodDeclaration, null, scope.enclosingCompilationUnit(), false, false); - methodDeclaration.bindArguments(); - this.methodDeclaration.binding.createFunctionTypeBinding(scope); + this.methodDeclaration.setScope(new MethodScope(scope,this.methodDeclaration,false)); + + if(!this.methodDeclaration.hasBinding()) { + this.methodDeclaration.setBinding(this.methodDeclaration.getScope().createMethod(this.methodDeclaration, this.methodDeclaration.selector, scope.enclosingCompilationUnit(), false, false)); + } + + //add binding to scope only if named + if(this.methodDeclaration.getName() != null) { + scope.addLocalMethod(this.methodDeclaration.getBinding()); + } + + this.methodDeclaration.getBinding().createFunctionTypeBinding(scope); this.methodDeclaration.resolve(scope); - return this.methodDeclaration.binding.functionTypeBinding; + return this.methodDeclaration.getBinding().functionTypeBinding; } public TypeBinding resolveForAllocation(BlockScope scope, ASTNode location) { |