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

Unified Diff: pkg/analysis_server/lib/src/server_options.dart

Issue 1253183015: Flip .packages server support bit. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « pkg/analysis_server/lib/src/context_manager.dart ('k') | pkg/analysis_server/test/server_options_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/server_options.dart
diff --git a/pkg/analysis_server/lib/src/server_options.dart b/pkg/analysis_server/lib/src/server_options.dart
index ab1e0120586d3a085e603a003d9fefe1e1443ad2..2eff6d9d4c403c38996ebdd879efb3dbd8492212 100644
--- a/pkg/analysis_server/lib/src/server_options.dart
+++ b/pkg/analysis_server/lib/src/server_options.dart
@@ -89,14 +89,21 @@ class ServerOptions {
return defaultValue;
}
- /// Test whether the given [booleanPropertyKey] is set to the value `true`.
+ /// Test whether the given [booleanPropertyKey] is set to the value `true`,
+ /// falling back to [defaultValue] if undefined.
/// For example:
/// myDebugOption1:true
/// myDebugOption2:TRUE # Also true (case and trailing whitespace are ignored).
/// myDebugOption3:false
/// myDebugOption4:off # Treated as `false`.
/// myDebugOption5:on # Also read as `false`.
- bool isSet(String booleanPropertyKey) => _options[booleanPropertyKey] == true;
+ bool isSet(String booleanPropertyKey, {bool defaultValue: false}) {
+ var value = _options[booleanPropertyKey];
+ if (value == null) {
+ return defaultValue;
+ }
+ return value == true;
+ }
void _readOptions(String contents) {
var doc = loadYaml(contents);
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | pkg/analysis_server/test/server_options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698