| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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('mock_compiler'); | 5 #library('mock_compiler'); |
| 6 | 6 |
| 7 #import("../../../../lib/uri/uri.dart"); | 7 #import("../../../../lib/uri/uri.dart"); |
| 8 | 8 |
| 9 #import("../../../leg/elements/elements.dart"); | 9 #import("../../../leg/elements/elements.dart"); |
| 10 #import("../../../leg/io/io.dart", prefix: 'io'); | 10 #import("../../../leg/io/io.dart", prefix: 'io'); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 resolve(ClassElement element) { | 131 resolve(ClassElement element) { |
| 132 return resolver.resolveType(element); | 132 return resolver.resolveType(element); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void scanBuiltinLibraries() { | 135 void scanBuiltinLibraries() { |
| 136 // Do nothing. The mock core library is already handled in the constructor. | 136 // Do nothing. The mock core library is already handled in the constructor. |
| 137 } | 137 } |
| 138 | 138 |
| 139 LibraryElement scanBuiltinLibrary(String name) { |
| 140 // Do nothing. The mock core library is already handled in the constructor. |
| 141 } |
| 142 |
| 139 Script readScript(Uri uri, [ScriptTag node]) { | 143 Script readScript(Uri uri, [ScriptTag node]) { |
| 140 String code = sources[uri.toString()]; | 144 String code = sources[uri.toString()]; |
| 141 if (code === null) throw new IllegalArgumentException(uri); | 145 if (code === null) throw new IllegalArgumentException(uri); |
| 142 return new StringScript(code); | 146 return new StringScript(code); |
| 143 } | 147 } |
| 144 } | 148 } |
| 145 | 149 |
| 146 void compareWarningKinds(String text, expectedWarnings, foundWarnings) { | 150 void compareWarningKinds(String text, expectedWarnings, foundWarnings) { |
| 147 var fail = (message) => Expect.fail('$text: $message'); | 151 var fail = (message) => Expect.fail('$text: $message'); |
| 148 Iterator<MessageKind> expected = expectedWarnings.iterator(); | 152 Iterator<MessageKind> expected = expectedWarnings.iterator(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 importLibrary(library, compiler.coreLibrary, compiler); | 184 importLibrary(library, compiler.coreLibrary, compiler); |
| 181 return library; | 185 return library; |
| 182 } | 186 } |
| 183 | 187 |
| 184 class StringScript extends Script { | 188 class StringScript extends Script { |
| 185 final String code; | 189 final String code; |
| 186 StringScript(this.code) : super(null, null); | 190 StringScript(this.code) : super(null, null); |
| 187 String get text() => code; | 191 String get text() => code; |
| 188 String get name() => "mock script"; | 192 String get name() => "mock script"; |
| 189 } | 193 } |
| OLD | NEW |