final -> var for analyzer_utilities

As per, https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/doc/implementation/coding_style.md#local-variables



Change-Id: Ib286a522351460abeca228fabc3b3bc6c57e3421
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346081
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
pq 2024-01-12 22:29:37 +00:00 committed by Commit Queue
parent df5a3d8678
commit cde2b1acf9
4 changed files with 5 additions and 5 deletions

View file

@ -73,7 +73,7 @@ class Element extends Node {
List<Element> get children => nodes.whereType<Element>().toList(); List<Element> get children => nodes.whereType<Element>().toList();
List<String> get classes { List<String> get classes {
final classes = attributes['class']; var classes = attributes['class'];
if (classes != null) { if (classes != null) {
return classes.split(' ').toList(); return classes.split(' ').toList();
} else { } else {

View file

@ -12,7 +12,7 @@ import 'html_dom.dart';
/// Given HTML text, return a parsed HTML tree. /// Given HTML text, return a parsed HTML tree.
Document parse(String htmlContents, Uri uri) { Document parse(String htmlContents, Uri uri) {
final RegExp commentRegex = RegExp(r'<!--[^>]+-->'); RegExp commentRegex = RegExp(r'<!--[^>]+-->');
Element createElement(XmlElement xmlElement) { Element createElement(XmlElement xmlElement) {
// element // element

View file

@ -28,8 +28,8 @@ String get packageRoot {
// Try google3 environment. We expect that all packages that will be // Try google3 environment. We expect that all packages that will be
// accessed via this root are configured in the BUILD file, and located // accessed via this root are configured in the BUILD file, and located
// inside this single root. // inside this single root.
final runFiles = Platform.environment['TEST_SRCDIR']; var runFiles = Platform.environment['TEST_SRCDIR'];
final analyzerPackagesRoot = Platform.environment['ANALYZER_PACKAGES_ROOT']; var analyzerPackagesRoot = Platform.environment['ANALYZER_PACKAGES_ROOT'];
if (runFiles != null && analyzerPackagesRoot != null) { if (runFiles != null && analyzerPackagesRoot != null) {
return pathos.join(runFiles, analyzerPackagesRoot); return pathos.join(runFiles, analyzerPackagesRoot);
} }

View file

@ -32,7 +32,7 @@ class VerifyTests {
resourceProvider: provider, resourceProvider: provider,
includedPaths: <String>[testDirPath], includedPaths: <String>[testDirPath],
excludedPaths: excludedPaths); excludedPaths: excludedPaths);
final singleAnalysisContext = collection.contexts var singleAnalysisContext = collection.contexts
.where(analysisContextPredicate ?? (_) => true) .where(analysisContextPredicate ?? (_) => true)
.toList() .toList()
.singleOrNull; .singleOrNull;