| 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 "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 | 10 |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 // Do nothing. The mock core library is already handled in the constructor. | 437 // Do nothing. The mock core library is already handled in the constructor. |
| 438 return new Future.value(); | 438 return new Future.value(); |
| 439 } | 439 } |
| 440 | 440 |
| 441 Uri translateResolvedUri(LibraryElement importingLibrary, | 441 Uri translateResolvedUri(LibraryElement importingLibrary, |
| 442 Uri resolvedUri, Node node) => resolvedUri; | 442 Uri resolvedUri, Node node) => resolvedUri; |
| 443 | 443 |
| 444 // The mock library doesn't need any patches. | 444 // The mock library doesn't need any patches. |
| 445 Uri resolvePatchUri(String dartLibraryName) => null; | 445 Uri resolvePatchUri(String dartLibraryName) => null; |
| 446 | 446 |
| 447 Future<Script> readScript(Uri uri, [Element element, Node node]) { | 447 Future<Script> readScript(Spannable node, Uri uri) { |
| 448 SourceFile sourceFile = sourceFiles[uri.toString()]; | 448 SourceFile sourceFile = sourceFiles[uri.toString()]; |
| 449 if (sourceFile == null) throw new ArgumentError(uri); | 449 if (sourceFile == null) throw new ArgumentError(uri); |
| 450 return new Future.value(new Script(uri, uri, sourceFile)); | 450 return new Future.value(new Script(uri, uri, sourceFile)); |
| 451 } | 451 } |
| 452 | 452 |
| 453 Element lookupElementIn(ScopeContainerElement container, name) { | 453 Element lookupElementIn(ScopeContainerElement container, name) { |
| 454 Element element = container.localLookup(name); | 454 Element element = container.localLookup(name); |
| 455 return element != null | 455 return element != null |
| 456 ? element | 456 ? element |
| 457 : new ErroneousElementX(null, null, name, container); | 457 : new ErroneousElementX(null, null, name, container); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 } else { | 575 } else { |
| 576 sourceFile = compiler.sourceFiles[uri.toString()]; | 576 sourceFile = compiler.sourceFiles[uri.toString()]; |
| 577 } | 577 } |
| 578 if (sourceFile != null && begin != null && end != null) { | 578 if (sourceFile != null && begin != null && end != null) { |
| 579 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); | 579 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); |
| 580 } else { | 580 } else { |
| 581 print(message); | 581 print(message); |
| 582 } | 582 } |
| 583 }; | 583 }; |
| 584 } | 584 } |
| OLD | NEW |