Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: tests/compiler/dart2js/mock_compiler.dart

Issue 1309743006: Move common URIs to common/names.dart (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 import 'package:compiler/compiler.dart' as api; 11 import 'package:compiler/compiler.dart' as api;
12 import 'package:compiler/src/common/names.dart' show
13 Uris;
12 import 'package:compiler/src/constants/expressions.dart'; 14 import 'package:compiler/src/constants/expressions.dart';
13 import 'package:compiler/src/diagnostics/messages.dart'; 15 import 'package:compiler/src/diagnostics/messages.dart';
14 import 'package:compiler/src/diagnostics/source_span.dart'; 16 import 'package:compiler/src/diagnostics/source_span.dart';
15 import 'package:compiler/src/diagnostics/spannable.dart'; 17 import 'package:compiler/src/diagnostics/spannable.dart';
16 import 'package:compiler/src/elements/elements.dart'; 18 import 'package:compiler/src/elements/elements.dart';
17 import 'package:compiler/src/js_backend/js_backend.dart' 19 import 'package:compiler/src/js_backend/js_backend.dart'
18 show JavaScriptBackend; 20 show JavaScriptBackend;
19 import 'package:compiler/src/io/source_file.dart'; 21 import 'package:compiler/src/io/source_file.dart';
20 import 'package:compiler/src/resolution/members.dart'; 22 import 'package:compiler/src/resolution/members.dart';
21 import 'package:compiler/src/resolution/registry.dart'; 23 import 'package:compiler/src/resolution/registry.dart';
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 preserveComments: preserveComments, 105 preserveComments: preserveComments,
104 trustTypeAnnotations: trustTypeAnnotations, 106 trustTypeAnnotations: trustTypeAnnotations,
105 showPackageWarnings: true, 107 showPackageWarnings: true,
106 outputProvider: new LegacyCompilerOutput(outputProvider)) { 108 outputProvider: new LegacyCompilerOutput(outputProvider)) {
107 this.disableInlining = disableInlining; 109 this.disableInlining = disableInlining;
108 110
109 deferredLoadTask = new MockDeferredLoadTask(this); 111 deferredLoadTask = new MockDeferredLoadTask(this);
110 112
111 clearMessages(); 113 clearMessages();
112 114
113 registerSource(Compiler.DART_CORE, 115 registerSource(Uris.dart_core,
114 buildLibrarySource(DEFAULT_CORE_LIBRARY, coreSource)); 116 buildLibrarySource(DEFAULT_CORE_LIBRARY, coreSource));
115 registerSource(PATCH_CORE, DEFAULT_PATCH_CORE_SOURCE); 117 registerSource(PATCH_CORE, DEFAULT_PATCH_CORE_SOURCE);
116 118
117 registerSource(JavaScriptBackend.DART_JS_HELPER, 119 registerSource(JavaScriptBackend.DART_JS_HELPER,
118 buildLibrarySource(DEFAULT_JS_HELPER_LIBRARY)); 120 buildLibrarySource(DEFAULT_JS_HELPER_LIBRARY));
119 registerSource(JavaScriptBackend.DART_FOREIGN_HELPER, 121 registerSource(JavaScriptBackend.DART_FOREIGN_HELPER,
120 buildLibrarySource(DEFAULT_FOREIGN_HELPER_LIBRARY)); 122 buildLibrarySource(DEFAULT_FOREIGN_HELPER_LIBRARY));
121 registerSource(JavaScriptBackend.DART_INTERCEPTORS, 123 registerSource(JavaScriptBackend.DART_INTERCEPTORS,
122 buildLibrarySource(DEFAULT_INTERCEPTORS_LIBRARY)); 124 buildLibrarySource(DEFAULT_INTERCEPTORS_LIBRARY));
123 registerSource(JavaScriptBackend.DART_ISOLATE_HELPER, 125 registerSource(JavaScriptBackend.DART_ISOLATE_HELPER,
124 buildLibrarySource(DEFAULT_ISOLATE_HELPER_LIBRARY)); 126 buildLibrarySource(DEFAULT_ISOLATE_HELPER_LIBRARY));
125 registerSource(Compiler.DART_MIRRORS, 127 registerSource(Uris.dart_mirrors,
126 buildLibrarySource(DEFAULT_MIRRORS_LIBRARY)); 128 buildLibrarySource(DEFAULT_MIRRORS_LIBRARY));
127 129
128 Map<String, String> asyncLibrarySource = <String, String>{}; 130 Map<String, String> asyncLibrarySource = <String, String>{};
129 asyncLibrarySource.addAll(DEFAULT_ASYNC_LIBRARY); 131 asyncLibrarySource.addAll(DEFAULT_ASYNC_LIBRARY);
130 if (enableAsyncAwait) { 132 if (enableAsyncAwait) {
131 asyncLibrarySource.addAll(ASYNC_AWAIT_LIBRARY); 133 asyncLibrarySource.addAll(ASYNC_AWAIT_LIBRARY);
132 } 134 }
133 registerSource(Compiler.DART_ASYNC, 135 registerSource(Uris.dart_async,
134 buildLibrarySource(asyncLibrarySource)); 136 buildLibrarySource(asyncLibrarySource));
135 } 137 }
136 138
137 String get patchVersion { 139 String get patchVersion {
138 return testedPatchVersion != null ? testedPatchVersion : super.patchVersion; 140 return testedPatchVersion != null ? testedPatchVersion : super.patchVersion;
139 } 141 }
140 142
141 /// Initialize the mock compiler with an empty main library. 143 /// Initialize the mock compiler with an empty main library.
142 Future<Uri> init([String mainSource = ""]) { 144 Future<Uri> init([String mainSource = ""]) {
143 Uri uri = new Uri(scheme: "mock"); 145 Uri uri = new Uri(scheme: "mock");
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 MockElement(Element enclosingElement) 426 MockElement(Element enclosingElement)
425 : super('', ElementKind.FUNCTION, Modifiers.EMPTY, 427 : super('', ElementKind.FUNCTION, Modifiers.EMPTY,
426 enclosingElement); 428 enclosingElement);
427 429
428 get node => null; 430 get node => null;
429 431
430 parseNode(_) => null; 432 parseNode(_) => null;
431 433
432 bool get hasNode => false; 434 bool get hasNode => false;
433 } 435 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698