Remove some (but not all) unused methods in analyzer.
R=brianwilkerson@google.com BUG= Review URL: https://codereview.chromium.org//728513002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41721 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
@@ -6,7 +6,6 @@ library error;
|
||||
import 'dart:collection';
|
||||
|
||||
import 'generated/error.dart';
|
||||
import 'generated/source.dart';
|
||||
|
||||
/// The maximum line length when printing extracted source code when converting
|
||||
/// an [AnalyzerError] to a string.
|
||||
@@ -92,13 +91,3 @@ class AnalyzerError implements Exception {
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
// A content receiver that collects all the content into a string.
|
||||
class _ContentReceiver implements Source_ContentReceiver {
|
||||
final _buffer = new StringBuffer();
|
||||
|
||||
String get result => _buffer.toString();
|
||||
|
||||
void accept(String contents, _) =>
|
||||
_buffer.write(contents.substring(0, contents.length));
|
||||
}
|
||||
|
||||
@@ -1474,24 +1474,6 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
|
||||
_error(node, null);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return `true` if the given element represents the 'length' getter in class 'String'.
|
||||
*
|
||||
* @param element the element being tested.
|
||||
* @return
|
||||
*/
|
||||
bool _isStringLength(Element element) {
|
||||
if (element is! PropertyAccessorElement) {
|
||||
return false;
|
||||
}
|
||||
PropertyAccessorElement accessor = element as PropertyAccessorElement;
|
||||
if (!accessor.isGetter || accessor.name != "length") {
|
||||
return false;
|
||||
}
|
||||
Element parent = accessor.enclosingElement;
|
||||
return parent == _typeProvider.stringType.element;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6811,44 +6811,6 @@ class InterfaceTypeImpl extends TypeImpl implements InterfaceType {
|
||||
return new List.from(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the "least upper bound" of the given types under the assumption that the types have the
|
||||
* same element and differ only in terms of the type arguments. The resulting type is composed by
|
||||
* comparing the corresponding type arguments, keeping those that are the same, and using
|
||||
* 'dynamic' for those that are different.
|
||||
*
|
||||
* @param firstType the first type
|
||||
* @param secondType the second type
|
||||
* @return the "least upper bound" of the given types
|
||||
*/
|
||||
static InterfaceType _leastUpperBound(InterfaceType firstType, InterfaceType secondType) {
|
||||
if (firstType == secondType) {
|
||||
return firstType;
|
||||
}
|
||||
List<DartType> firstArguments = firstType.typeArguments;
|
||||
List<DartType> secondArguments = secondType.typeArguments;
|
||||
int argumentCount = firstArguments.length;
|
||||
if (argumentCount == 0) {
|
||||
return firstType;
|
||||
}
|
||||
List<DartType> lubArguments = new List<DartType>(argumentCount);
|
||||
for (int i = 0; i < argumentCount; i++) {
|
||||
//
|
||||
// Ideally we would take the least upper bound of the two argument types, but this can cause
|
||||
// an infinite recursion (such as when finding the least upper bound of String and num).
|
||||
//
|
||||
if (firstArguments[i] == secondArguments[i]) {
|
||||
lubArguments[i] = firstArguments[i];
|
||||
}
|
||||
if (lubArguments[i] == null) {
|
||||
lubArguments[i] = DynamicTypeImpl.instance;
|
||||
}
|
||||
}
|
||||
InterfaceTypeImpl lub = new InterfaceTypeImpl.con1(firstType.element);
|
||||
lub.typeArguments = lubArguments;
|
||||
return lub;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array containing the actual types of the type arguments.
|
||||
*/
|
||||
|
||||
@@ -2804,15 +2804,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string with debugging information about the given source (the full name and
|
||||
* modification stamp of the source).
|
||||
*
|
||||
* @param source the source for which a debugging string is to be produced
|
||||
* @return debugging information about the given source
|
||||
*/
|
||||
String _debuggingString(Source source) => "'${source.fullName}' [${getModificationStamp(source)}]";
|
||||
|
||||
/**
|
||||
* Return an array containing all of the change notices that are waiting to be returned. If there
|
||||
* are no notices, then return either `null` or an empty array, depending on the value of
|
||||
@@ -8586,25 +8577,6 @@ class DartEntry extends SourceEntry {
|
||||
|| descriptor == RESOLVED_UNIT
|
||||
|| descriptor == VERIFICATION_ERRORS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given that the specified flag is being transitioned to the given state, set the value of the
|
||||
* flag to the value that should be kept in the cache.
|
||||
*
|
||||
* @param index the index of the flag whose state is being set
|
||||
* @param state the state to which the value is being transitioned
|
||||
*/
|
||||
void _updateValueOfFlag(int index, CacheState state) {
|
||||
if (state == CacheState.VALID) {
|
||||
throw new IllegalArgumentException("Use setValue() to set the state to VALID");
|
||||
} else if (state != CacheState.IN_PROCESS) {
|
||||
//
|
||||
// If the value is in process, we can leave the current value in the cache for any 'get'
|
||||
// methods to access.
|
||||
//
|
||||
_setFlag(index, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -13138,15 +13110,6 @@ abstract class SourceEntry {
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of all of the flags with the given [indexes] to false.
|
||||
*/
|
||||
void _clearFlags(List<int> indexes) {
|
||||
for (int i = 0; i < indexes.length; i++) {
|
||||
_flags = BooleanArray.set(_flags, indexes[i], false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush the value of the data described by the [descriptor].
|
||||
*/
|
||||
|
||||
@@ -5256,30 +5256,6 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return `true` if the given type represents the class `Future` from the
|
||||
* `dart:async` library.
|
||||
*
|
||||
* @param type the type to be tested
|
||||
* @return `true` if the given type represents the class `Future` from the
|
||||
* `dart:async` library
|
||||
*/
|
||||
bool _isFuture(DartType type) {
|
||||
if (type is InterfaceType) {
|
||||
InterfaceType interfaceType = type;
|
||||
if (interfaceType.name == "Future") {
|
||||
ClassElement element = interfaceType.element;
|
||||
if (element != null) {
|
||||
LibraryElement library = element.library;
|
||||
if (library.name == "dart.async") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return `true` iff the passed [ClassElement] has a method, getter or setter that
|
||||
* matches the name of the passed [ExecutableElement] in either the class itself, or one of
|
||||
|
||||
@@ -511,13 +511,6 @@ class DirectoryBasedDartSdk implements DartSdk {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the dart VM is executable. If it is not, make it executable and log that it was
|
||||
* necessary for us to do so.
|
||||
*/
|
||||
void _ensureVmIsExecutable() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the file containing the Dartium executable.
|
||||
*
|
||||
|
||||
@@ -10045,9 +10045,6 @@ $scriptBody
|
||||
XmlValidator_Tag _t(String tag, XmlValidator_Attributes attributes,
|
||||
String content, [List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
|
||||
new XmlValidator_Tag(tag, attributes, content, children);
|
||||
XmlValidator_Tag _t2(String tag, XmlValidator_Attributes attributes,
|
||||
[List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
|
||||
new XmlValidator_Tag(tag, attributes, null, children);
|
||||
XmlValidator_Tag _t3(String tag, String content,
|
||||
[List<XmlValidator_Tag> children = XmlValidator_Tag.EMPTY_LIST]) =>
|
||||
new XmlValidator_Tag(tag, new XmlValidator_Attributes(), content, children);
|
||||
|
||||
Reference in New Issue
Block a user