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

Unified Diff: pkg/kernel/test/closures/kernel_chain.dart

Issue 2665723002: Implement canonical name scheme in kernel. (Closed)
Patch Set: Address Kevin's comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/kernel/test/baseline_tester.dart ('k') | pkg/kernel/test/closures/suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/test/closures/kernel_chain.dart
diff --git a/pkg/kernel/test/closures/kernel_chain.dart b/pkg/kernel/test/closures/kernel_chain.dart
index b3088cb04783615de86d203634440a8d53c57519..edb21eafa5e7fb794924b779ae8a3c9a2109b819 100644
--- a/pkg/kernel/test/closures/kernel_chain.dart
+++ b/pkg/kernel/test/closures/kernel_chain.dart
@@ -10,7 +10,7 @@ import 'dart:io' show Directory, File, IOSink;
import 'dart:typed_data' show Uint8List;
-import 'package:kernel/kernel.dart' show Repository, loadProgramFromBinary;
+import 'package:kernel/kernel.dart' show loadProgramFromBinary;
import 'package:kernel/text/ast_to_text.dart' show Printer;
@@ -25,8 +25,6 @@ import 'package:kernel/binary/ast_to_binary.dart' show BinaryPrinter;
import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder;
-import 'package:kernel/binary/loader.dart' show BinaryLoader;
-
Future<bool> fileExists(Uri base, String path) async {
return await new File.fromUri(base.resolve(path)).exists();
}
@@ -119,6 +117,7 @@ class WriteDill extends Step<Program, Uri, ChainContext> {
IOSink sink = generated.openWrite();
try {
new BinaryPrinter(sink).writeProgramFile(program);
+ program.unbindCanonicalNames();
} catch (e, s) {
return fail(uri, e, s);
} finally {
@@ -152,9 +151,12 @@ class Copy extends Step<Program, Program, ChainContext> {
Future<Result<Program>> run(Program program, _) async {
BytesCollector sink = new BytesCollector();
new BinaryPrinter(sink).writeProgramFile(program);
+ program.unbindCanonicalNames();
Uint8List bytes = sink.collect();
- BinaryLoader loader = new BinaryLoader(new Repository());
- return pass(new BinaryBuilder(loader, bytes).readProgramFile());
+ var newProgram = new Program();
+ new BinaryBuilder(bytes).readProgram(newProgram);
+ newProgram.unbindCanonicalNames();
+ return pass(newProgram);
}
}
« no previous file with comments | « pkg/kernel/test/baseline_tester.dart ('k') | pkg/kernel/test/closures/suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698