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

Side by Side Diff: pkg/front_end/lib/src/fasta/compile_platform.dart

Issue 2675683002: Update fasta tests to use the new transformation API (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | pkg/front_end/lib/src/fasta/testing/kernel_chain.dart » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 fasta.compile_platform; 5 library fasta.compile_platform;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:io' show 10 import 'dart:io' show
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 Uri.base.resolve("pkg/fasta/test/platform.dart"), target: target); 95 Uri.base.resolve("pkg/fasta/test/platform.dart"), target: target);
96 if (loader.errors.isNotEmpty) { 96 if (loader.errors.isNotEmpty) {
97 inputError(null, null, loader.errors.join("\n")); 97 inputError(null, null, loader.errors.join("\n"));
98 } 98 }
99 Library mainLibrary = program.mainMethod.enclosingLibrary; 99 Library mainLibrary = program.mainMethod.enclosingLibrary;
100 program.uriToSource.remove(mainLibrary.fileUri); 100 program.uriToSource.remove(mainLibrary.fileUri);
101 program = new Program( 101 program = new Program(
102 program.libraries.where( 102 program.libraries.where(
103 (Library l) => l.importUri.scheme == "dart").toList(), 103 (Library l) => l.importUri.scheme == "dart").toList(),
104 program.uriToSource); 104 program.uriToSource);
105 target.transformProgram(program); 105 target.performModularTransformations(program);
106 target.performGlobalTransformations(program);
106 for (LibraryElement analyzerLibrary in loader.libraryElements) { 107 for (LibraryElement analyzerLibrary in loader.libraryElements) {
107 Library library = loader.getLibraryReference(analyzerLibrary); 108 Library library = loader.getLibraryReference(analyzerLibrary);
108 StringBuffer sb = new StringBuffer(); 109 StringBuffer sb = new StringBuffer();
109 if (analyzerLibrary.exports.isNotEmpty) { 110 if (analyzerLibrary.exports.isNotEmpty) {
110 Source source; 111 Source source;
111 int offset; 112 int offset;
112 for (ExportElement export in analyzerLibrary.exports) { 113 for (ExportElement export in analyzerLibrary.exports) {
113 source ??= export.source; 114 source ??= export.source;
114 offset ??= export.nameOffset; 115 offset ??= export.nameOffset;
115 Uri uri = export.exportedLibrary.source.uri; 116 Uri uri = export.exportedLibrary.source.uri;
(...skipping 12 matching lines...) Expand all
128 library.addMember(new Field(exports, isStatic: true, isConst: true, 129 library.addMember(new Field(exports, isStatic: true, isConst: true,
129 initializer: literal, fileUri: "${new Uri.file(source.fullName)}") 130 initializer: literal, fileUri: "${new Uri.file(source.fullName)}")
130 ..fileOffset = offset); 131 ..fileOffset = offset);
131 } 132 }
132 } 133 }
133 134
134 IOSink sink = new File.fromUri(output).openWrite(); 135 IOSink sink = new File.fromUri(output).openWrite();
135 new BinaryPrinter(sink).writeProgramFile(program); 136 new BinaryPrinter(sink).writeProgramFile(program);
136 await sink.close(); 137 await sink.close();
137 } 138 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/testing/kernel_chain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698