Fix some warnings in pub and pkg packages.

Review URL: https://codereview.chromium.org//13817008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21701 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
nweiz@google.com 2013-04-18 20:24:47 +00:00
parent a204feb031
commit 89cb31e4c4
7 changed files with 29 additions and 16 deletions

View file

@ -31,7 +31,7 @@ class SafeHttpServer extends StreamView<HttpRequest> implements HttpServer {
: super(server),
_inner = server;
Future close() => _inner.close();
void close() => _inner.close();
int get port => _inner.port;
@ -136,7 +136,8 @@ class _HttpResponseWrapper implements HttpResponse {
Future close() => _inner.close();
void write(Object obj) => _inner.write(obj);
void writeAll(Iterable objects, [String separator = ""]) =>
_inner.writeAll(objects, separator);
_inner.writeAll(objects, separator);
void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
void writeln([Object obj = ""]) => _inner.writeln(obj);
void addError(error) => _inner.addError(error);
}

View file

@ -74,12 +74,6 @@ abstract class MessageLookupByLibrary {
/** Prevent infinite recursion when looking up the message. */
bool _lookupInProgress = false;
/**
* Return true if the locale exists, or if it is null. Null is treated
* as meaning that we use the default locale.
*/
bool localeExists(localeName);
/**
* Return the localized version of a message. We are passed the original
* version of the message, which consists of a

View file

@ -475,7 +475,7 @@ class _NumberFormatParser {
format._negativePrefix = _parseAffix();
// Skip over the negative trunk, verifying that it's identical to the
// positive trunk.
for (var each in _iterator(trunk)) {
for (var each in _iterable(trunk)) {
if (pattern.current != each && pattern.current != null) {
throw new FormatException(
"Positive and negative trunks must be the same");
@ -719,11 +719,28 @@ class _NumberFormatParser {
}
}
/**
* Returns an [Iterable] on the string as a list of substrings.
*/
Iterable _iterable(String s) => new _StringIterable(s);
/**
* Return an iterator on the string as a list of substrings.
*/
Iterator _iterator(String s) => new _StringIterator(s);
// TODO(nweiz): remove this when issue 3780 is fixed.
/**
* Provides an Iterable that wraps [_iterator] so it can be used in a `for`
* loop.
*/
class _StringIterable extends Iterable<String> {
final Iterator<String> iterator;
_StringIterable(String s)
: iterator = _iterator(s);
}
/**
* Provides an iterator over a string as a list of substrings, and also
* gives us a lookahead of one via the [peek] method.

View file

@ -57,7 +57,7 @@ class SafeHttpServer extends StreamView<HttpRequest> implements HttpServer {
// Manually handle cancelOnError so the above (ignored) errors don't
// cause unsubscription.
if (cancelOnError) subscription.cancel();
if (onError != null) onError(e);
if (onError != null) onError(error);
}, onDone: onDone);
return subscription;
}
@ -139,4 +139,5 @@ class _HttpResponseWrapper implements HttpResponse {
_inner.writeAll(objects, separator);
void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
void writeln([Object obj = ""]) => _inner.writeln(obj);
void addError(error) => _inner.addError(error);
}

View file

@ -201,11 +201,9 @@ String _currentGroup = '';
/** Separator used between group names and test names. */
String groupSep = ' ';
// TODO(nweiz): present an unmodifiable view of this once issue 8321 is fixed.
/** Tests executed in this suite. */
final List<TestCase> _testCases = new List<TestCase>();
/** Get the list of tests. */
final List<TestCase> testCases = new UnmodifiableListView(_testCases);
final List<TestCase> testCases = new List<TestCase>();
/** Setup function called before each test in a group */
Function _testSetup;

View file

@ -46,7 +46,7 @@ class Package {
String get readmePath {
var readmes = listDir(dir).map(path.basename).
where((entry) => entry.contains(_README_REGEXP));
if (readmes.isEmpty) return;
if (readmes.isEmpty) return null;
return path.join(dir, readmes.reduce((readme1, readme2) {
var extensions1 = ".".allMatches(readme1).length;

View file

@ -135,7 +135,9 @@ class _HttpResponseWrapper implements HttpResponse {
_inner.addStream(stream);
Future close() => _inner.close();
void write(Object obj) => _inner.write(obj);
void writeAll(Iterable objects) => _inner.writeAll(objects);
void writeAll(Iterable objects, [String separator = ""]) =>
_inner.writeAll(objects, separator);
void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
void writeln([Object obj = ""]) => _inner.writeln(obj);
void addError(error) => _inner.addError(error);
}