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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10911062: Codegen support for the argument definition test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « lib/compiler/implementation/js_backend/emitter.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/resolver.dart
===================================================================
--- lib/compiler/implementation/resolver.dart (revision 11813)
+++ lib/compiler/implementation/resolver.dart (working copy)
@@ -6,17 +6,20 @@
Element operator[](Node node);
Selector getSelector(Send send);
DartType getType(TypeAnnotation annotation);
+ bool isParameterChecked(Element element);
}
class TreeElementMapping implements TreeElements {
- Map<Node, Element> map;
- Map<Node, Selector> selectors;
- Map<TypeAnnotation, DartType> types;
+ final Map<Node, Element> map;
+ final Map<Node, Selector> selectors;
+ final Map<TypeAnnotation, DartType> types;
+ final Set<Element> checkedParameters;
TreeElementMapping()
- : map = new LinkedHashMap<Node, Element>(),
- selectors = new LinkedHashMap<Node, Selector>(),
- types = new LinkedHashMap<TypeAnnotation, DartType>();
+ : map = new LinkedHashMap<Node, Element>(),
+ selectors = new LinkedHashMap<Node, Selector>(),
+ types = new LinkedHashMap<TypeAnnotation, DartType>(),
+ checkedParameters = new Set<Element>();
operator []=(Node node, Element element) => map[node] = element;
operator [](Node node) => map[node];
@@ -33,6 +36,10 @@
}
Selector getSelector(Node node) => selectors[node];
+
+ bool isParameterChecked(Element element) {
+ return checkedParameters.contains(element);
+ }
}
class ResolverTask extends CompilerTask {
@@ -1347,8 +1354,7 @@
if (parameter === null || parameter.kind !== ElementKind.PARAMETER) {
error(node.receiver, MessageKind.PARAMETER_NAME_EXPECTED);
} else {
- warning(node, MessageKind.GENERIC,
- ['argument definition test operator is not implemented.']);
+ mapping.checkedParameters.add(parameter);
}
}
}
« no previous file with comments | « lib/compiler/implementation/js_backend/emitter.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698