| 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 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 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 { | 39 TimestampedData<String> get contents { |
| 40 throw new UnsupportedOperationException(); | 40 throw new UnsupportedOperationException(); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | |
| 44 /** | |
| 45 * Wrapper around [Function] which should be called with "target" and "arguments
". | |
| 46 */ | |
| 47 class MethodTrampoline { | |
| 48 int parameterCount; | |
| 49 Function trampoline; | |
| 50 MethodTrampoline(this.parameterCount, this.trampoline); | |
| 51 Object invoke(target, List arguments) { | |
| 52 if (arguments.length != parameterCount) { | |
| 53 throw new IllegalArgumentException("${arguments.length} != $parameterCount
"); | |
| 54 } | |
| 55 switch (parameterCount) { | |
| 56 case 0: | |
| 57 return trampoline(target); | |
| 58 case 1: | |
| 59 return trampoline(target, arguments[0]); | |
| 60 case 2: | |
| 61 return trampoline(target, arguments[0], arguments[1]); | |
| 62 case 3: | |
| 63 return trampoline(target, arguments[0], arguments[1], arguments[2]); | |
| 64 case 4: | |
| 65 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); | |
| 66 default: | |
| 67 throw new IllegalArgumentException("Not implemented for > 4 arguments"); | |
| 68 } | |
| 69 } | |
| 70 } | |
| OLD | NEW |