| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.test_support; | 8 library engine.test_support; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/java_core.dart'; | 10 import 'package:analyzer/src/generated/java_core.dart'; |
| 11 import 'package:analyzer/src/generated/java_junit.dart'; | 11 import 'package:analyzer/src/generated/java_junit.dart'; |
| 12 import 'package:analyzer/src/generated/source.dart'; | 12 import 'package:analyzer/src/generated/source.dart'; |
| 13 import 'package:analyzer/src/generated/error.dart'; | 13 import 'package:analyzer/src/generated/error.dart'; |
| 14 import 'package:analyzer/src/generated/scanner.dart'; | 14 import 'package:analyzer/src/generated/scanner.dart'; |
| 15 import 'package:analyzer/src/generated/ast.dart' show ASTNode, NodeLocator; | 15 import 'package:analyzer/src/generated/ast.dart' show ASTNode, NodeLocator; |
| 16 import 'package:analyzer/src/generated/element.dart' show InterfaceType, MethodE
lement, PropertyAccessorElement; | 16 import 'package:analyzer/src/generated/element.dart' show InterfaceType, MethodE
lement, PropertyAccessorElement; |
| 17 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext, Analys
isContextImpl, RecordingErrorListener; | 17 import 'package:analyzer/src/generated/engine.dart'; |
| 18 import 'package:unittest/unittest.dart' as _ut; | 18 import 'package:unittest/unittest.dart' as _ut; |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * Instances of the class `GatheringErrorListener` implement an error listener t
hat collects | 21 * Instances of the class `GatheringErrorListener` implement an error listener t
hat collects |
| 22 * all of the errors passed to it for later examination. | 22 * all of the errors passed to it for later examination. |
| 23 */ | 23 */ |
| 24 class GatheringErrorListener implements AnalysisErrorListener { | 24 class GatheringErrorListener implements AnalysisErrorListener { |
| 25 /** | 25 /** |
| 26 * The source being parsed. | 26 * The source being parsed. |
| 27 */ | 27 */ |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } | 774 } |
| 775 } | 775 } |
| 776 if (diffPos == -1 && str1.length != str2.length) { | 776 if (diffPos == -1 && str1.length != str2.length) { |
| 777 diffPos = len1; | 777 diffPos = len1; |
| 778 } | 778 } |
| 779 return diffPos; | 779 return diffPos; |
| 780 } | 780 } |
| 781 | 781 |
| 782 AnalysisContextImpl createAnalysisContext() { | 782 AnalysisContextImpl createAnalysisContext() { |
| 783 AnalysisContextImpl context = new AnalysisContextImpl(); | 783 AnalysisContextImpl context = new AnalysisContextImpl(); |
| 784 context.sourceFactory = new SourceFactory.con2([]); | 784 context.sourceFactory = new SourceFactory([]); |
| 785 return context; | 785 return context; |
| 786 } | 786 } |
| 787 | 787 |
| 788 /** | 788 /** |
| 789 * Return the getter in the given type with the given name. Inherited getters
are ignored. | 789 * Return the getter in the given type with the given name. Inherited getters
are ignored. |
| 790 * | 790 * |
| 791 * @param type the type in which the getter is declared | 791 * @param type the type in which the getter is declared |
| 792 * @param getterName the name of the getter to be returned | 792 * @param getterName the name of the getter to be returned |
| 793 * @return the property accessor element representing the getter with the give
n name | 793 * @return the property accessor element representing the getter with the give
n name |
| 794 */ | 794 */ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 } | 829 } |
| 830 | 830 |
| 831 class TestSource implements Source { | 831 class TestSource implements Source { |
| 832 int get hashCode => 0; | 832 int get hashCode => 0; |
| 833 bool operator ==(Object object) { | 833 bool operator ==(Object object) { |
| 834 return object is TestSource; | 834 return object is TestSource; |
| 835 } | 835 } |
| 836 AnalysisContext get context { | 836 AnalysisContext get context { |
| 837 throw new UnsupportedOperationException(); | 837 throw new UnsupportedOperationException(); |
| 838 } | 838 } |
| 839 void getContents(Source_ContentReceiver receiver) { | 839 void getContentsToReceiver(Source_ContentReceiver receiver) { |
| 840 throw new UnsupportedOperationException(); | 840 throw new UnsupportedOperationException(); |
| 841 } | 841 } |
| 842 String get fullName { | 842 String get fullName { |
| 843 throw new UnsupportedOperationException(); | 843 throw new UnsupportedOperationException(); |
| 844 } | 844 } |
| 845 String get shortName { | 845 String get shortName { |
| 846 throw new UnsupportedOperationException(); | 846 throw new UnsupportedOperationException(); |
| 847 } | 847 } |
| 848 String get encoding { | 848 String get encoding { |
| 849 throw new UnsupportedOperationException(); | 849 throw new UnsupportedOperationException(); |
| 850 } | 850 } |
| 851 int get modificationStamp { | 851 int get modificationStamp { |
| 852 throw new UnsupportedOperationException(); | 852 throw new UnsupportedOperationException(); |
| 853 } | 853 } |
| 854 bool exists() => true; | 854 bool exists() => true; |
| 855 bool get isInSystemLibrary { | 855 bool get isInSystemLibrary { |
| 856 throw new UnsupportedOperationException(); | 856 throw new UnsupportedOperationException(); |
| 857 } | 857 } |
| 858 Source resolve(String uri) { | 858 Source resolve(String uri) { |
| 859 throw new UnsupportedOperationException(); | 859 throw new UnsupportedOperationException(); |
| 860 } | 860 } |
| 861 Source resolveRelative(Uri uri) { | 861 Source resolveRelative(Uri uri) { |
| 862 throw new UnsupportedOperationException(); | 862 throw new UnsupportedOperationException(); |
| 863 } | 863 } |
| 864 UriKind get uriKind { | 864 UriKind get uriKind { |
| 865 throw new UnsupportedOperationException(); | 865 throw new UnsupportedOperationException(); |
| 866 } | 866 } |
| 867 TimestampedData<String> get contents { |
| 868 throw new UnsupportedOperationException(); |
| 869 } |
| 867 } | 870 } |
| 868 | 871 |
| 869 /** | 872 /** |
| 870 * Wrapper around [Function] which should be called with "target" and "arguments
". | 873 * Wrapper around [Function] which should be called with "target" and "arguments
". |
| 871 */ | 874 */ |
| 872 class MethodTrampoline { | 875 class MethodTrampoline { |
| 873 int parameterCount; | 876 int parameterCount; |
| 874 Function trampoline; | 877 Function trampoline; |
| 875 MethodTrampoline(this.parameterCount, this.trampoline); | 878 MethodTrampoline(this.parameterCount, this.trampoline); |
| 876 Object invoke(target, List arguments) { | 879 Object invoke(target, List arguments) { |
| 877 if (arguments.length != parameterCount) { | 880 if (arguments.length != parameterCount) { |
| 878 throw new IllegalArgumentException("${arguments.length} != $parameterCount
"); | 881 throw new IllegalArgumentException("${arguments.length} != $parameterCount
"); |
| 879 } | 882 } |
| 880 switch (parameterCount) { | 883 switch (parameterCount) { |
| 881 case 0: | 884 case 0: |
| 882 return trampoline(target); | 885 return trampoline(target); |
| 883 case 1: | 886 case 1: |
| 884 return trampoline(target, arguments[0]); | 887 return trampoline(target, arguments[0]); |
| 885 case 2: | 888 case 2: |
| 886 return trampoline(target, arguments[0], arguments[1]); | 889 return trampoline(target, arguments[0], arguments[1]); |
| 887 case 3: | 890 case 3: |
| 888 return trampoline(target, arguments[0], arguments[1], arguments[2]); | 891 return trampoline(target, arguments[0], arguments[1], arguments[2]); |
| 889 case 4: | 892 case 4: |
| 890 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); | 893 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); |
| 891 default: | 894 default: |
| 892 throw new IllegalArgumentException("Not implemented for > 4 arguments"); | 895 throw new IllegalArgumentException("Not implemented for > 4 arguments"); |
| 893 } | 896 } |
| 894 } | 897 } |
| 895 } | 898 } |
| OLD | NEW |