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

Side by Side Diff: frog/leg/elements/elements.dart

Issue 9695059: Fix leg assert and NPE to make BB green. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | frog/leg/ssa/closure.dart » ('j') | 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('elements'); 5 #library('elements');
6 6
7 #import('../tree/tree.dart'); 7 #import('../tree/tree.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 #import('../leg.dart'); // TODO(karlklose): we only need type. 9 #import('../leg.dart'); // TODO(karlklose): we only need type.
10 #import('../util/util.dart'); 10 #import('../util/util.dart');
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 position() { 418 position() {
419 // The getter and setter may be defined in two different 419 // The getter and setter may be defined in two different
420 // compilation units. However, we know that one of them is 420 // compilation units. However, we know that one of them is
421 // non-null and defined in the same compilation unit as the 421 // non-null and defined in the same compilation unit as the
422 // abstract element. 422 // abstract element.
423 // 423 //
424 // We need to make sure that the position returned is relative to 424 // We need to make sure that the position returned is relative to
425 // the compilation unit of the abstract element. 425 // the compilation unit of the abstract element.
426 if (getter !== null && getter.enclosingElement === enclosingElement) { 426 if (getter !== null && getter.enclosingElement === enclosingElement) {
427 return getter.position(); 427 return getter.position();
428 } else { 428 } else if (setter != null) {
429 // TODO(ahe): checking for null should not be necessary.
ngeoffray 2012/03/13 20:08:24 Told you so :-)
ahe 2012/03/14 09:22:08 Why is this happening? I think this is a symptom f
429 return setter.position(); 430 return setter.position();
430 } 431 }
floitsch 2012/03/14 09:03:09 else { return null; }
431 } 432 }
432 } 433 }
433 434
434 /** DEPRECATED. */ 435 /** DEPRECATED. */
435 Type getType(TypeAnnotation typeAnnotation, 436 Type getType(TypeAnnotation typeAnnotation,
436 Compiler compiler, 437 Compiler compiler,
437 LibraryElement library) { 438 LibraryElement library) {
438 // TODO(karlklose,ngeoffray): This method should be removed and the 439 // TODO(karlklose,ngeoffray): This method should be removed and the
439 // information should be computed by the resolver. 440 // information should be computed by the resolver.
440 441
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 return result; 874 return result;
874 } 875 }
875 876
876 Node parseNode(DiagnosticListener l) => statement; 877 Node parseNode(DiagnosticListener l) => statement;
877 878
878 bool get isSwitch() => statement is SwitchStatement; 879 bool get isSwitch() => statement is SwitchStatement;
879 880
880 Token position() => statement.getBeginToken(); 881 Token position() => statement.getBeginToken();
881 String toString() => statement.toString(); 882 String toString() => statement.toString();
882 } 883 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/ssa/closure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698