OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.task.options; | 5 library analyzer.src.task.options; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
10 import 'package:analyzer/plugin/options.dart'; | 10 import 'package:analyzer/plugin/options.dart'; |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 } | 531 } |
532 } | 532 } |
533 | 533 |
534 void _applyLanguageOption( | 534 void _applyLanguageOption( |
535 AnalysisOptionsImpl options, Object feature, Object value) { | 535 AnalysisOptionsImpl options, Object feature, Object value) { |
536 bool boolValue = toBool(value); | 536 bool boolValue = toBool(value); |
537 if (boolValue != null) { | 537 if (boolValue != null) { |
538 if (feature == AnalyzerOptions.enableAssertInitializer) { | 538 if (feature == AnalyzerOptions.enableAssertInitializer) { |
539 options.enableAssertInitializer = boolValue; | 539 options.enableAssertInitializer = boolValue; |
540 } else if (feature == AnalyzerOptions.enableStrictCallChecks) { | 540 } else if (feature == AnalyzerOptions.enableStrictCallChecks) { |
541 options.enableStrictCallChecks = true; | 541 options.enableStrictCallChecks = boolValue; |
542 } else if (feature == AnalyzerOptions.enableSuperMixins) { | 542 } else if (feature == AnalyzerOptions.enableSuperMixins) { |
543 options.enableSuperMixins = boolValue; | 543 options.enableSuperMixins = boolValue; |
544 } | 544 } |
545 } | 545 } |
546 } | 546 } |
547 | 547 |
548 void _applyLanguageOptions(AnalysisOptionsImpl options, Object configs) { | 548 void _applyLanguageOptions(AnalysisOptionsImpl options, Object configs) { |
549 if (configs is YamlMap) { | 549 if (configs is YamlMap) { |
550 configs.nodes.forEach((key, value) { | 550 configs.nodes.forEach((key, value) { |
551 if (key is YamlScalar && value is YamlScalar) { | 551 if (key is YamlScalar && value is YamlScalar) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 } | 586 } |
587 }); | 587 }); |
588 } else if (config is Map) { | 588 } else if (config is Map) { |
589 options.strongMode = true; | 589 options.strongMode = true; |
590 config.forEach((k, v) => _applyStrongModeOption(options, k, v)); | 590 config.forEach((k, v) => _applyStrongModeOption(options, k, v)); |
591 } else { | 591 } else { |
592 options.strongMode = config is bool ? config : false; | 592 options.strongMode = config is bool ? config : false; |
593 } | 593 } |
594 } | 594 } |
595 } | 595 } |
OLD | NEW |