lints 2.0 fixes
In anticipation of lints v 2.0.
See: https://dart-review.googlesource.com/c/sdk/+/237746
Change-Id: If6ec7f0bae314af3aa84e4d8a7b9fc1b8219c128
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237763
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
diff --git a/pkg/dart2js_info/bin/src/debug_info.dart b/pkg/dart2js_info/bin/src/debug_info.dart
index 6199ee4..1de2f7d 100644
--- a/pkg/dart2js_info/bin/src/debug_info.dart
+++ b/pkg/dart2js_info/bin/src/debug_info.dart
@@ -194,7 +194,7 @@
_debugCode.write(' ' * _indent);
var endsInNewLine = code.endsWith('\n');
if (endsInNewLine) code = code.substring(0, code.length - 1);
- _debugCode.write(code.replaceAll('\n', '\n' + (' ' * _indent)));
+ _debugCode.write(code.replaceAll('\n', '\n${' ' * _indent}'));
if (endsInNewLine) _debugCode.write(',\n');
if (isClosureClass) {
_indent -= 2;
diff --git a/pkg/dart2js_info/bin/src/library_size_split.dart b/pkg/dart2js_info/bin/src/library_size_split.dart
index da6d85d..1721457 100644
--- a/pkg/dart2js_info/bin/src/library_size_split.dart
+++ b/pkg/dart2js_info/bin/src/library_size_split.dart
@@ -138,7 +138,7 @@
_printRow(_Row row) {
if (row is _Divider) {
- print(' ' + ('-' * (longest + 18)));
+ print(' ${'-' * (longest + 18)}');
return;
}
diff --git a/pkg/dart2js_info/lib/src/proto/info.pb.dart b/pkg/dart2js_info/lib/src/proto/info.pb.dart
index 28d20a6..6d56230 100644
--- a/pkg/dart2js_info/lib/src/proto/info.pb.dart
+++ b/pkg/dart2js_info/lib/src/proto/info.pb.dart
@@ -37,14 +37,14 @@
$core.String? targetId,
$core.String? mask,
}) {
- final _result = create();
+ final result = create();
if (targetId != null) {
- _result.targetId = targetId;
+ result.targetId = targetId;
}
if (mask != null) {
- _result.mask = mask;
+ result.mask = mask;
}
- return _result;
+ return result;
}
factory DependencyInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -139,17 +139,17 @@
$core.Map<$core.String, InfoPB>? allInfos,
$core.Iterable<LibraryDeferredImportsPB>? deferredImports,
}) {
- final _result = create();
+ final result = create();
if (program != null) {
- _result.program = program;
+ result.program = program;
}
if (allInfos != null) {
- _result.allInfos.addAll(allInfos);
+ result.allInfos.addAll(allInfos);
}
if (deferredImports != null) {
- _result.deferredImports.addAll(deferredImports);
+ result.deferredImports.addAll(deferredImports);
}
- return _result;
+ return result;
}
factory AllInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -354,59 +354,59 @@
ClosureInfoPB? closureInfo,
ClassTypeInfoPB? classTypeInfo,
}) {
- final _result = create();
+ final result = create();
if (name != null) {
- _result.name = name;
+ result.name = name;
}
if (id != null) {
- _result.id = id;
+ result.id = id;
}
if (serializedId != null) {
- _result.serializedId = serializedId;
+ result.serializedId = serializedId;
}
if (coverageId != null) {
- _result.coverageId = coverageId;
+ result.coverageId = coverageId;
}
if (size != null) {
- _result.size = size;
+ result.size = size;
}
if (parentId != null) {
- _result.parentId = parentId;
+ result.parentId = parentId;
}
if (uses != null) {
- _result.uses.addAll(uses);
+ result.uses.addAll(uses);
}
if (outputUnitId != null) {
- _result.outputUnitId = outputUnitId;
+ result.outputUnitId = outputUnitId;
}
if (libraryInfo != null) {
- _result.libraryInfo = libraryInfo;
+ result.libraryInfo = libraryInfo;
}
if (classInfo != null) {
- _result.classInfo = classInfo;
+ result.classInfo = classInfo;
}
if (functionInfo != null) {
- _result.functionInfo = functionInfo;
+ result.functionInfo = functionInfo;
}
if (fieldInfo != null) {
- _result.fieldInfo = fieldInfo;
+ result.fieldInfo = fieldInfo;
}
if (constantInfo != null) {
- _result.constantInfo = constantInfo;
+ result.constantInfo = constantInfo;
}
if (outputUnitInfo != null) {
- _result.outputUnitInfo = outputUnitInfo;
+ result.outputUnitInfo = outputUnitInfo;
}
if (typedefInfo != null) {
- _result.typedefInfo = typedefInfo;
+ result.typedefInfo = typedefInfo;
}
if (closureInfo != null) {
- _result.closureInfo = closureInfo;
+ result.closureInfo = closureInfo;
}
if (classTypeInfo != null) {
- _result.classTypeInfo = classTypeInfo;
+ result.classTypeInfo = classTypeInfo;
}
- return _result;
+ return result;
}
factory InfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -745,47 +745,47 @@
$core.bool? isMirrorsUsed,
$core.bool? minified,
}) {
- final _result = create();
+ final result = create();
if (entrypointId != null) {
- _result.entrypointId = entrypointId;
+ result.entrypointId = entrypointId;
}
if (size != null) {
- _result.size = size;
+ result.size = size;
}
if (dart2jsVersion != null) {
- _result.dart2jsVersion = dart2jsVersion;
+ result.dart2jsVersion = dart2jsVersion;
}
if (compilationMoment != null) {
- _result.compilationMoment = compilationMoment;
+ result.compilationMoment = compilationMoment;
}
if (compilationDuration != null) {
- _result.compilationDuration = compilationDuration;
+ result.compilationDuration = compilationDuration;
}
if (toProtoDuration != null) {
- _result.toProtoDuration = toProtoDuration;
+ result.toProtoDuration = toProtoDuration;
}
if (dumpInfoDuration != null) {
- _result.dumpInfoDuration = dumpInfoDuration;
+ result.dumpInfoDuration = dumpInfoDuration;
}
if (noSuchMethodEnabled != null) {
- _result.noSuchMethodEnabled = noSuchMethodEnabled;
+ result.noSuchMethodEnabled = noSuchMethodEnabled;
}
if (isRuntimeTypeUsed != null) {
- _result.isRuntimeTypeUsed = isRuntimeTypeUsed;
+ result.isRuntimeTypeUsed = isRuntimeTypeUsed;
}
if (isIsolateUsed != null) {
- _result.isIsolateUsed = isIsolateUsed;
+ result.isIsolateUsed = isIsolateUsed;
}
if (isFunctionApplyUsed != null) {
- _result.isFunctionApplyUsed = isFunctionApplyUsed;
+ result.isFunctionApplyUsed = isFunctionApplyUsed;
}
if (isMirrorsUsed != null) {
- _result.isMirrorsUsed = isMirrorsUsed;
+ result.isMirrorsUsed = isMirrorsUsed;
}
if (minified != null) {
- _result.minified = minified;
+ result.minified = minified;
}
- return _result;
+ return result;
}
factory ProgramInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -998,14 +998,14 @@
$core.String? uri,
$core.Iterable<$core.String>? childrenIds,
}) {
- final _result = create();
+ final result = create();
if (uri != null) {
- _result.uri = uri;
+ result.uri = uri;
}
if (childrenIds != null) {
- _result.childrenIds.addAll(childrenIds);
+ result.childrenIds.addAll(childrenIds);
}
- return _result;
+ return result;
}
factory LibraryInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1071,11 +1071,11 @@
factory OutputUnitInfoPB({
$core.Iterable<$core.String>? imports,
}) {
- final _result = create();
+ final result = create();
if (imports != null) {
- _result.imports.addAll(imports);
+ result.imports.addAll(imports);
}
- return _result;
+ return result;
}
factory OutputUnitInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1135,14 +1135,14 @@
$core.bool? isAbstract,
$core.Iterable<$core.String>? childrenIds,
}) {
- final _result = create();
+ final result = create();
if (isAbstract != null) {
- _result.isAbstract = isAbstract;
+ result.isAbstract = isAbstract;
}
if (childrenIds != null) {
- _result.childrenIds.addAll(childrenIds);
+ result.childrenIds.addAll(childrenIds);
}
- return _result;
+ return result;
}
factory ClassInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1249,11 +1249,11 @@
factory ConstantInfoPB({
$core.String? code,
}) {
- final _result = create();
+ final result = create();
if (code != null) {
- _result.code = code;
+ result.code = code;
}
- return _result;
+ return result;
}
factory ConstantInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1346,26 +1346,26 @@
$core.bool? isConst,
$core.String? initializerId,
}) {
- final _result = create();
+ final result = create();
if (type != null) {
- _result.type = type;
+ result.type = type;
}
if (inferredType != null) {
- _result.inferredType = inferredType;
+ result.inferredType = inferredType;
}
if (childrenIds != null) {
- _result.childrenIds.addAll(childrenIds);
+ result.childrenIds.addAll(childrenIds);
}
if (code != null) {
- _result.code = code;
+ result.code = code;
}
if (isConst != null) {
- _result.isConst = isConst;
+ result.isConst = isConst;
}
if (initializerId != null) {
- _result.initializerId = initializerId;
+ result.initializerId = initializerId;
}
- return _result;
+ return result;
}
factory FieldInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1478,11 +1478,11 @@
factory TypedefInfoPB({
$core.String? type,
}) {
- final _result = create();
+ final result = create();
if (type != null) {
- _result.type = type;
+ result.type = type;
}
- return _result;
+ return result;
}
factory TypedefInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1563,20 +1563,20 @@
$core.bool? isFactory,
$core.bool? isExternal,
}) {
- final _result = create();
+ final result = create();
if (isStatic != null) {
- _result.isStatic = isStatic;
+ result.isStatic = isStatic;
}
if (isConst != null) {
- _result.isConst = isConst;
+ result.isConst = isConst;
}
if (isFactory != null) {
- _result.isFactory = isFactory;
+ result.isFactory = isFactory;
}
if (isExternal != null) {
- _result.isExternal = isExternal;
+ result.isExternal = isExternal;
}
- return _result;
+ return result;
}
factory FunctionModifiersPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1687,17 +1687,17 @@
$core.String? type,
$core.String? declaredType,
}) {
- final _result = create();
+ final result = create();
if (name != null) {
- _result.name = name;
+ result.name = name;
}
if (type != null) {
- _result.type = type;
+ result.type = type;
}
if (declaredType != null) {
- _result.declaredType = declaredType;
+ result.declaredType = declaredType;
}
- return _result;
+ return result;
}
factory ParameterInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1830,32 +1830,32 @@
$core.int? inlinedCount,
$core.String? code,
}) {
- final _result = create();
+ final result = create();
if (functionModifiers != null) {
- _result.functionModifiers = functionModifiers;
+ result.functionModifiers = functionModifiers;
}
if (childrenIds != null) {
- _result.childrenIds.addAll(childrenIds);
+ result.childrenIds.addAll(childrenIds);
}
if (returnType != null) {
- _result.returnType = returnType;
+ result.returnType = returnType;
}
if (inferredReturnType != null) {
- _result.inferredReturnType = inferredReturnType;
+ result.inferredReturnType = inferredReturnType;
}
if (parameters != null) {
- _result.parameters.addAll(parameters);
+ result.parameters.addAll(parameters);
}
if (sideEffects != null) {
- _result.sideEffects = sideEffects;
+ result.sideEffects = sideEffects;
}
if (inlinedCount != null) {
- _result.inlinedCount = inlinedCount;
+ result.inlinedCount = inlinedCount;
}
if (code != null) {
- _result.code = code;
+ result.code = code;
}
- return _result;
+ return result;
}
factory FunctionInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -1986,11 +1986,11 @@
factory ClosureInfoPB({
$core.String? functionId,
}) {
- final _result = create();
+ final result = create();
if (functionId != null) {
- _result.functionId = functionId;
+ result.functionId = functionId;
}
- return _result;
+ return result;
}
factory ClosureInfoPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -2059,14 +2059,14 @@
$core.String? prefix,
$core.Iterable<$core.String>? files,
}) {
- final _result = create();
+ final result = create();
if (prefix != null) {
- _result.prefix = prefix;
+ result.prefix = prefix;
}
if (files != null) {
- _result.files.addAll(files);
+ result.files.addAll(files);
}
- return _result;
+ return result;
}
factory DeferredImportPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
@@ -2146,17 +2146,17 @@
$core.String? libraryName,
$core.Iterable<DeferredImportPB>? imports,
}) {
- final _result = create();
+ final result = create();
if (libraryUri != null) {
- _result.libraryUri = libraryUri;
+ result.libraryUri = libraryUri;
}
if (libraryName != null) {
- _result.libraryName = libraryName;
+ result.libraryName = libraryName;
}
if (imports != null) {
- _result.imports.addAll(imports);
+ result.imports.addAll(imports);
}
- return _result;
+ return result;
}
factory LibraryDeferredImportsPB.fromBuffer($core.List<$core.int> i,
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
diff --git a/pkg/dart2js_info/test/json_to_proto_test.dart b/pkg/dart2js_info/test/json_to_proto_test.dart
index 67f7ef0..dd79ac1 100644
--- a/pkg/dart2js_info/test/json_to_proto_test.dart
+++ b/pkg/dart2js_info/test/json_to_proto_test.dart
@@ -40,7 +40,7 @@
final expectedPrefixes = <InfoKind, String>{};
for (final kind in InfoKind.values) {
- expectedPrefixes[kind] = kindToString(kind) + '/';
+ expectedPrefixes[kind] = '${kindToString(kind)}/';
}
for (final info in proto.allInfos.entries) {
diff --git a/pkg/dev_compiler/lib/src/compiler/js_metalet.dart b/pkg/dev_compiler/lib/src/compiler/js_metalet.dart
index 06d5941..379746d 100644
--- a/pkg/dev_compiler/lib/src/compiler/js_metalet.dart
+++ b/pkg/dev_compiler/lib/src/compiler/js_metalet.dart
@@ -322,7 +322,7 @@
/// Compute fresh IDs to avoid
static int _uniqueId = 0;
- MetaLetVariable(this.displayName) : super(displayName + '@${++_uniqueId}');
+ MetaLetVariable(this.displayName) : super('$displayName@${++_uniqueId}');
}
class _VariableUseCounter extends BaseVisitor<void> {
diff --git a/pkg/dev_compiler/lib/src/compiler/js_names.dart b/pkg/dev_compiler/lib/src/compiler/js_names.dart
index 186a316..9e95de7 100644
--- a/pkg/dev_compiler/lib/src/compiler/js_names.dart
+++ b/pkg/dev_compiler/lib/src/compiler/js_names.dart
@@ -97,7 +97,7 @@
/// `function` or `instanceof`, and their `name` field controls whether they
/// refer to the same variable.
class TemporaryNamer extends LocalNamer {
- _FunctionScope scope;
+ _FunctionScope _scope;
/// Listener to be notified when a name is selected (rename or not) for an
/// `Identifier`.
@@ -106,23 +106,23 @@
final NameListener _nameListener;
TemporaryNamer(Node node, [this._nameListener])
- : scope = _RenameVisitor.build(node).rootScope;
+ : _scope = _RenameVisitor.build(node).rootScope;
@override
String getName(Identifier node) {
- var name = scope.renames[identifierKey(node)] ?? node.name;
+ var name = _scope.renames[identifierKey(node)] ?? node.name;
_nameListener?.nameSelected(node, name);
return name;
}
@override
void enterScope(Node node) {
- scope = scope.childScopes[node];
+ _scope = _scope.childScopes[node];
}
@override
void leaveScope() {
- scope = scope.parent;
+ _scope = _scope.parent;
}
}
diff --git a/pkg/dev_compiler/lib/src/compiler/module_builder.dart b/pkg/dev_compiler/lib/src/compiler/module_builder.dart
index 14685a4..9e89dc5 100644
--- a/pkg/dev_compiler/lib/src/compiler/module_builder.dart
+++ b/pkg/dev_compiler/lib/src/compiler/module_builder.dart
@@ -490,7 +490,7 @@
/// Creates function name given [moduleName].
String loadFunctionName(String moduleName) =>
- 'load__' + pathToJSIdentifier(moduleName.replaceAll('.', '_'));
+ 'load__${pathToJSIdentifier(moduleName.replaceAll('.', '_'))}';
/// Creates function name identifier given [moduleName].
Identifier loadFunctionIdentifier(String moduleName) =>
diff --git a/pkg/dev_compiler/lib/src/compiler/module_containers.dart b/pkg/dev_compiler/lib/src/compiler/module_containers.dart
index a669e71..8e954be 100644
--- a/pkg/dev_compiler/lib/src/compiler/module_containers.dart
+++ b/pkg/dev_compiler/lib/src/compiler/module_containers.dart
@@ -9,7 +9,7 @@
import '../js_ast/js_ast.dart' show js;
/// Defines how to emit a value of a table
-typedef _EmitValue<K> = js_ast.Expression Function(K, ModuleItemData);
+typedef EmitValue<K> = js_ast.Expression Function(K, ModuleItemData);
/// Represents a top-level property hoisted to a top-level object.
class ModuleItemData {
@@ -125,7 +125,7 @@
/// necessary.
///
/// Uses [emitValue] to emit the values in the table.
- List<js_ast.Statement> emit({_EmitValue<K> emitValue});
+ List<js_ast.Statement> emit({EmitValue<K> emitValue});
}
/// Associates a [K] with a container-unique JS key and arbitrary JS value.
@@ -184,7 +184,7 @@
}
@override
- List<js_ast.Statement> emit({_EmitValue<K> emitValue}) {
+ List<js_ast.Statement> emit({EmitValue<K> emitValue}) {
var containersToProperties = <js_ast.Identifier, List<js_ast.Property>>{};
moduleItems.forEach((k, v) {
if (!incrementalMode && _noEmit.contains(k)) return;
@@ -240,7 +240,7 @@
}
@override
- List<js_ast.Statement> emit({_EmitValue<K> emitValue}) {
+ List<js_ast.Statement> emit({EmitValue<K> emitValue}) {
var properties = List<js_ast.Expression>.filled(length, null);
// If the entire array holds just one value, generate a short initializer.
diff --git a/pkg/dev_compiler/lib/src/js_ast/printer.dart b/pkg/dev_compiler/lib/src/js_ast/printer.dart
index ff54cdb..5d81fe5 100644
--- a/pkg/dev_compiler/lib/src/js_ast/printer.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/printer.dart
@@ -4,7 +4,7 @@
// @dart = 2.9
-// ignore_for_file: always_declare_return_types, prefer_single_quotes
+// ignore_for_file: always_declare_return_types, prefer_single_quotes, prefer_interpolation_to_compose_strings
// ignore_for_file: prefer_collection_literals, omit_local_variable_types
// ignore_for_file: prefer_final_fields
// ignore_for_file: prefer_initializing_formals
diff --git a/pkg/dev_compiler/lib/src/kernel/command.dart b/pkg/dev_compiler/lib/src/kernel/command.dart
index 6f81197..bc13226 100644
--- a/pkg/dev_compiler/lib/src/kernel/command.dart
+++ b/pkg/dev_compiler/lib/src/kernel/command.dart
@@ -177,7 +177,7 @@
Uri toCustomUri(Uri uri) {
if (!uri.hasScheme) {
- return Uri(scheme: options.multiRootScheme, path: '/' + uri.path);
+ return Uri(scheme: options.multiRootScheme, path: '/${uri.path}');
}
return uri;
}
@@ -381,7 +381,7 @@
if (identical(compilerState, oldCompilerState)) {
component.unbindCanonicalNames();
}
- var sink = File(p.withoutExtension(outPaths.first) + '.dill').openWrite();
+ var sink = File('${p.withoutExtension(outPaths.first)}.dill').openWrite();
// TODO(jmesserly): this appears to save external libraries.
// Do we need to run them through an outlining step so they can be saved?
kernel.BinaryPrinter(sink).writeComponentFile(component);
@@ -404,7 +404,7 @@
if (identical(compilerState, oldCompilerState)) {
compiledLibraries.unbindCanonicalNames();
}
- fullDillUri = p.withoutExtension(outPaths.first) + '.full.dill';
+ fullDillUri = '${p.withoutExtension(outPaths.first)}.full.dill';
var sink = File(fullDillUri).openWrite();
kernel.BinaryPrinter(sink).writeComponentFile(compiledLibraries);
outFiles.add(sink.flush().then((_) => sink.close()));
@@ -418,8 +418,8 @@
}
var sb = StringBuffer();
kernel.Printer(sb).writeComponentFile(component);
- outFiles.add(File(outPaths.first + '.txt').writeAsString(sb.toString()));
- outFiles.add(File(outPaths.first.split('.')[0] + '.ast.xml')
+ outFiles.add(File('${outPaths.first}.txt').writeAsString(sb.toString()));
+ outFiles.add(File('${outPaths.first.split('.')[0]}.ast.xml')
.writeAsString(DebugPrinter.prettyPrint(compiledLibraries)));
}
@@ -583,7 +583,7 @@
buildSourceMap: options.sourceMap,
inlineSourceMap: options.inlineSourceMap,
jsUrl: p.toUri(output).toString(),
- mapUrl: p.toUri(output + '.map').toString(),
+ mapUrl: p.toUri('$output.map').toString(),
customScheme: options.multiRootScheme,
multiRootOutputPath: options.multiRootOutputPath,
component: component);
@@ -591,7 +591,7 @@
outFiles.add(file.writeAsString(jsCode.code));
if (jsCode.sourceMap != null) {
outFiles.add(
- File(output + '.map').writeAsString(json.encode(jsCode.sourceMap)));
+ File('$output.map').writeAsString(json.encode(jsCode.sourceMap)));
}
}
await Future.wait(outFiles);
diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart
index f0a8fc7..29d4048 100644
--- a/pkg/dev_compiler/lib/src/kernel/compiler.dart
+++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart
@@ -1134,8 +1134,8 @@
var mixinType =
_hierarchy.getClassAsInstanceOf(c, mixinClass).asInterfaceType;
var mixinName =
- getLocalClassName(superclass) + '_' + getLocalClassName(mixinClass);
- var mixinId = _emitTemporaryId(mixinName + '\$');
+ '${getLocalClassName(superclass)}_${getLocalClassName(mixinClass)}';
+ var mixinId = _emitTemporaryId('$mixinName\$');
// Collect all forwarding stub setters from anonymous mixins classes.
// These will contain covariant parameter checks that need to be applied.
var savedClassProperties = _classProperties;
@@ -1246,7 +1246,7 @@
case 'Future':
case 'Stream':
case 'StreamSubscription':
- return runtimeCall('is' + interface.name);
+ return runtimeCall('is${interface.name}');
}
}
return null;
@@ -2635,7 +2635,7 @@
js_ast.PropertyAccess _emitFutureOrNameNoInterop({String suffix = ''}) {
return js_ast.PropertyAccess(emitLibraryName(_coreTypes.asyncLibrary),
- propertyName('FutureOr' + suffix));
+ propertyName('FutureOr$suffix'));
}
/// Emits the member name portion of a top-level member.
@@ -6450,11 +6450,11 @@
// Emit the constant as an integer, if possible.
if (value.isFinite) {
var intValue = value.toInt();
- const _MIN_INT32 = -0x80000000;
- const _MAX_INT32 = 0x7FFFFFFF;
+ const minInt32 = -0x80000000;
+ const maxInt32 = 0x7FFFFFFF;
if (intValue.toDouble() == value &&
- intValue >= _MIN_INT32 &&
- intValue <= _MAX_INT32) {
+ intValue >= minInt32 &&
+ intValue <= maxInt32) {
return js.number(intValue);
}
}
@@ -6474,7 +6474,7 @@
js_ast.Expression visitStringConstant(StringConstant node) =>
js.escapedString(node.value, '"');
- // DDC does not currently use the non-primivite constant nodes; rather these
+ // DDC does not currently use the non-primitive constant nodes; rather these
// are emitted via their normal expression nodes.
@override
js_ast.Expression defaultConstant(Constant node) => _emitInvalidNode(node);
diff --git a/pkg/dev_compiler/test/modular_suite.dart b/pkg/dev_compiler/test/modular_suite.dart
index 77ee34f..0df7a21 100644
--- a/pkg/dev_compiler/test/modular_suite.dart
+++ b/pkg/dev_compiler/test/modular_suite.dart
@@ -266,7 +266,7 @@
''';
var wrapper =
- root.resolveUri(toUri(module, jsId)).toFilePath() + '.wrapper.js';
+ '${root.resolveUri(toUri(module, jsId)).toFilePath()}.wrapper.js';
await File(wrapper).writeAsString(runjs);
var d8Args = ['--module', wrapper];
var result = await _runProcess(
diff --git a/pkg/dev_compiler/test/modular_suite_nnbd.dart b/pkg/dev_compiler/test/modular_suite_nnbd.dart
index 2cba274..4c7c3b0 100644
--- a/pkg/dev_compiler/test/modular_suite_nnbd.dart
+++ b/pkg/dev_compiler/test/modular_suite_nnbd.dart
@@ -270,7 +270,7 @@
''';
var wrapper =
- root.resolveUri(toUri(module, jsId)).toFilePath() + '.wrapper.js';
+ '${root.resolveUri(toUri(module, jsId)).toFilePath()}.wrapper.js';
await File(wrapper).writeAsString(runjs);
var d8Args = ['--module', wrapper];
var result = await _runProcess(
diff --git a/pkg/dev_compiler/web/source_map_stack_trace.dart b/pkg/dev_compiler/web/source_map_stack_trace.dart
index aa9eaa6..cb74f58 100644
--- a/pkg/dev_compiler/web/source_map_stack_trace.dart
+++ b/pkg/dev_compiler/web/source_map_stack_trace.dart
@@ -52,7 +52,7 @@
}
var packageRoot = '$root/packages';
if (p.url.isWithin(packageRoot, sourceUrl)) {
- sourceUrl = 'package:' + p.url.relative(sourceUrl, from: packageRoot);
+ sourceUrl = 'package:${p.url.relative(sourceUrl, from: packageRoot)}';
break;
}
}