Skip to content

Commit 44aa9a1

Browse files
lexaknyazevcommit-bot@chromium.org
authored and
commit-bot@chromium.org
committed
Do not return this on RandomAccessFile.close
Bug: 32015 Change-Id: I98508bdad569201afeed91f1287f061b5bb39a31 Reviewed-on: https://dart-review.googlesource.com/44060 Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Vyacheslav Egorov <vegorov@google.com> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
1 parent 9be2584 commit 44aa9a1

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

sdk/lib/io/file.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,10 @@ abstract class File implements FileSystemEntity {
609609
*/
610610
abstract class RandomAccessFile {
611611
/**
612-
* Closes the file. Returns a `Future<RandomAccessFile>` that
612+
* Closes the file. Returns a `Future` that
613613
* completes with this RandomAccessFile when it has been closed.
614614
*/
615-
Future<RandomAccessFile> close();
615+
Future<void> close();
616616

617617
/**
618618
* Synchronously closes the file.

sdk/lib/io/file_impl.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -685,15 +685,13 @@ class _RandomAccessFile implements RandomAccessFile {
685685
}
686686
}
687687

688-
Future<RandomAccessFile> close() {
688+
Future<void> close() {
689689
return _dispatch(_FILE_CLOSE, [null], markClosed: true).then((result) {
690-
if (result != -1) {
691-
closed = closed || (result == 0);
692-
_maybePerformCleanup();
693-
return this;
694-
} else {
690+
if (result == -1) {
695691
throw new FileSystemException("Cannot close file", path);
696692
}
693+
closed = closed || (result == 0);
694+
_maybePerformCleanup();
697695
});
698696
}
699697

tests/compiler/dart2js/old_frontend/analyze_api_test.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ import 'package:async_helper/async_helper.dart';
1818
* the error/warning message in the list of white-listings for each file.
1919
*/
2020
// TODO(johnniwinther): Support canonical URIs as keys.
21-
const Map<String, List<String>> WHITE_LIST = const {};
21+
const Map<String, List<String>> WHITE_LIST = const {
22+
"sdk/lib/io/file.dart": const [
23+
"'void' is not a subtype of bound 'Object' for type variable",
24+
],
25+
"sdk/lib/io/file_impl.dart": const [
26+
"'void' is not a subtype of bound 'Object' for type variable",
27+
],
28+
};
2229

2330
void main() {
2431
var uriList = new List<Uri>();

tests/compiler/dart2js/old_frontend/analyze_unused_dart2js_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ const Map<String, List<String>> WHITE_LIST = const {
6262
"pkg/compiler/lib/src/js_backend/runtime_types.dart": const [
6363
"'void' is not a subtype of bound 'Object' for type variable",
6464
],
65+
66+
"sdk/lib/io/file.dart": const [
67+
"'void' is not a subtype of bound 'Object' for type variable",
68+
],
69+
70+
"sdk/lib/io/file_impl.dart": const [
71+
"'void' is not a subtype of bound 'Object' for type variable",
72+
],
6573
};
6674

6775
void main() {

0 commit comments

Comments
 (0)