| Index: pkg/front_end/lib/src/fasta/compile_platform_dartk.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/compile_platform_dartk.dart b/pkg/front_end/lib/src/fasta/compile_platform_dartk.dart
|
| index 05b61a747482bae5c8a1b7d12e7e5a0f91e5ecf3..f494e05f60b696d049ddfb00e6e69115d219bbb2 100644
|
| --- a/pkg/front_end/lib/src/fasta/compile_platform_dartk.dart
|
| +++ b/pkg/front_end/lib/src/fasta/compile_platform_dartk.dart
|
| @@ -4,69 +4,54 @@
|
|
|
| library fasta.compile_platform;
|
|
|
| -import 'dart:async' show
|
| - Future;
|
| +import 'dart:async' show Future;
|
|
|
| -import 'dart:io' show
|
| - File,
|
| - IOSink;
|
| +import 'dart:io' show File, IOSink;
|
|
|
| -import 'package:analyzer/src/generated/source.dart' show
|
| - Source;
|
| +import 'package:analyzer/src/generated/source.dart' show Source;
|
|
|
| -import 'package:analyzer/dart/element/element.dart' show
|
| - ExportElement,
|
| - LibraryElement;
|
| +import 'package:analyzer/dart/element/element.dart'
|
| + show ExportElement, LibraryElement;
|
|
|
| -import 'package:kernel/ast.dart' show
|
| - Field,
|
| - Library,
|
| - Name,
|
| - Program,
|
| - StringLiteral;
|
| +import 'package:kernel/ast.dart'
|
| + show Field, Library, Name, Program, StringLiteral;
|
|
|
| -import 'package:kernel/binary/ast_to_binary.dart' show
|
| - BinaryPrinter;
|
| +import 'package:kernel/binary/ast_to_binary.dart' show BinaryPrinter;
|
|
|
| -import 'package:kernel/analyzer/loader.dart' show
|
| - DartLoader,
|
| - DartOptions,
|
| - createDartSdk;
|
| +import 'package:kernel/analyzer/loader.dart'
|
| + show DartLoader, DartOptions, createDartSdk;
|
|
|
| -import 'package:kernel/target/targets.dart' show
|
| - Target,
|
| - TargetFlags,
|
| - getTarget;
|
| +import 'package:kernel/target/targets.dart' show Target, TargetFlags, getTarget;
|
|
|
| -import 'package:kernel/ast.dart' show
|
| - Program;
|
| +import 'package:kernel/ast.dart' show Program;
|
|
|
| -import 'environment_variable.dart' show
|
| - EnvironmentVariableDirectory,
|
| - fileExists;
|
| +import 'environment_variable.dart'
|
| + show EnvironmentVariableDirectory, fileExists;
|
|
|
| -import 'errors.dart' show
|
| - inputError;
|
| +import 'errors.dart' show inputError;
|
|
|
| const EnvironmentVariableSdk dartAotSdk = const EnvironmentVariableSdk(
|
| "DART_AOT_SDK",
|
| "The environment variable 'DART_AOT_SDK' should point to a patched SDK.");
|
|
|
| class EnvironmentVariableSdk extends EnvironmentVariableDirectory {
|
| - const EnvironmentVariableSdk(String name, String what)
|
| - : super(name, what);
|
| + const EnvironmentVariableSdk(String name, String what) : super(name, what);
|
|
|
| Future<Null> validate(String value) async {
|
| Uri sdk = Uri.base.resolveUri(new Uri.directory(value));
|
| const String asyncDart = "lib/async/async.dart";
|
| if (!await fileExists(sdk, asyncDart)) {
|
| - inputError(null, null,
|
| + inputError(
|
| + null,
|
| + null,
|
| "The environment variable '$name' has the value '$value', "
|
| "that's a directory that doesn't contain '$asyncDart'. $what");
|
| }
|
| const String asyncSources = "lib/async/async_sources.gypi";
|
| if (await fileExists(sdk, asyncSources)) {
|
| - inputError(null, null,
|
| + inputError(
|
| + null,
|
| + null,
|
| "The environment variable '$name' has the value '$value', "
|
| "that's a directory that contains '$asyncSources', so it isn't a "
|
| "patched SDK. $what");
|
| @@ -83,18 +68,19 @@ main(List<String> arguments) async {
|
| DartLoader loader = new DartLoader(program, options, null,
|
| ignoreRedirectingFactories: false,
|
| dartSdk: createDartSdk(options.sdk, strongMode: options.strongMode));
|
| - Target target = getTarget(
|
| - "vm", new TargetFlags(strongMode: options.strongMode));
|
| - loader.loadProgram(
|
| - Uri.base.resolve("pkg/fasta/test/platform.dart"), target: target);
|
| + Target target =
|
| + getTarget("vm", new TargetFlags(strongMode: options.strongMode));
|
| + loader.loadProgram(Uri.base.resolve("pkg/fasta/test/platform.dart"),
|
| + target: target);
|
| if (loader.errors.isNotEmpty) {
|
| inputError(null, null, loader.errors.join("\n"));
|
| }
|
| Library mainLibrary = program.mainMethod.enclosingLibrary;
|
| program.uriToSource.remove(mainLibrary.fileUri);
|
| program = new Program(
|
| - program.libraries.where(
|
| - (Library l) => l.importUri.scheme == "dart").toList(),
|
| + program.libraries
|
| + .where((Library l) => l.importUri.scheme == "dart")
|
| + .toList(),
|
| program.uriToSource);
|
| target.performModularTransformations(program);
|
| target.performGlobalTransformations(program);
|
| @@ -118,11 +104,12 @@ main(List<String> arguments) async {
|
| sb.write(";");
|
| }
|
| Name exports = new Name("_exports#", library);
|
| - StringLiteral literal = new StringLiteral("$sb")
|
| - ..fileOffset = offset;
|
| - library.addMember(new Field(exports, isStatic: true, isConst: true,
|
| - initializer: literal, fileUri: "${new Uri.file(source.fullName)}")
|
| - ..fileOffset = offset);
|
| + StringLiteral literal = new StringLiteral("$sb")..fileOffset = offset;
|
| + library.addMember(new Field(exports,
|
| + isStatic: true,
|
| + isConst: true,
|
| + initializer: literal,
|
| + fileUri: "${new Uri.file(source.fullName)}")..fileOffset = offset);
|
| }
|
| }
|
|
|
|
|