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

Unified Diff: pkg/compiler/lib/src/apiimpl.dart

Issue 1284673003: Move dart2jslib parts into separate libraries. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix try. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/closure.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/apiimpl.dart
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 123938dbe1a418ee036a1d0a44637ab6501f77c8..25cc70fed64702d3c62a7841cce8b53aaaffbac2 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -7,18 +7,24 @@ library leg_apiimpl;
import 'dart:async';
import 'dart:convert';
-import '../compiler_new.dart' as api;
-import 'dart2jslib.dart' as leg;
-import 'tree/tree.dart' as tree;
-import 'elements/elements.dart' as elements;
-import 'package:sdk_library_metadata/libraries.dart' hide LIBRARIES;
-import 'package:sdk_library_metadata/libraries.dart' as library_info show LIBRARIES;
-import 'io/source_file.dart';
import 'package:package_config/packages.dart';
import 'package:package_config/packages_file.dart' as pkgs;
import 'package:package_config/src/packages_impl.dart'
show NonFilePackagesDirectoryPackages, MapPackages;
import 'package:package_config/src/util.dart' show checkValidPackageUri;
+import 'package:sdk_library_metadata/libraries.dart' hide LIBRARIES;
+import 'package:sdk_library_metadata/libraries.dart' as library_info show LIBRARIES;
+
+import '../compiler_new.dart' as api;
+import 'dart2jslib.dart' as leg;
+import 'elements/elements.dart' as elements;
+import 'io/source_file.dart';
+import 'messages.dart';
+import 'script.dart';
+import 'tree/tree.dart' as tree;
+import 'util/util.dart' show
+ NO_LOCATION_SPANNABLE,
+ Spannable;
const bool forceIncrementalSupport =
const bool.fromEnvironment('DART2JS_EXPERIMENTAL_INCREMENTAL_SUPPORT');
@@ -213,9 +219,9 @@ class Compiler extends leg.Compiler {
/**
* Reads the script designated by [readableUri].
*/
- Future<leg.Script> readScript(leg.Spannable node, Uri readableUri) {
+ Future<Script> readScript(Spannable node, Uri readableUri) {
if (!readableUri.isAbsolute) {
- if (node == null) node = leg.NO_LOCATION_SPANNABLE;
+ if (node == null) node = NO_LOCATION_SPANNABLE;
internalError(node,
'Relative uri $readableUri provided to readScript(Uri).');
}
@@ -228,13 +234,13 @@ class Compiler extends leg.Compiler {
if (element == null || node == null) {
reportError(
new leg.SourceSpan(readableUri, 0, 0),
- leg.MessageKind.READ_SELF_ERROR,
+ MessageKind.READ_SELF_ERROR,
{'uri': readableUri, 'exception': exception});
} else {
withCurrentElement(element, () {
reportError(
node,
- leg.MessageKind.READ_SCRIPT_ERROR,
+ MessageKind.READ_SCRIPT_ERROR,
{'uri': readableUri, 'exception': exception});
});
}
@@ -245,7 +251,7 @@ class Compiler extends leg.Compiler {
if (resourceUri.scheme == 'dart-ext') {
if (!allowNativeExtensions) {
withCurrentElement(element, () {
- reportError(node, leg.MessageKind.DART_EXT_NOT_SUPPORTED);
+ reportError(node, MessageKind.DART_EXT_NOT_SUPPORTED);
});
}
return synthesizeScript(node, readableUri);
@@ -269,16 +275,16 @@ class Compiler extends leg.Compiler {
// the scheme in the script because [Script.uri] is used for resolving
// relative URIs mentioned in the script. See the comment on
// [LibraryLoader] for more details.
- return new leg.Script(readableUri, resourceUri, sourceFile);
+ return new Script(readableUri, resourceUri, sourceFile);
}).catchError((error) {
reportReadError(error);
return synthesizeScript(node, readableUri);
});
}
- Future<leg.Script> synthesizeScript(leg.Spannable node, Uri readableUri) {
+ Future<Script> synthesizeScript(Spannable node, Uri readableUri) {
return new Future.value(
- new leg.Script(
+ new Script(
readableUri, readableUri,
new StringSourceFile.fromUri(
readableUri,
@@ -291,7 +297,7 @@ class Compiler extends leg.Compiler {
*
* See [LibraryLoader] for terminology on URIs.
*/
- Uri translateUri(leg.Spannable node, Uri readableUri) {
+ Uri translateUri(Spannable node, Uri readableUri) {
switch (readableUri.scheme) {
case 'package': return translatePackageUri(node, readableUri);
default: return readableUri;
@@ -317,19 +323,19 @@ class Compiler extends leg.Compiler {
if (importingLibrary != null) {
reportError(
node,
- leg.MessageKind.INTERNAL_LIBRARY_FROM,
+ MessageKind.INTERNAL_LIBRARY_FROM,
{'resolvedUri': resolvedUri,
'importingUri': importingLibrary.canonicalUri});
} else {
reportError(
node,
- leg.MessageKind.INTERNAL_LIBRARY,
+ MessageKind.INTERNAL_LIBRARY,
{'resolvedUri': resolvedUri});
}
}
}
if (path == null) {
- reportError(node, leg.MessageKind.LIBRARY_NOT_FOUND,
+ reportError(node, MessageKind.LIBRARY_NOT_FOUND,
{'resolvedUri': resolvedUri});
return null;
}
@@ -348,13 +354,13 @@ class Compiler extends leg.Compiler {
return libraryRoot.resolve(patchPath);
}
- Uri translatePackageUri(leg.Spannable node, Uri uri) {
+ Uri translatePackageUri(Spannable node, Uri uri) {
try {
checkValidPackageUri(uri);
} on ArgumentError catch (e) {
reportError(
node,
- leg.MessageKind.INVALID_PACKAGE_URI,
+ MessageKind.INVALID_PACKAGE_URI,
{'uri': uri, 'exception': e.message});
return null;
}
@@ -362,7 +368,7 @@ class Compiler extends leg.Compiler {
notFound: (Uri notFound) {
reportError(
node,
- leg.MessageKind.LIBRARY_NOT_FOUND,
+ MessageKind.LIBRARY_NOT_FOUND,
{'resolvedUri': uri}
);
return null;
@@ -417,8 +423,8 @@ class Compiler extends leg.Compiler {
});
}
- void reportDiagnostic(leg.Spannable node,
- leg.Message message,
+ void reportDiagnostic(Spannable node,
+ Message message,
api.Diagnostic kind) {
leg.SourceSpan span = spanFromSpannable(node);
if (identical(kind, api.Diagnostic.ERROR)
@@ -441,7 +447,7 @@ class Compiler extends leg.Compiler {
&& (options.indexOf('--allow-mock-compilation') != -1);
}
- void callUserHandler(leg.Message message, Uri uri, int begin, int end,
+ void callUserHandler(Message message, Uri uri, int begin, int end,
String text, api.Diagnostic kind) {
try {
userHandlerTask.measure(() {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/closure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698