| 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("dart:uri"); | 7 #import("dart:uri"); |
| 8 | 8 |
| 9 #import("../../../lib/compiler/implementation/elements/elements.dart"); | 9 #import("../../../lib/compiler/implementation/elements/elements.dart"); |
| 10 #import("../../../lib/compiler/implementation/leg.dart"); | 10 #import("../../../lib/compiler/implementation/leg.dart"); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 | 150 |
| 151 void scanBuiltinLibraries() { | 151 void scanBuiltinLibraries() { |
| 152 // Do nothing. The mock core library is already handled in the constructor. | 152 // Do nothing. The mock core library is already handled in the constructor. |
| 153 } | 153 } |
| 154 | 154 |
| 155 LibraryElement scanBuiltinLibrary(String name) { | 155 LibraryElement scanBuiltinLibrary(String name) { |
| 156 // Do nothing. The mock core library is already handled in the constructor. | 156 // Do nothing. The mock core library is already handled in the constructor. |
| 157 } | 157 } |
| 158 | 158 |
| 159 // The mock library doesn't need any patches. | |
| 160 Uri resolvePatchUri(String dartLibraryName) => null; | |
| 161 | |
| 162 Script readScript(Uri uri, [ScriptTag node]) { | 159 Script readScript(Uri uri, [ScriptTag node]) { |
| 163 String code = sources[uri.toString()]; | 160 String code = sources[uri.toString()]; |
| 164 if (code === null) throw new IllegalArgumentException(uri); | 161 if (code === null) throw new IllegalArgumentException(uri); |
| 165 return new StringScript(code); | 162 return new StringScript(code); |
| 166 } | 163 } |
| 167 } | 164 } |
| 168 | 165 |
| 169 void compareWarningKinds(String text, expectedWarnings, foundWarnings) { | 166 void compareWarningKinds(String text, expectedWarnings, foundWarnings) { |
| 170 var fail = (message) => Expect.fail('$text: $message'); | 167 var fail = (message) => Expect.fail('$text: $message'); |
| 171 Iterator<MessageKind> expected = expectedWarnings.iterator(); | 168 Iterator<MessageKind> expected = expectedWarnings.iterator(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 importLibrary(library, compiler.coreLibrary, compiler); | 200 importLibrary(library, compiler.coreLibrary, compiler); |
| 204 return library; | 201 return library; |
| 205 } | 202 } |
| 206 | 203 |
| 207 class StringScript extends Script { | 204 class StringScript extends Script { |
| 208 final String code; | 205 final String code; |
| 209 StringScript(this.code) : super(null, null); | 206 StringScript(this.code) : super(null, null); |
| 210 String get text() => code; | 207 String get text() => code; |
| 211 String get name() => "mock script"; | 208 String get name() => "mock script"; |
| 212 } | 209 } |
| OLD | NEW |