| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.dart.element.element; | 5 library analyzer.src.dart.element.element; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1980 bool operator ==(Object object) { | 1980 bool operator ==(Object object) { |
| 1981 if (identical(this, object)) { | 1981 if (identical(this, object)) { |
| 1982 return true; | 1982 return true; |
| 1983 } | 1983 } |
| 1984 return object is Element && | 1984 return object is Element && |
| 1985 object.kind == kind && | 1985 object.kind == kind && |
| 1986 object.location == location; | 1986 object.location == location; |
| 1987 } | 1987 } |
| 1988 | 1988 |
| 1989 /** | 1989 /** |
| 1990 * Append to the given [buffer] a comma-separated list of the names of the |
| 1991 * types of this element and every enclosing element. |
| 1992 */ |
| 1993 void appendPathTo(StringBuffer buffer) { |
| 1994 Element element = this; |
| 1995 while (element != null) { |
| 1996 if (element != this) { |
| 1997 buffer.write(', '); |
| 1998 } |
| 1999 buffer.write(element.runtimeType); |
| 2000 String name = element.name; |
| 2001 if (name != null) { |
| 2002 buffer.write(' ('); |
| 2003 buffer.write(name); |
| 2004 buffer.write(')'); |
| 2005 } |
| 2006 element = element.enclosingElement; |
| 2007 } |
| 2008 } |
| 2009 |
| 2010 /** |
| 1990 * Append a textual representation of this element to the given [buffer]. | 2011 * Append a textual representation of this element to the given [buffer]. |
| 1991 */ | 2012 */ |
| 1992 void appendTo(StringBuffer buffer) { | 2013 void appendTo(StringBuffer buffer) { |
| 1993 if (_name == null) { | 2014 if (_name == null) { |
| 1994 buffer.write("<unnamed "); | 2015 buffer.write("<unnamed "); |
| 1995 buffer.write(runtimeType.toString()); | 2016 buffer.write(runtimeType.toString()); |
| 1996 buffer.write(">"); | 2017 buffer.write(">"); |
| 1997 } else { | 2018 } else { |
| 1998 buffer.write(_name); | 2019 buffer.write(_name); |
| 1999 } | 2020 } |
| (...skipping 2910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4910 | 4931 |
| 4911 @override | 4932 @override |
| 4912 void visitElement(Element element) { | 4933 void visitElement(Element element) { |
| 4913 int offset = element.nameOffset; | 4934 int offset = element.nameOffset; |
| 4914 if (offset != -1) { | 4935 if (offset != -1) { |
| 4915 map[offset] = element; | 4936 map[offset] = element; |
| 4916 } | 4937 } |
| 4917 super.visitElement(element); | 4938 super.visitElement(element); |
| 4918 } | 4939 } |
| 4919 } | 4940 } |
| OLD | NEW |