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

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

Issue 1966373002: Revert "Fix strong mode errors in dart:io." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 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);
}
« 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