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

Unified Diff: runtime/bin/stdio.cc

Issue 1665993002: Prefer Dart_SetReturnValue over Dart_PropagateError when it makes sense. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « runtime/bin/socket.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdio.cc
diff --git a/runtime/bin/stdio.cc b/runtime/bin/stdio.cc
index f0dc923d2d4c9e53fc064b7bb0974eab4ebd54be..c866710e93780954dc937eb9e4cf1e88f32aa9a7 100644
--- a/runtime/bin/stdio.cc
+++ b/runtime/bin/stdio.cc
@@ -47,14 +47,13 @@ void FUNCTION_NAME(Stdin_SetLineMode)(Dart_NativeArguments args) {
void FUNCTION_NAME(Stdout_GetTerminalSize)(Dart_NativeArguments args) {
if (!Dart_IsInteger(Dart_GetNativeArgument(args, 0))) {
OSError os_error(-1, "Invalid argument", OSError::kUnknown);
- Dart_Handle err = DartUtils::NewDartOSError(&os_error);
- if (Dart_IsError(err)) Dart_PropagateError(err);
- Dart_SetReturnValue(args, err);
+ Dart_SetReturnValue(args, DartUtils::NewDartOSError(&os_error));
return;
}
intptr_t fd = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 0));
if (fd != 1 && fd != 2) {
- Dart_PropagateError(Dart_NewApiError("Terminal fd must be 1 or 2"));
+ Dart_SetReturnValue(args, Dart_NewApiError("Terminal fd must be 1 or 2"));
+ return;
}
int size[2];
« no previous file with comments | « runtime/bin/socket.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698