| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 parseScript(String text, [LibraryElement library]) { | 130 parseScript(String text, [LibraryElement library]) { |
| 131 if (library === null) library = mainApp; | 131 if (library === null) library = mainApp; |
| 132 parseUnit(text, this, library); | 132 parseUnit(text, this, library); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void enqueue(WorkItem work) { | 135 void enqueue(WorkItem work) { |
| 136 super.enqueue(work); | 136 super.enqueue(work); |
| 137 } | 137 } |
| 138 | 138 |
| 139 resolve(ClassElement element) { | |
| 140 return resolver.resolveType(element); | |
| 141 } | |
| 142 | |
| 143 void scanBuiltinLibraries() { | 139 void scanBuiltinLibraries() { |
| 144 // Do nothing. The mock core library is already handled in the constructor. | 140 // Do nothing. The mock core library is already handled in the constructor. |
| 145 } | 141 } |
| 146 | 142 |
| 147 LibraryElement scanBuiltinLibrary(String name) { | 143 LibraryElement scanBuiltinLibrary(String name) { |
| 148 // Do nothing. The mock core library is already handled in the constructor. | 144 // Do nothing. The mock core library is already handled in the constructor. |
| 149 } | 145 } |
| 150 | 146 |
| 151 Script readScript(Uri uri, [ScriptTag node]) { | 147 Script readScript(Uri uri, [ScriptTag node]) { |
| 152 String code = sources[uri.toString()]; | 148 String code = sources[uri.toString()]; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 importLibrary(library, compiler.coreLibrary, compiler); | 188 importLibrary(library, compiler.coreLibrary, compiler); |
| 193 return library; | 189 return library; |
| 194 } | 190 } |
| 195 | 191 |
| 196 class StringScript extends Script { | 192 class StringScript extends Script { |
| 197 final String code; | 193 final String code; |
| 198 StringScript(this.code) : super(null, null); | 194 StringScript(this.code) : super(null, null); |
| 199 String get text() => code; | 195 String get text() => code; |
| 200 String get name() => "mock script"; | 196 String get name() => "mock script"; |
| 201 } | 197 } |
| OLD | NEW |