| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library engine.resolver; | 5 library engine.resolver; |
| 6 | 6 |
| 7 import "dart:math" as math; | 7 import "dart:math" as math; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/utilities_collection.dart'; | 10 import 'package:analyzer/src/generated/utilities_collection.dart'; |
| (...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2663 } | 2663 } |
| 2664 | 2664 |
| 2665 @override | 2665 @override |
| 2666 Object visitFunctionDeclaration(FunctionDeclaration node) { | 2666 Object visitFunctionDeclaration(FunctionDeclaration node) { |
| 2667 FunctionExpression expression = node.functionExpression; | 2667 FunctionExpression expression = node.functionExpression; |
| 2668 if (expression != null) { | 2668 if (expression != null) { |
| 2669 ElementHolder holder = new ElementHolder(); | 2669 ElementHolder holder = new ElementHolder(); |
| 2670 bool wasInFunction = _inFunction; | 2670 bool wasInFunction = _inFunction; |
| 2671 _inFunction = true; | 2671 _inFunction = true; |
| 2672 try { | 2672 try { |
| 2673 _visitChildren(holder, expression); | 2673 _visitChildren(holder, node); |
| 2674 } finally { | 2674 } finally { |
| 2675 _inFunction = wasInFunction; | 2675 _inFunction = wasInFunction; |
| 2676 } | 2676 } |
| 2677 FunctionBody body = expression.body; | 2677 FunctionBody body = expression.body; |
| 2678 sc.Token property = node.propertyKeyword; | 2678 sc.Token property = node.propertyKeyword; |
| 2679 if (property == null || _inFunction) { | 2679 if (property == null || _inFunction) { |
| 2680 SimpleIdentifier functionName = node.name; | 2680 SimpleIdentifier functionName = node.name; |
| 2681 FunctionElementImpl element = | 2681 FunctionElementImpl element = |
| 2682 new FunctionElementImpl.forNode(functionName); | 2682 new FunctionElementImpl.forNode(functionName); |
| 2683 element.functions = holder.functions; | 2683 element.functions = holder.functions; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2758 propertyNameNode.staticElement = setter; | 2758 propertyNameNode.staticElement = setter; |
| 2759 } | 2759 } |
| 2760 } | 2760 } |
| 2761 holder.validate(); | 2761 holder.validate(); |
| 2762 } | 2762 } |
| 2763 return null; | 2763 return null; |
| 2764 } | 2764 } |
| 2765 | 2765 |
| 2766 @override | 2766 @override |
| 2767 Object visitFunctionExpression(FunctionExpression node) { | 2767 Object visitFunctionExpression(FunctionExpression node) { |
| 2768 if (node.parent is FunctionDeclaration) { |
| 2769 // visitFunctionDeclaration has already created the element for the |
| 2770 // declaration. We just need to visit children. |
| 2771 return super.visitFunctionExpression(node); |
| 2772 } |
| 2768 ElementHolder holder = new ElementHolder(); | 2773 ElementHolder holder = new ElementHolder(); |
| 2769 bool wasInFunction = _inFunction; | 2774 bool wasInFunction = _inFunction; |
| 2770 _inFunction = true; | 2775 _inFunction = true; |
| 2771 try { | 2776 try { |
| 2772 _visitChildren(holder, node); | 2777 _visitChildren(holder, node); |
| 2773 } finally { | 2778 } finally { |
| 2774 _inFunction = wasInFunction; | 2779 _inFunction = wasInFunction; |
| 2775 } | 2780 } |
| 2776 FunctionBody body = node.body; | 2781 FunctionBody body = node.body; |
| 2777 FunctionElementImpl element = | 2782 FunctionElementImpl element = |
| (...skipping 12633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15411 nonFields.add(node); | 15416 nonFields.add(node); |
| 15412 return null; | 15417 return null; |
| 15413 } | 15418 } |
| 15414 | 15419 |
| 15415 @override | 15420 @override |
| 15416 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); | 15421 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); |
| 15417 | 15422 |
| 15418 @override | 15423 @override |
| 15419 Object visitWithClause(WithClause node) => null; | 15424 Object visitWithClause(WithClause node) => null; |
| 15420 } | 15425 } |
| OLD | NEW |