| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 registerSource(Compiler.DART_MIRRORS, | 121 registerSource(Compiler.DART_MIRRORS, |
| 122 buildLibrarySource(DEFAULT_MIRRORS_LIBRARY)); | 122 buildLibrarySource(DEFAULT_MIRRORS_LIBRARY)); |
| 123 | 123 |
| 124 Map<String, String> asyncLibrarySource = <String, String>{}; | 124 Map<String, String> asyncLibrarySource = <String, String>{}; |
| 125 asyncLibrarySource.addAll(DEFAULT_ASYNC_LIBRARY); | 125 asyncLibrarySource.addAll(DEFAULT_ASYNC_LIBRARY); |
| 126 if (enableAsyncAwait) { | 126 if (enableAsyncAwait) { |
| 127 asyncLibrarySource.addAll(ASYNC_AWAIT_LIBRARY); | 127 asyncLibrarySource.addAll(ASYNC_AWAIT_LIBRARY); |
| 128 } | 128 } |
| 129 registerSource(Compiler.DART_ASYNC, | 129 registerSource(Compiler.DART_ASYNC, |
| 130 buildLibrarySource(asyncLibrarySource)); | 130 buildLibrarySource(asyncLibrarySource)); |
| 131 registerSource(JavaScriptBackend.PACKAGE_LOOKUP_MAP, |
| 132 buildLibrarySource(DEFAULT_LOOKUP_MAP_LIBRARY)); |
| 131 } | 133 } |
| 132 | 134 |
| 133 String get patchVersion { | 135 String get patchVersion { |
| 134 return testedPatchVersion != null ? testedPatchVersion : super.patchVersion; | 136 return testedPatchVersion != null ? testedPatchVersion : super.patchVersion; |
| 135 } | 137 } |
| 136 | 138 |
| 137 /// Initialize the mock compiler with an empty main library. | 139 /// Initialize the mock compiler with an empty main library. |
| 138 Future<Uri> init([String mainSource = ""]) { | 140 Future<Uri> init([String mainSource = ""]) { |
| 139 Uri uri = new Uri(scheme: "mock"); | 141 Uri uri = new Uri(scheme: "mock"); |
| 140 registerSource(uri, mainSource); | 142 registerSource(uri, mainSource); |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 MockElement(Element enclosingElement) | 415 MockElement(Element enclosingElement) |
| 414 : super('', ElementKind.FUNCTION, Modifiers.EMPTY, | 416 : super('', ElementKind.FUNCTION, Modifiers.EMPTY, |
| 415 enclosingElement); | 417 enclosingElement); |
| 416 | 418 |
| 417 get node => null; | 419 get node => null; |
| 418 | 420 |
| 419 parseNode(_) => null; | 421 parseNode(_) => null; |
| 420 | 422 |
| 421 bool get hasNode => false; | 423 bool get hasNode => false; |
| 422 } | 424 } |
| OLD | NEW |