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

Unified Diff: lib/binary/ast_to_binary.dart

Issue 2502343002: Store named parameters in sorted lists instead of using maps. (Closed)
Patch Set: Remove duplicates from named parameter lists to recover from erroneous inputs Created 4 years, 1 month 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 | « lib/binary/ast_from_binary.dart ('k') | lib/checks.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/binary/ast_to_binary.dart
diff --git a/lib/binary/ast_to_binary.dart b/lib/binary/ast_to_binary.dart
index 4e05ca45adedc678cf0fbd898219caf7502e6655..2a451ed7ba0dd0fa88cefaf1cedc635975acc961 100644
--- a/lib/binary/ast_to_binary.dart
+++ b/lib/binary/ast_to_binary.dart
@@ -893,15 +893,17 @@ class BinaryPrinter extends Visitor {
writeNodeList(node.typeParameters);
writeUInt30(node.requiredParameterCount);
writeNodeList(node.positionalParameters);
- writeList(node.namedParameters.keys.toList(), (String name) {
- writeStringReference(name);
- writeNode(node.namedParameters[name]);
- });
+ writeNodeList(node.namedParameters);
writeNode(node.returnType);
_typeParameterIndexer.pop(node.typeParameters);
}
}
+ visitNamedType(NamedType node) {
+ writeStringReference(node.name);
+ writeNode(node.type);
+ }
+
visitTypeParameterType(TypeParameterType node) {
writeByte(Tag.TypeParameterType);
writeUInt30(_typeParameterIndexer[node.parameter]);
@@ -1139,8 +1141,8 @@ class StringIndexer extends RecursiveVisitor<Null> {
node.visitChildren(this);
}
- visitFunctionType(FunctionType node) {
- node.namedParameters.keys.forEach(put);
+ visitNamedType(NamedType node) {
+ put(node.name);
node.visitChildren(this);
}
« no previous file with comments | « lib/binary/ast_from_binary.dart ('k') | lib/checks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698