| 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:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:uri'; | 8 import 'dart:uri'; |
| 9 | 9 |
| 10 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; | 10 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 void importCoreLibrary(LibraryElement library) { | 265 void importCoreLibrary(LibraryElement library) { |
| 266 scanner.importLibrary(library, coreLibrary, null); | 266 scanner.importLibrary(library, coreLibrary, null); |
| 267 } | 267 } |
| 268 | 268 |
| 269 Uri translateResolvedUri(LibraryElement importingLibrary, | 269 Uri translateResolvedUri(LibraryElement importingLibrary, |
| 270 Uri resolvedUri, Node node) => resolvedUri; | 270 Uri resolvedUri, Node node) => resolvedUri; |
| 271 | 271 |
| 272 // The mock library doesn't need any patches. | 272 // The mock library doesn't need any patches. |
| 273 Uri resolvePatchUri(String dartLibraryName) => null; | 273 Uri resolvePatchUri(String dartLibraryName) => null; |
| 274 | 274 |
| 275 Script readScript(Uri uri, [ScriptTag node]) { | 275 Script readScript(Uri uri, [Node node]) { |
| 276 SourceFile sourceFile = sourceFiles[uri.toString()]; | 276 SourceFile sourceFile = sourceFiles[uri.toString()]; |
| 277 if (sourceFile == null) throw new ArgumentError(uri); | 277 if (sourceFile == null) throw new ArgumentError(uri); |
| 278 return new Script(uri, sourceFile); | 278 return new Script(uri, sourceFile); |
| 279 } | 279 } |
| 280 | 280 |
| 281 Element lookupElementIn(ScopeContainerElement container, name) { | 281 Element lookupElementIn(ScopeContainerElement container, name) { |
| 282 Element element = container.localLookup(name); | 282 Element element = container.localLookup(name); |
| 283 return element != null | 283 return element != null |
| 284 ? element | 284 ? element |
| 285 : new ErroneousElementX(null, null, name, container); | 285 : new ErroneousElementX(null, null, name, container); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 operator []=(Node node, Element element) { | 333 operator []=(Node node, Element element) { |
| 334 map[node] = element; | 334 map[node] = element; |
| 335 } | 335 } |
| 336 | 336 |
| 337 operator [](Node node) => map[node]; | 337 operator [](Node node) => map[node]; |
| 338 | 338 |
| 339 void remove(Node node) { | 339 void remove(Node node) { |
| 340 map.remove(node); | 340 map.remove(node); |
| 341 } | 341 } |
| 342 } | 342 } |
| OLD | NEW |