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

Unified Diff: pkg/kernel/lib/ast.dart

Issue 2874723002: Add a way to use shared CanonicalName root to deserialize Program. (Closed)
Patch Set: Add TODO for 'uriToSource'. Created 3 years, 7 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
Index: pkg/kernel/lib/ast.dart
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
index da42f5ebbffc092d69fd49aa9dc5bae9d12da5fe..59fc9ed2f2fff1a647f75806082584d2436d19fa 100644
--- a/pkg/kernel/lib/ast.dart
+++ b/pkg/kernel/lib/ast.dart
@@ -4237,7 +4237,7 @@ class Supertype extends Node {
/// A way to bundle up all the libraries in a program.
class Program extends TreeNode {
- final CanonicalName root = new CanonicalName.root();
+ final CanonicalName root;
final List<Library> libraries;
@@ -4249,8 +4249,12 @@ class Program extends TreeNode {
/// Reference to the main method in one of the libraries.
Reference mainMethodName;
- Program([List<Library> libraries, Map<String, Source> uriToSource])
- : libraries = libraries ?? <Library>[],
+ Program(
+ {CanonicalName nameRoot,
+ List<Library> libraries,
+ Map<String, Source> uriToSource})
+ : root = nameRoot ?? new CanonicalName.root(),
+ libraries = libraries ?? <Library>[],
uriToSource = uriToSource ?? <String, Source>{} {
setParents(this.libraries, this);
}

Powered by Google App Engine
This is Rietveld 408576698