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

Unified Diff: pkg/analyzer/lib/source/analysis_options_provider.dart

Issue 1369573003: Fix handling of empty .analysis_options files and test this case (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | pkg/analyzer/test/source/analysis_options_provider_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/source/analysis_options_provider.dart
diff --git a/pkg/analyzer/lib/source/analysis_options_provider.dart b/pkg/analyzer/lib/source/analysis_options_provider.dart
index a3ac86bc4a8cb1e72c649fb3069c23f3f718abb1..fd20714a7a98479eca3bd86f6426388f4fe827d4 100644
--- a/pkg/analyzer/lib/source/analysis_options_provider.dart
+++ b/pkg/analyzer/lib/source/analysis_options_provider.dart
@@ -35,10 +35,6 @@ class AnalysisOptionsProvider {
return options;
}
var doc = loadYaml(optionsSource);
- if (doc is! YamlMap) {
pquitslund 2015/09/24 19:26:17 I would prefer: if (doc != null && doc is! Yaml
Cutch 2015/09/24 19:37:22 Done and I've added a test for the invalid yaml ca
- throw new Exception(
- 'Bad options file format (expected map, got ${doc.runtimeType})');
- }
if (doc is YamlMap) {
doc.forEach((k, v) {
if (k is! String) {
« no previous file with comments | « no previous file | pkg/analyzer/test/source/analysis_options_provider_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698