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

Side by Side Diff: lib/compiler/implementation/closure.dart

Issue 10947006: element.isMember does not imply element.enclosingElement.isClass? can we fix that? (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("closureToClassMapper"); 5 #library("closureToClassMapper");
6 6
7 #import("elements/elements.dart"); 7 #import("elements/elements.dart");
8 #import("leg.dart"); 8 #import("leg.dart");
9 #import("scanner/scannerlib.dart"); 9 #import("scanner/scannerlib.dart");
10 #import("tree/tree.dart"); 10 #import("tree/tree.dart");
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 void analyzeTypeVariables(DartType type) { 366 void analyzeTypeVariables(DartType type) {
367 if (type is TypeVariableType) { 367 if (type is TypeVariableType) {
368 useLocal(type.element); 368 useLocal(type.element);
369 } else if (type is InterfaceType) { 369 } else if (type is InterfaceType) {
370 InterfaceType ifcType = type; 370 InterfaceType ifcType = type;
371 for (DartType argument in ifcType.arguments) { 371 for (DartType argument in ifcType.arguments) {
372 analyzeTypeVariables(argument); 372 analyzeTypeVariables(argument);
373 } 373 }
374 } 374 }
375 } 375 }
376 376 if (outermostFunctionElement.isMember() &&
377 if (outermostFunctionElement.isMember() 377 compiler.world.needsRti(outermostFunctionElement.getEnclosingClass())) {
378 && compiler.world.needsRti(outermostFunctionElement.enclosingElement)) {
379 if (outermostFunctionElement.isInstanceMember() 378 if (outermostFunctionElement.isInstanceMember()
380 || outermostFunctionElement.isGenerativeConstructor()) { 379 || outermostFunctionElement.isGenerativeConstructor()) {
381 if (hasTypeVariable(type)) useLocal(closureData.thisElement); 380 if (hasTypeVariable(type)) useLocal(closureData.thisElement);
382 } else if (outermostFunctionElement.isFactoryConstructor()) { 381 } else if (outermostFunctionElement.isFactoryConstructor()) {
383 analyzeTypeVariables(type); 382 analyzeTypeVariables(type);
384 } 383 }
385 } 384 }
386 385
387 node.visitChildren(this); 386 node.visitChildren(this);
388 } 387 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 } 597 }
599 598
600 visitTryStatement(TryStatement node) { 599 visitTryStatement(TryStatement node) {
601 // TODO(ngeoffray): implement finer grain state. 600 // TODO(ngeoffray): implement finer grain state.
602 bool oldInTryStatement = inTryStatement; 601 bool oldInTryStatement = inTryStatement;
603 inTryStatement = true; 602 inTryStatement = true;
604 node.visitChildren(this); 603 node.visitChildren(this);
605 inTryStatement = oldInTryStatement; 604 inTryStatement = oldInTryStatement;
606 } 605 }
607 } 606 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698