Index: sdk/lib/io/stdio.dart |
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart |
index 03721e9864bc3b18df90a3c3a214d21bc86239ef..feea4fffc08249eb5d100e1b81c210fec024f138 100644 |
--- a/sdk/lib/io/stdio.dart |
+++ b/sdk/lib/io/stdio.dart |
@@ -328,18 +328,13 @@ StdioType stdioType(object) { |
return StdioType.FILE; |
} |
if (object is Socket) { |
- 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; |
+ 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; |
} |
} |
- if (object is _IOSinkImpl) { |
+ if (object is IOSink) { |
try { |
if (object._target is _FileStreamConsumer) { |
return StdioType.FILE; |
@@ -355,7 +350,6 @@ StdioType stdioType(object) { |
class _StdIOUtils { |
external static _getStdioOutputStream(int fd); |
external static Stdin _getStdioInputStream(); |
- /// Returns the socket type or `null` if [socket] is not a builtin socket. |
- external static int _socketType(Socket socket); |
+ external static int _socketType(nativeSocket); |
external static _getStdioHandleType(int fd); |
} |