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

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

Issue 10441071: Use the typedef arity to know how to invoke a closure given by the dom. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 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: dart/lib/compiler/implementation/elements/elements.dart
===================================================================
--- dart/lib/compiler/implementation/elements/elements.dart (revision 8049)
+++ dart/lib/compiler/implementation/elements/elements.dart (working copy)
@@ -356,12 +356,23 @@
class TypedefElement extends Element {
final Token token;
Type cachedType;
+ Node cachedNode;
ahe 2012/05/29 12:32:08 The type should be Typedef.
ngeoffray 2012/05/29 13:06:28 Done.
TypedefElement(SourceString name, Element enclosing, this.token)
: super(name, ElementKind.TYPEDEF, enclosing) {
cachedType = new InterfaceType(this);
}
+ Node parseNode(Compiler compiler) {
ahe 2012/05/29 12:32:08 I would prefer if this followed the "PartialFuncti
ngeoffray 2012/05/29 13:06:28 Done.
+ if (cachedNode !== null) return cachedNode;
+ NodeListener listener = new NodeListener(compiler, enclosingElement);
+ Parser parser = new Parser(listener);
+ Token token = parser.parseTopLevelDeclaration(token);
+ cachedNode = listener.popNode();
+ assert(listener.nodes.isEmpty());
kasperl 2012/05/29 12:16:24 Maybe cancel with an internal error instead?
ahe 2012/05/29 12:32:08 This is consistent with other code.
+ return cachedNode;
+ }
+
position() => findMyName(token);
Type computeType(Compiler compiler) => cachedType;

Powered by Google App Engine
This is Rietveld 408576698