| 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.incremental_resolver; | 5 library engine.incremental_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/error_verifier.dart'; | 10 import 'package:analyzer/src/generated/error_verifier.dart'; |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 { | 841 { |
| 842 List<FunctionElement> holderFunctions = holder.functions; | 842 List<FunctionElement> holderFunctions = holder.functions; |
| 843 List<PropertyAccessorElement> holderAccessors = holder.accessors; | 843 List<PropertyAccessorElement> holderAccessors = holder.accessors; |
| 844 if (holderFunctions.isNotEmpty) { | 844 if (holderFunctions.isNotEmpty) { |
| 845 newElement = holderFunctions[0]; | 845 newElement = holderFunctions[0]; |
| 846 } else if (holderAccessors.isNotEmpty) { | 846 } else if (holderAccessors.isNotEmpty) { |
| 847 newElement = holderAccessors[0]; | 847 newElement = holderAccessors[0]; |
| 848 } | 848 } |
| 849 } | 849 } |
| 850 // update the old Element | 850 // update the old Element |
| 851 oldElement.functions = newElement.functions; |
| 851 oldElement.labels = newElement.labels; | 852 oldElement.labels = newElement.labels; |
| 852 oldElement.localVariables = newElement.localVariables; | 853 oldElement.localVariables = newElement.localVariables; |
| 853 } | 854 } |
| 854 if (node is MethodDeclaration) { | 855 if (node is MethodDeclaration) { |
| 855 ExecutableElementImpl oldElement = node.element; | 856 ExecutableElementImpl oldElement = node.element; |
| 856 // prepare the new element | 857 // prepare the new element |
| 857 ExecutableElement newElement; | 858 ExecutableElement newElement; |
| 858 { | 859 { |
| 859 List<MethodElement> holderMethods = holder.methods; | 860 List<MethodElement> holderMethods = holder.methods; |
| 860 List<PropertyAccessorElement> holderAccessors = holder.accessors; | 861 List<PropertyAccessorElement> holderAccessors = holder.accessors; |
| 861 if (holderMethods.isNotEmpty) { | 862 if (holderMethods.isNotEmpty) { |
| 862 newElement = holderMethods[0]; | 863 newElement = holderMethods[0]; |
| 863 } else if (holderAccessors.isNotEmpty) { | 864 } else if (holderAccessors.isNotEmpty) { |
| 864 newElement = holderAccessors[0]; | 865 newElement = holderAccessors[0]; |
| 865 } | 866 } |
| 866 } | 867 } |
| 867 // update the old Element | 868 // update the old Element |
| 869 oldElement.functions = newElement.functions; |
| 868 oldElement.labels = newElement.labels; | 870 oldElement.labels = newElement.labels; |
| 869 oldElement.localVariables = newElement.localVariables; | 871 oldElement.localVariables = newElement.localVariables; |
| 870 } | 872 } |
| 871 } | 873 } |
| 872 | 874 |
| 873 void _verify(AstNode node) { | 875 void _verify(AstNode node) { |
| 874 RecordingErrorListener errorListener = new RecordingErrorListener(); | 876 RecordingErrorListener errorListener = new RecordingErrorListener(); |
| 875 ErrorReporter errorReporter = new ErrorReporter(errorListener, _source); | 877 ErrorReporter errorReporter = new ErrorReporter(errorListener, _source); |
| 876 ErrorVerifier errorVerifier = new ErrorVerifier( | 878 ErrorVerifier errorVerifier = new ErrorVerifier( |
| 877 errorReporter, | 879 errorReporter, |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 } | 1546 } |
| 1545 } | 1547 } |
| 1546 | 1548 |
| 1547 | 1549 |
| 1548 class _TokenPair { | 1550 class _TokenPair { |
| 1549 final Token oldToken; | 1551 final Token oldToken; |
| 1550 final Token newToken; | 1552 final Token newToken; |
| 1551 final bool atComment; | 1553 final bool atComment; |
| 1552 _TokenPair(this.oldToken, this.newToken, [this.atComment = false]); | 1554 _TokenPair(this.oldToken, this.newToken, [this.atComment = false]); |
| 1553 } | 1555 } |
| OLD | NEW |