@@ -155,8 +155,11 @@ abstract class ModelElement implements Comparable {
155155 List <String > get annotations {
156156 // Check https://code.google.com/p/dart/issues/detail?id=23181
157157 // If that is fixed, this code might get a lot easier
158- if (element.node != null && element.node is AnnotatedNode ) {
159- return (element.node as AnnotatedNode ).metadata.map ((Annotation a) {
158+ if (element.computeNode () != null &&
159+ element.computeNode () is AnnotatedNode ) {
160+ return (element.computeNode () as AnnotatedNode )
161+ .metadata
162+ .map ((Annotation a) {
160163 var annotationString = a.toSource ().substring (1 ); // remove the @
161164 var e = a.element;
162165 if (e != null && (e is ConstructorElement )) {
@@ -1244,7 +1247,7 @@ class Enum extends Class {
12441247abstract class SourceCodeMixin {
12451248 String get sourceCode {
12461249 String contents = element.source.contents.data;
1247- var node = element.node ; // TODO: computeNode once we go to 0.25.2
1250+ var node = element.computeNode () ; // TODO: computeNode once we go to 0.25.2
12481251 // find the start of the line, so that we can line up all the indents
12491252 int i = node.offset;
12501253 while (i > 0 ) {
@@ -1369,8 +1372,8 @@ class Field extends ModelElement {
13691372 String get constantValue {
13701373 if (_constantValue != null ) return _constantValue;
13711374
1372- if (_field.node == null ) return null ;
1373- var v = _field.node .toSource ();
1375+ if (_field.computeNode () == null ) return null ;
1376+ var v = _field.computeNode () .toSource ();
13741377 if (v == null ) return null ;
13751378 var string = v.substring (v.indexOf ('=' ) + 1 , v.length).trim ();
13761379 _constantValue = string.replaceAll (modelType.name, modelType.linkedName);
@@ -1617,7 +1620,9 @@ class TopLevelVariable extends ModelElement {
16171620 }
16181621
16191622 String get constantValue {
1620- var v = (_variable as ConstTopLevelVariableElementImpl ).node.toSource ();
1623+ var v = (_variable as ConstTopLevelVariableElementImpl )
1624+ .computeNode ()
1625+ .toSource ();
16211626 if (v == null ) return '' ;
16221627 var string = v.substring (v.indexOf ('=' ) + 1 , v.length).trim ();
16231628 return string.replaceAll (modelType.name, modelType.linkedName);
0 commit comments