Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: sdk/lib/io/stdio.dart

Issue 1904553006: Fix strong mode errors in dart:io. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix directory_list rename for dartium. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | sdk/lib/io/string_transformer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/stdio.dart
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
index feea4fffc08249eb5d100e1b81c210fec024f138..03721e9864bc3b18df90a3c3a214d21bc86239ef 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.dart
@@ -328,13 +328,18 @@ StdioType stdioType(object) {
return StdioType.FILE;
}
if (object is Socket) {
- switch (_StdIOUtils._socketType(object._nativeSocket)) {
- case _STDIO_HANDLE_TYPE_TERMINAL: return StdioType.TERMINAL;
- case _STDIO_HANDLE_TYPE_PIPE: return StdioType.PIPE;
- case _STDIO_HANDLE_TYPE_FILE: return StdioType.FILE;
+ int socketType = _StdIOUtils._socketType(object);
+ if (socketType == null) return StdioType.OTHER;
+ switch (socketType) {
+ case _STDIO_HANDLE_TYPE_TERMINAL:
+ return StdioType.TERMINAL;
+ case _STDIO_HANDLE_TYPE_PIPE:
+ return StdioType.PIPE;
+ case _STDIO_HANDLE_TYPE_FILE:
+ return StdioType.FILE;
}
}
- if (object is IOSink) {
+ if (object is _IOSinkImpl) {
try {
if (object._target is _FileStreamConsumer) {
return StdioType.FILE;
@@ -350,6 +355,7 @@ StdioType stdioType(object) {
class _StdIOUtils {
external static _getStdioOutputStream(int fd);
external static Stdin _getStdioInputStream();
- external static int _socketType(nativeSocket);
+ /// Returns the socket type or `null` if [socket] is not a builtin socket.
+ external static int _socketType(Socket socket);
external static _getStdioHandleType(int fd);
}
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | sdk/lib/io/string_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698