OLD | NEW |
1 | 1 |
2 | 2 |
3 class TestSource implements Source { | 3 class TestSource implements Source { |
4 int get hashCode => 0; | 4 int get hashCode => 0; |
5 bool operator ==(Object object) { | 5 bool operator ==(Object object) { |
6 return object is TestSource; | 6 return object is TestSource; |
7 } | 7 } |
8 AnalysisContext get context { | 8 AnalysisContext get context { |
9 throw new UnsupportedOperationException(); | 9 throw new UnsupportedOperationException(); |
10 } | 10 } |
11 void getContents(Source_ContentReceiver receiver) { | 11 void getContentsToReceiver(Source_ContentReceiver receiver) { |
12 throw new UnsupportedOperationException(); | 12 throw new UnsupportedOperationException(); |
13 } | 13 } |
14 String get fullName { | 14 String get fullName { |
15 throw new UnsupportedOperationException(); | 15 throw new UnsupportedOperationException(); |
16 } | 16 } |
17 String get shortName { | 17 String get shortName { |
18 throw new UnsupportedOperationException(); | 18 throw new UnsupportedOperationException(); |
19 } | 19 } |
20 String get encoding { | 20 String get encoding { |
21 throw new UnsupportedOperationException(); | 21 throw new UnsupportedOperationException(); |
22 } | 22 } |
23 int get modificationStamp { | 23 int get modificationStamp { |
24 throw new UnsupportedOperationException(); | 24 throw new UnsupportedOperationException(); |
25 } | 25 } |
26 bool exists() => true; | 26 bool exists() => true; |
27 bool get isInSystemLibrary { | 27 bool get isInSystemLibrary { |
28 throw new UnsupportedOperationException(); | 28 throw new UnsupportedOperationException(); |
29 } | 29 } |
30 Source resolve(String uri) { | 30 Source resolve(String uri) { |
31 throw new UnsupportedOperationException(); | 31 throw new UnsupportedOperationException(); |
32 } | 32 } |
33 Source resolveRelative(Uri uri) { | 33 Source resolveRelative(Uri uri) { |
34 throw new UnsupportedOperationException(); | 34 throw new UnsupportedOperationException(); |
35 } | 35 } |
36 UriKind get uriKind { | 36 UriKind get uriKind { |
37 throw new UnsupportedOperationException(); | 37 throw new UnsupportedOperationException(); |
38 } | 38 } |
| 39 TimestampedData<String> get contents { |
| 40 throw new UnsupportedOperationException(); |
| 41 } |
39 } | 42 } |
40 | 43 |
41 /** | 44 /** |
42 * Wrapper around [Function] which should be called with "target" and "arguments
". | 45 * Wrapper around [Function] which should be called with "target" and "arguments
". |
43 */ | 46 */ |
44 class MethodTrampoline { | 47 class MethodTrampoline { |
45 int parameterCount; | 48 int parameterCount; |
46 Function trampoline; | 49 Function trampoline; |
47 MethodTrampoline(this.parameterCount, this.trampoline); | 50 MethodTrampoline(this.parameterCount, this.trampoline); |
48 Object invoke(target, List arguments) { | 51 Object invoke(target, List arguments) { |
49 if (arguments.length != parameterCount) { | 52 if (arguments.length != parameterCount) { |
50 throw new IllegalArgumentException("${arguments.length} != $parameterCount
"); | 53 throw new IllegalArgumentException("${arguments.length} != $parameterCount
"); |
51 } | 54 } |
52 switch (parameterCount) { | 55 switch (parameterCount) { |
53 case 0: | 56 case 0: |
54 return trampoline(target); | 57 return trampoline(target); |
55 case 1: | 58 case 1: |
56 return trampoline(target, arguments[0]); | 59 return trampoline(target, arguments[0]); |
57 case 2: | 60 case 2: |
58 return trampoline(target, arguments[0], arguments[1]); | 61 return trampoline(target, arguments[0], arguments[1]); |
59 case 3: | 62 case 3: |
60 return trampoline(target, arguments[0], arguments[1], arguments[2]); | 63 return trampoline(target, arguments[0], arguments[1], arguments[2]); |
61 case 4: | 64 case 4: |
62 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); | 65 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); |
63 default: | 66 default: |
64 throw new IllegalArgumentException("Not implemented for > 4 arguments"); | 67 throw new IllegalArgumentException("Not implemented for > 4 arguments"); |
65 } | 68 } |
66 } | 69 } |
67 } | 70 } |
OLD | NEW |