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

Unified Diff: runtime/lib/bool.cc

Issue 54623003: Change bool.fromEnvironment to recognize "true" and "false" and use default for rest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « no previous file | sdk/lib/core/bool.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/bool.cc
diff --git a/runtime/lib/bool.cc b/runtime/lib/bool.cc
index 30a69629d010887a433561b213b05406ec27a3c1..d57574568dd127bfdfcd15ee92b40bbc6cd3f9ad 100644
--- a/runtime/lib/bool.cc
+++ b/runtime/lib/bool.cc
@@ -27,8 +27,8 @@ DEFINE_NATIVE_ENTRY(Bool_fromEnvironment, 3) {
if (Dart_IsString(result)) {
const char *chars;
Dart_StringToCString(result, &chars);
- return (strcmp("true", chars) == 0)
- ? Bool::True().raw() : Bool::False().raw();
+ if (strcmp("true", chars) == 0) return Bool::True().raw();
+ if (strcmp("false", chars) == 0) return Bool::False().raw();
} else if (Dart_IsError(result)) {
const Object& error =
Object::Handle(isolate, Api::UnwrapHandle(result));
« no previous file with comments | « no previous file | sdk/lib/core/bool.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698