Change : to = for default values in pkg.

Leaves some in parser test:
 pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart

TEST=Refactoring, covered by existing tests.

Change-Id: I7a83ef95df3cbd283878b3685b5c747bd89a1b16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256125
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
This commit is contained in:
Lasse R.H. Nielsen 2022-08-24 15:57:16 +00:00 committed by Commit Bot
parent 177147bac3
commit 8a883fa54d
412 changed files with 1953 additions and 1934 deletions

View file

@ -48,7 +48,7 @@ abstract class ErrorCode {
const ErrorCode({
String? correctionMessage,
this.hasPublishedDocs = false,
this.isUnresolvedIdentifier: false,
this.isUnresolvedIdentifier = false,
required this.name,
required String problemMessage,
required this.uniqueName,

View file

@ -1320,7 +1320,7 @@ class FlowAnalysisDebug<Node extends Object, Statement extends Node,
}
T _wrap<T>(String description, T callback(),
{bool isQuery: false, bool? isPure}) {
{bool isQuery = false, bool? isPure}) {
isPure ??= isQuery;
print(description);
T result;

View file

@ -31,7 +31,7 @@ class Code<T> {
final Severity severity;
const Code(this.name,
{this.index: -1, this.analyzerCodes, this.severity: Severity.error});
{this.index = -1, this.analyzerCodes, this.severity = Severity.error});
String toString() => name;
}

View file

@ -305,14 +305,14 @@ abstract class IdentifierContext {
final Template<_MessageWithArgument<Token>> recoveryTemplate;
const IdentifierContext(this._name,
{this.inDeclaration: false,
this.inLibraryOrPartOfDeclaration: false,
this.inSymbol: false,
this.isContinuation: false,
this.isScopeReference: false,
this.isBuiltInIdentifierAllowed: true,
{this.inDeclaration = false,
this.inLibraryOrPartOfDeclaration = false,
this.inSymbol = false,
this.isContinuation = false,
this.isScopeReference = false,
this.isBuiltInIdentifierAllowed = true,
bool? allowedInConstantExpression,
this.recoveryTemplate: templateExpectedIdentifier})
this.recoveryTemplate = templateExpectedIdentifier})
: this.allowedInConstantExpression =
// Generally, declarations are legal in constant expressions. A
// continuation doesn't affect constant expressions: if what it's

View file

@ -58,7 +58,7 @@ class ErrorCollectingListener extends Listener {
}
List<ParserError> parse(Token tokens,
{bool useImplicitCreationExpression: true}) {
{bool useImplicitCreationExpression = true}) {
ErrorCollectingListener listener = new ErrorCollectingListener();
Parser parser = new Parser(listener,
useImplicitCreationExpression: useImplicitCreationExpression);

View file

@ -317,7 +317,7 @@ class Parser {
// implicit create expression without the special casing.
final bool useImplicitCreationExpression;
Parser(this.listener, {this.useImplicitCreationExpression: true})
Parser(this.listener, {this.useImplicitCreationExpression = true})
: assert(listener != null); // ignore:unnecessary_null_comparison
bool get inGenerator {

View file

@ -523,7 +523,7 @@ abstract class StackListener extends Listener {
}
void addProblem(Message message, int charOffset, int length,
{bool wasHandled: false, List<LocatedMessage> context});
{bool wasHandled = false, List<LocatedMessage> context});
}
abstract class Stack {

View file

@ -23,7 +23,7 @@ List<int> readBytesFromFileSync(Uri uri) {
}
Future<List<int>> readBytesFromFile(Uri uri,
{bool ensureZeroTermination: true}) async {
{bool ensureZeroTermination = true}) async {
RandomAccessFile file = await new File.fromUri(uri).open();
Uint8List list;
try {

View file

@ -68,7 +68,7 @@ class ScannerResult {
/// Scan/tokenize the given UTF8 [bytes].
ScannerResult scan(List<int> bytes,
{ScannerConfiguration? configuration,
bool includeComments: false,
bool includeComments = false,
LanguageVersionChanged? languageVersionChanged}) {
if (bytes.last != 0) {
throw new ArgumentError("[bytes]: the last byte must be 0.");
@ -83,7 +83,7 @@ ScannerResult scan(List<int> bytes,
/// Scan/tokenize the given [source].
ScannerResult scanString(String source,
{ScannerConfiguration? configuration,
bool includeComments: false,
bool includeComments = false,
LanguageVersionChanged? languageVersionChanged}) {
// ignore: unnecessary_null_comparison
assert(source != null, 'source must not be null');

View file

@ -8,7 +8,8 @@ import 'io.dart' show readBytesFromFileSync;
import 'scanner.dart' show ErrorToken, Token, scan;
scanAll(Map<Uri, List<int>> files, {bool verbose: false, bool verify: false}) {
scanAll(Map<Uri, List<int>> files,
{bool verbose = false, bool verify = false}) {
Stopwatch sw = new Stopwatch()..start();
int byteCount = 0;
files.forEach((Uri uri, List<int> bytes) {

View file

@ -39,7 +39,7 @@ class StringScanner extends AbstractScanner {
StringScanner(String string,
{ScannerConfiguration? configuration,
bool includeComments: false,
bool includeComments = false,
LanguageVersionChanged? languageVersionChanged})
: string = ensureZeroTermination(string),
super(configuration, includeComments, languageVersionChanged);

View file

@ -415,9 +415,9 @@ class Keyword extends TokenType {
* Initialize a newly created keyword.
*/
const Keyword(int index, String lexeme, String name, this.keywordStyle,
{bool isModifier: false,
bool isTopLevelKeyword: false,
int precedence: NO_PRECEDENCE})
{bool isModifier = false,
bool isTopLevelKeyword = false,
int precedence = NO_PRECEDENCE})
: super(index, lexeme, name, precedence, KEYWORD_TOKEN,
isModifier: isModifier, isTopLevelKeyword: isTopLevelKeyword);
@ -1684,12 +1684,12 @@ class TokenType {
const TokenType(
this.index, this.lexeme, this.name, this.precedence, this.kind,
{this.binaryOperatorOfCompoundAssignment,
this.isBinaryOperator: false,
this.isModifier: false,
this.isOperator: false,
this.isTopLevelKeyword: false,
this.isUserDefinableOperator: false,
String? stringValue: 'unspecified'})
this.isBinaryOperator = false,
this.isModifier = false,
this.isOperator = false,
this.isTopLevelKeyword = false,
this.isUserDefinableOperator = false,
String? stringValue = 'unspecified'})
: this.stringValue = stringValue == 'unspecified' ? lexeme : stringValue;
/**

View file

@ -40,7 +40,7 @@ class StringTokenImpl extends SimpleToken implements StringToken {
* is canonicalized before the token is created.
*/
StringTokenImpl.fromString(TokenType type, String value, int charOffset,
{bool canonicalize: false, CommentToken? precedingComments})
{bool canonicalize = false, CommentToken? precedingComments})
: valueOrLazySubstring =
canonicalize ? canonicalizedString(value) : value,
super(type, charOffset, precedingComments);
@ -51,7 +51,7 @@ class StringTokenImpl extends SimpleToken implements StringToken {
*/
StringTokenImpl.fromSubstring(
TokenType type, String data, int start, int end, int charOffset,
{bool canonicalize: false, CommentToken? precedingComments})
{bool canonicalize = false, CommentToken? precedingComments})
: super(type, charOffset, precedingComments) {
int length = end - start;
if (length <= LAZY_THRESHOLD) {
@ -166,7 +166,7 @@ class LanguageVersionTokenImpl extends CommentTokenImpl
LanguageVersionTokenImpl.fromSubstring(
String string, int start, int end, int tokenStart, this.major, this.minor,
{bool canonicalize: false})
{bool canonicalize = false})
: super.fromSubstring(
TokenType.SINGLE_LINE_COMMENT, string, start, end, tokenStart,
canonicalize: canonicalize);

View file

@ -89,7 +89,7 @@ class Utf8BytesScanner extends AbstractScanner {
*/
Utf8BytesScanner(this.bytes,
{ScannerConfiguration? configuration,
bool includeComments: false,
bool includeComments = false,
LanguageVersionChanged? languageVersionChanged})
: super(configuration, includeComments, languageVersionChanged,
numberOfBytesHint: bytes.length) {

View file

@ -30,7 +30,7 @@ class Features {
/// Mark the feature [key] as existing. If [value] is provided, the feature
/// [key] is set to have this value.
void add(String key, {var value: ''}) {
void add(String key, {var value = ''}) {
_features[key] = value.toString();
}

View file

@ -125,8 +125,8 @@ class IdValue {
static const String errorPrefix = "error: ";
static IdValue decode(Uri sourceUri, Annotation annotation, String text,
{bool preserveWhitespaceInAnnotations: false,
bool preserveInfixWhitespace: false}) {
{bool preserveWhitespaceInAnnotations = false,
bool preserveInfixWhitespace = false}) {
int offset = annotation.offset;
Id id;
String expected;
@ -203,7 +203,7 @@ class MemberId implements Id {
@override
final bool isGlobal;
factory MemberId(String text, {bool isGlobal: false}) {
factory MemberId(String text, {bool isGlobal = false}) {
int dotPos = text.indexOf('.');
if (dotPos != -1) {
return new MemberId.internal(text.substring(dotPos + 1),
@ -213,7 +213,7 @@ class MemberId implements Id {
}
}
MemberId.internal(this.memberName, {this.className, this.isGlobal: false});
MemberId.internal(this.memberName, {this.className, this.isGlobal = false});
@override
int get hashCode => className.hashCode * 13 + memberName.hashCode * 17;
@ -243,7 +243,7 @@ class ClassId implements Id {
@override
final bool isGlobal;
ClassId(this.className, {this.isGlobal: false});
ClassId(this.className, {this.isGlobal = false});
@override
int get hashCode => className.hashCode * 13;

View file

@ -13,7 +13,7 @@ Map<Uri, List<Annotation>> computeAnnotationsPerUri<T>(
Map<String, Map<Uri, Map<Id, ActualData<T>>>> actualData,
DataInterpreter<T> dataInterpreter,
{Annotation? Function(Annotation? expected, Annotation? actual)? createDiff,
bool forceUpdate: false}) {
bool forceUpdate = false}) {
Set<Uri> uriSet = {};
Set<String> actualMarkers = actualData.keys.toSet();
Map<Uri, Map<Id, Map<String, IdValue>>> idValuePerUri = {};
@ -69,8 +69,8 @@ Map<Uri, List<Annotation>> computeAnnotationsPerUri<T>(
if (code != null) {
// Annotations are not computed from synthesized code.
result[uri] = _computeAnnotations(code, expectedMaps.keys, actualMarkers,
idValuePerId, actualDataPerId, dataInterpreter,
sortMarkers: false, createDiff: createDiff, forceUpdate: forceUpdate);
idValuePerId, actualDataPerId, dataInterpreter,
sortMarkers: false, createDiff: createDiff, forceUpdate: forceUpdate);
}
}
return result;
@ -83,11 +83,11 @@ List<Annotation> _computeAnnotations<T>(
Map<Id, Map<String, IdValue>> idValuePerId,
Map<Id, Map<String, ActualData<T>>> actualDataPerId,
DataInterpreter<T> dataInterpreter,
{String defaultPrefix: '/*',
String defaultSuffix: '*/',
bool sortMarkers: true,
{String defaultPrefix = '/*',
String defaultSuffix = '*/',
bool sortMarkers = true,
Annotation? Function(Annotation? expected, Annotation? actual)? createDiff,
bool forceUpdate: false}) {
bool forceUpdate = false}) {
// ignore: unnecessary_null_comparison
assert(annotatedCode != null);
@ -156,7 +156,9 @@ List<Annotation> _computeAnnotations<T>(
suffix);
}
Set<Id> idSet = {}..addAll(idValuePerId.keys)..addAll(actualDataPerId.keys);
Set<Id> idSet = {}
..addAll(idValuePerId.keys)
..addAll(actualDataPerId.keys);
List<Annotation> result = <Annotation>[];
for (Id id in idSet) {
Map<String, IdValue> idValuePerMarker = idValuePerId[id] ?? {};

View file

@ -218,8 +218,8 @@ class MemberAnnotations<DataType> {
void computeExpectedMap(Uri sourceUri, String filename, AnnotatedCode code,
Map<String, MemberAnnotations<IdValue>> maps,
{required void onFailure(String message),
bool preserveWhitespaceInAnnotations: false,
bool preserveInfixWhitespaceInAnnotations: false}) {
bool preserveWhitespaceInAnnotations = false,
bool preserveInfixWhitespaceInAnnotations = false}) {
List<String> mapKeys = maps.keys.toList();
Map<String, AnnotatedCode> split = splitByPrefixes(code, mapKeys);
@ -263,8 +263,8 @@ TestData computeTestData(FileSystemEntity testFile,
{required Iterable<String> supportedMarkers,
required Uri createTestUri(Uri uri, String fileName),
required void onFailure(String message),
bool preserveWhitespaceInAnnotations: false,
bool preserveInfixWhitespaceInAnnotations: false}) {
bool preserveWhitespaceInAnnotations = false,
bool preserveInfixWhitespaceInAnnotations = false}) {
Uri? entryPoint;
String testName;
@ -406,7 +406,7 @@ abstract class CompiledData<T> {
Map<int, List<String>> computeDiffAnnotationsAgainst(
Map<Id, ActualData<T>> thisMap, Map<Id, ActualData<T>> otherMap, Uri uri,
{bool includeMatches: false}) {
{bool includeMatches = false}) {
Map<int, List<String>> annotations = <int, List<String>>{};
thisMap.forEach((Id id, ActualData<T> thisData) {
ActualData<T>? otherData = otherMap[id];
@ -436,7 +436,8 @@ abstract class CompiledData<T> {
int getOffsetFromId(Id id, Uri uri);
void reportError(Uri uri, int offset, String message, {bool succinct: false});
void reportError(Uri uri, int offset, String message,
{bool succinct = false});
}
/// Interface used for interpreting annotations.
@ -513,8 +514,8 @@ Future<TestResult<T>> checkCode<T>(
CompiledData<T> compiledData,
DataInterpreter<T> dataInterpreter,
{bool filterActualData(IdValue? expected, ActualData<T> actualData)?,
bool fatalErrors: true,
bool succinct: false,
bool fatalErrors = true,
bool succinct = false,
required void onFailure(String message)}) async {
String testName = testData.name;
Map<Uri, AnnotatedCode> code = testData.code;
@ -703,7 +704,7 @@ class MarkerOptions {
MarkerOptions.internal(this.markers);
factory MarkerOptions.fromDataDir(Directory dataDir,
{bool shouldFindScript: true}) {
{bool shouldFindScript = true}) {
File file = new File.fromUri(dataDir.uri.resolve('marker.options'));
File script = new File.fromUri(Platform.script);
if (!file.existsSync()) {
@ -810,17 +811,17 @@ const List<Option> idTestOptions = [
/// Check code for all tests in [dataDir] using [runTest].
Future<void> runTests<T>(Directory dataDir,
{List<String> args: const <String>[],
int shards: 1,
int shardIndex: 0,
{List<String> args = const <String>[],
int shards = 1,
int shardIndex = 0,
void onTest(Uri uri)?,
required Uri createUriForFileName(String fileName),
required void onFailure(String message),
required RunTestFunction<T> runTest,
List<String>? skipList,
Map<String, List<String>>? skipMap,
bool preserveWhitespaceInAnnotations: false,
bool preserveInfixWhitespaceInAnnotations: false}) async {
bool preserveWhitespaceInAnnotations = false,
bool preserveInfixWhitespaceInAnnotations = false}) async {
ParsedOptions parsedOptions = ParsedOptions.parse(args, idTestOptions);
MarkerOptions markerOptions =
new MarkerOptions.fromDataDir(dataDir, shouldFindScript: shards == 1);

View file

@ -96,7 +96,7 @@ class AssignedVariables<Node extends Object, Variable extends Object> {
///
/// See [beginNode] for more details.
AssignedVariablesNodeInfo deferNode(
{bool isClosureOrLateVariableInitializer: false}) {
{bool isClosureOrLateVariableInitializer = false}) {
assert(!_isFinished);
AssignedVariablesNodeInfo info = _stack.removeLast();
info.read.removeAll(info.declared);
@ -153,7 +153,7 @@ class AssignedVariables<Node extends Object, Variable extends Object> {
/// to [storeInfo].
///
/// See [beginNode] for more details.
void endNode(Node node, {bool isClosureOrLateVariableInitializer: false}) {
void endNode(Node node, {bool isClosureOrLateVariableInitializer = false}) {
assert(!_isFinished);
storeInfo(
node,

View file

@ -378,7 +378,7 @@ class LibraryInfo {
final bool isSupported;
const LibraryInfo(this.name, this.uri, this.patches,
{this.isSupported: true});
{this.isSupported = true});
/// The import uri for the defined library.
Uri get importUri => Uri.parse('dart:${name}');

View file

@ -21,7 +21,7 @@ class Link<T> implements Iterable<T> {
void printOn(StringBuffer buffer, [separatedBy]) {}
List<T> toList({bool growable: true}) {
List<T> toList({bool growable = true}) {
List<T> result = <T>[];
for (Link<T> link = this; !link.isEmpty; link = link.tail!) {
result.add(link.head);
@ -37,7 +37,7 @@ class Link<T> implements Iterable<T> {
/// Invokes `fn` for every item in the linked list and returns the results
/// in a [List].
/// TODO(scheglov) Rewrite to `List<E>`, or remove.
List<E?> mapToList<E>(E fn(T item), {bool growable: true}) {
List<E?> mapToList<E>(E fn(T item), {bool growable = true}) {
List<E?> result;
if (!growable) {
result = new List<E?>.filled(slowLength(), null);

View file

@ -303,7 +303,7 @@ class Option<T> {
final List<String> aliases;
const Option(this.flag, this.spec,
{this.isDefines: false, this.aliases: const []});
{this.isDefines = false, this.aliases = const []});
T read(ParsedOptions parsedOptions) =>
(isDefines ? parsedOptions.defines : parsedOptions.options[flag]) as T;

View file

@ -466,10 +466,10 @@ some more code
void testString(
String text, {
Map<String, Map<Id, String>> actualData: const {},
Map<String, Map<Id, String>> actualData = const {},
String? expectedResult,
int classOffset: 0,
int memberOffset: 0,
int classOffset = 0,
int memberOffset = 0,
}) {
testGeneral(const StringDataInterpreter(), text,
actualData: actualData,
@ -486,10 +486,10 @@ void testString(
void testFeatures(
String text, {
Map<String, Map<Id, String>> actualData: const {},
Map<String, Map<Id, String>> actualData = const {},
String? expectedResult,
int classOffset: 0,
int memberOffset: 0,
int classOffset = 0,
int memberOffset = 0,
}) {
Map<String, Map<Id, Features>> actualFeatures = {};
actualData.forEach((String marker, Map<Id, String> data) {
@ -506,10 +506,10 @@ void testFeatures(
}
void testGeneral<T>(DataInterpreter<T> dataInterpreter, String text,
{Map<String, Map<Id, T>> actualData: const {},
{Map<String, Map<Id, T>> actualData = const {},
String? expectedResult,
int classOffset: 0,
int memberOffset: 0}) {
int classOffset = 0,
int memberOffset = 0}) {
expectedResult ??= text;
AnnotatedCode code =
new AnnotatedCode.fromText(text, commentStart, commentEnd);

View file

@ -46,10 +46,10 @@ class LegacyClass extends Class implements Interface {
/*member: LegacyClass.method7b:int* Function({int* a, int* b})**/
/*member: LegacyClass.method8a:int* Function(int*, {int* b})**/
int method8a(int a, {int b: 0}) => 0;
int method8a(int a, {int b = 0}) => 0;
/*member: LegacyClass.method8b:int* Function({int* a, int* b})**/
int method8b({int a, int b: 0}) => 0;
int method8b({int a, int b = 0}) => 0;
/*member: LegacyClass.method9a:int* Function(int*, {int* b})**/
/*member: LegacyClass.method9b:int* Function({int* a, int* b})**/

View file

@ -40,13 +40,13 @@ abstract class Interface {
int method7a(int a, {int? b});
/*member: Interface.method7b:int Function({int a, int? b})*/
int method7b({int a: 0, int? b});
int method7b({int a = 0, int? b});
/*member: Interface.method8a:int? Function(int?, {int b})*/
int? method8a(int? a, {int b: 0});
int? method8a(int? a, {int b = 0});
/*member: Interface.method8b:int? Function({int? a, int b})*/
int? method8b({int? a, int b: 0});
int? method8b({int? a, int b = 0});
/*member: Interface.method9a:int Function(int, {required int? b})*/
int method9a(int a, {required int? b});
@ -170,7 +170,7 @@ class Class {
int method7a(int a, {int? b}) => 0;
/*member: Class.method7b:int Function({int a, int? b})*/
int method7b({int a: 0, int? b}) => 0;
int method7b({int a = 0, int? b}) => 0;
/*member: Class.method9a:int Function(int, {required int? b})*/
int method9a(int a, {required int? b}) => 0;

View file

@ -34,10 +34,10 @@ abstract class Interface {
int? method4c([int? a, int? b]);
/*member: Interface.method5a:int Function(int, {int b})*/
int method5a(int a, {int b: 0});
int method5a(int a, {int b = 0});
/*member: Interface.method5b:int Function({int a, int b})*/
int method5b({int a: 0, int b: 0});
int method5b({int a = 0, int b = 0});
/*member: Interface.method6a:int? Function(int?, {int? b})*/
int? method6a(int? a, {int? b});
@ -266,10 +266,10 @@ class Class2b extends LegacyClass implements Interface {
int? method4c([int? a, int? b]) => 0;
/*member: Class2b.method5a:int Function(int, {int b})*/
int method5a(int a, {int b: 0}) => 0;
int method5a(int a, {int b = 0}) => 0;
/*member: Class2b.method5b:int Function({int a, int b})*/
int method5b({int a: 0, int b: 0}) => 0;
int method5b({int a = 0, int b = 0}) => 0;
/*member: Class2b.method6a:int? Function(int?, {int? b})*/
int? method6a(int? a, {int? b}) => 0;

View file

@ -7,18 +7,20 @@ import 'package:_fe_analyzer_shared/src/macros/api.dart';
const Map<String, ClassData> expectedClassData = {
'Class1': ClassData(fieldsOf: ['field1'], constructorsOf: ['']),
'Class2': ClassData(isAbstract: true, superclass: 'Object'),
'Class3':
ClassData(superclass: 'Class2', superSuperclass: 'Object', interfaces: [
'Interface1'
],
// TODO(johnniwinther): Should we require a specific order?
fieldsOf: [
'Class3': ClassData(
superclass: 'Class2',
superSuperclass: 'Object',
interfaces: [
'Interface1'
],
// TODO(johnniwinther): Should we require a specific order?
fieldsOf: [
'field1',
'field2',
'staticField1',
],
// TODO(johnniwinther): Should we require a specific order?
methodsOf: [
// TODO(johnniwinther): Should we require a specific order?
methodsOf: [
'method1',
'method2',
'getter1',
@ -27,8 +29,8 @@ const Map<String, ClassData> expectedClassData = {
'setter1',
'property1',
],
// TODO(johnniwinther): Should we require a specific order?
constructorsOf: [
// TODO(johnniwinther): Should we require a specific order?
constructorsOf: [
// TODO(johnniwinther): Should we normalize no-name constructor names?
'',
'named',
@ -230,7 +232,7 @@ Future<void> checkIdentifierResolver(
Uri dartCore = Uri.parse('dart:core');
Uri macroApiData = Uri.parse('package:macro_api_test/api_test_data.dart');
Future<void> check(Uri uri, String name, {bool expectThrows: false}) async {
Future<void> check(Uri uri, String name, {bool expectThrows = false}) async {
if (expectThrows) {
await throws(() async {
await identifierResolver.resolveIdentifier(uri, name);
@ -260,7 +262,7 @@ Future<void> checkTypeDeclarationResolver(
TypeDeclarationResolver typeDeclarationResolver,
Map<Identifier, String?> test) async {
Future<void> check(Identifier identifier, String name,
{bool expectThrows: false}) async {
{bool expectThrows = false}) async {
if (expectThrows) {
await throws(() async {
await typeDeclarationResolver.declarationOf(identifier);
@ -293,15 +295,15 @@ class ClassData {
final List<String> constructorsOf;
const ClassData(
{this.isAbstract: false,
this.isExternal: false,
{this.isAbstract = false,
this.isExternal = false,
this.superclass,
this.superSuperclass,
this.interfaces: const [],
this.mixins: const [],
this.fieldsOf: const [],
this.methodsOf: const [],
this.constructorsOf: const []});
this.interfaces = const [],
this.mixins = const [],
this.fieldsOf = const [],
this.methodsOf = const [],
this.constructorsOf = const []});
}
class FunctionData {
@ -315,27 +317,27 @@ class FunctionData {
final List<ParameterData> namedParameters;
const FunctionData(
{this.isAbstract: false,
this.isExternal: false,
this.isOperator: false,
this.isGetter: false,
this.isSetter: false,
{this.isAbstract = false,
this.isExternal = false,
this.isOperator = false,
this.isGetter = false,
this.isSetter = false,
required this.returnType,
this.positionalParameters: const [],
this.namedParameters: const []});
this.positionalParameters = const [],
this.namedParameters = const []});
}
class TypeData {
final bool isNullable;
const TypeData({this.isNullable: false});
const TypeData({this.isNullable = false});
}
class NamedTypeData extends TypeData {
final String? name;
final List<TypeData>? typeArguments;
const NamedTypeData({bool isNullable: false, this.name, this.typeArguments})
const NamedTypeData({bool isNullable = false, this.name, this.typeArguments})
: super(isNullable: isNullable);
}
@ -346,5 +348,5 @@ class ParameterData {
final bool isNamed;
const ParameterData(this.name,
{required this.type, this.isNamed: false, this.isRequired: false});
{required this.type, this.isNamed = false, this.isRequired = false});
}

View file

@ -24,7 +24,7 @@ main(List<String> args) async {
}
Future<void> run(String script, List<String> scriptArguments,
{bool filter: true}) async {
{bool filter = true}) async {
List<String> arguments = [];
arguments.add("$script");
arguments.addAll(scriptArguments);

View file

@ -2461,7 +2461,7 @@ class LocalState {
}
LocalState mergeFlow(InferrerEngine inferrer, LocalState other,
{bool ignoreAborts: false}) {
{bool ignoreAborts = false}) {
seenReturnOrThrow = false;
seenBreakOrContinue = false;

View file

@ -36,7 +36,7 @@ class AnnotationDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
MemberDefinition definition = elementMap.getMemberDefinition(member);

View file

@ -34,7 +34,7 @@ class ClosureDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
GlobalLocalsMap localsMap =
@ -78,7 +78,7 @@ class ClosureIrChecker extends IrDataExtractor<String> {
this._localsMap,
this.closureDataLookup,
this._closedWorld,
{this.verbose: false})
{this.verbose = false})
: super(reporter, actualMap) {
pushMember(member);
}

View file

@ -72,7 +72,7 @@ class CodegenDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
MemberDefinition definition = elementMap.getMemberDefinition(member);

View file

@ -67,10 +67,10 @@ runTest() async {
}
void test(String name,
{bool expectNoInline: false,
AbstractValue expectedParameterType: null,
AbstractValue expectedReturnType: null,
bool expectAssumeDynamic: false}) {
{bool expectNoInline = false,
AbstractValue expectedParameterType = null,
AbstractValue expectedReturnType = null,
bool expectAssumeDynamic = false}) {
LibraryEntity mainApp = closedWorld.elementEnvironment.mainLibrary;
FunctionEntity method =
closedWorld.elementEnvironment.lookupLibraryMember(mainApp, name);

View file

@ -42,7 +42,7 @@ int test(Foo foo) {
}
""";
Future check(String test, {String entry: 'test'}) {
Future check(String test, {String entry = 'test'}) {
return compile(test,
entry: entry,
methodName: 'test',

View file

@ -29,7 +29,7 @@ class Class {
/*member: Class.state2:elided*/
final Enum state2;
Class({this.state1: 1, this.state2: Enum.c});
Class({this.state1 = 1, this.state2 = Enum.c});
/*member: Class.method1a:calls=[tester2(0)],params=0*/
@pragma('dart2js:noInline')

View file

@ -39,7 +39,7 @@ class ModelDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
MemberDefinition definition = elementMap.getMemberDefinition(member);

View file

@ -48,7 +48,7 @@ runTest() async {
Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation');
void test(String name,
{bool expectNoInline: false, bool expectTryInline: false}) {
{bool expectNoInline = false, bool expectTryInline = false}) {
LibraryEntity mainApp = closedWorld.elementEnvironment.mainLibrary;
FunctionEntity method =
closedWorld.elementEnvironment.lookupLibraryMember(mainApp, name);

View file

@ -13,7 +13,7 @@ import 'package:compiler/src/js_backend/string_reference.dart'
import 'package:compiler/src/js/js.dart' show prettyPrint;
import 'package:js_ast/js_ast.dart' as js;
void test(List<String> strings, String expected, {bool minified: false}) {
void test(List<String> strings, String expected, {bool minified = false}) {
var finalizer =
StringReferenceFinalizerImpl(minified, shortestSharedLength: 5);

View file

@ -13,6 +13,6 @@ typedef dynamic G<T>(T v);
constants=[InstantiationConstant([int*],FunctionConstant(getFoo))=1{b}],
member_unit=1{b}
*/
m(int x, {G<int> f: getFoo}) {
m(int x, {G<int> f = getFoo}) {
print(f(x));
}

View file

@ -13,6 +13,6 @@ typedef dynamic G<T>(T v);
constants=[InstantiationConstant([int*],FunctionConstant(getFoo))=1{b}],
member_unit=1{b}
*/
m(int x, {G<int> f: getFoo}) {
m(int x, {G<int> f = getFoo}) {
print(f(x));
}

View file

@ -13,6 +13,6 @@ typedef dynamic G<T, S>(T v, S w);
constants=[InstantiationConstant([int*, int*],FunctionConstant(getFoo))=3{c}],
member_unit=3{c}
*/
m(int x, int y, {G<int, int> f: getFoo}) {
m(int x, int y, {G<int, int> f = getFoo}) {
print(f(x, y));
}

View file

@ -13,6 +13,6 @@ typedef dynamic G<T>(T v);
constants=[InstantiationConstant([int*],FunctionConstant(getFoo))=1{b}],
member_unit=1{b}
*/
m(int x, {G<int> f: getFoo}) {
m(int x, {G<int> f = getFoo}) {
print(f(x));
}

View file

@ -13,6 +13,6 @@ typedef dynamic G<T>(T v);
constants=[InstantiationConstant([int*],FunctionConstant(getFoo))=3{c}],
member_unit=3{c}
*/
m(int x, {G<int> f: getFoo}) {
m(int x, {G<int> f = getFoo}) {
print(f(x));
}

View file

@ -104,7 +104,7 @@ class OutputUnitDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
MemberDefinition definition = elementMap.getMemberDefinition(member);
@ -116,7 +116,7 @@ class OutputUnitDataComputer extends DataComputer<Features> {
@override
void computeClassData(Compiler compiler, ClassEntity cls,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
ClassDefinition definition = elementMap.getClassDefinition(cls);

View file

@ -161,7 +161,7 @@ class DumpInfoDataComputer extends DataComputer<Features> {
@override
void computeClassData(Compiler compiler, ClassEntity cls,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
final converter = info.AllInfoToJsonConverter(isBackwardCompatible: true);
DumpInfoStateData dumpInfoState = compiler.dumpInfoStateForTesting;
TreeShakingInfoVisitor().filter(dumpInfoState.info);
@ -194,7 +194,7 @@ class DumpInfoDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
final converter = info.AllInfoToJsonConverter(isBackwardCompatible: true);
DumpInfoStateData dumpInfoState = compiler.dumpInfoStateForTesting;
TreeShakingInfoVisitor().filter(dumpInfoState.info);

View file

@ -115,7 +115,7 @@ class DumpInfoDataComputer extends DataComputer<Features> {
@override
void computeClassData(Compiler compiler, ClassEntity cls,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
final converter = info.AllInfoToJsonConverter(isBackwardCompatible: true);
DumpInfoStateData dumpInfoState = compiler.dumpInfoStateForTesting;
@ -147,7 +147,7 @@ class DumpInfoDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
final converter = info.AllInfoToJsonConverter(isBackwardCompatible: true);
DumpInfoStateData dumpInfoState = compiler.dumpInfoStateForTesting;

View file

@ -113,7 +113,7 @@ class DumpInfoDataComputer extends DataComputer<Features> {
@override
void computeClassData(Compiler compiler, ClassEntity cls,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
final converter = info.AllInfoToJsonConverter(isBackwardCompatible: true);
DumpInfoStateData dumpInfoState = compiler.dumpInfoStateForTesting;
@ -145,7 +145,7 @@ class DumpInfoDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
final converter = info.AllInfoToJsonConverter(isBackwardCompatible: true);
DumpInfoStateData dumpInfoState = compiler.dumpInfoStateForTesting;

View file

@ -135,7 +135,7 @@ main() {
});
}
runTests({bool useBinary: false}) async {
runTests({bool useBinary = false}) async {
await infoTest(TEST_BASIC, useBinary, (info) {
Expect.isTrue(info.functions.isNotEmpty);
Expect.isTrue(info.libraries.isNotEmpty);

View file

@ -212,7 +212,7 @@ void main() {
entry.enableWriteString = false;
Map<String, int> _expectedExitCode(
{bool beforeRun: false, bool fatalWarnings: false}) {
{bool beforeRun = false, bool fatalWarnings = false}) {
if (beforeRun) {
return {
'': 0,

View file

@ -25,7 +25,7 @@ List<String> dart2JsCommand(List<String> args) {
return command;
}
Future<ProcessResult> launchDart2Js(args, {bool noStdoutEncoding: false}) {
Future<ProcessResult> launchDart2Js(args, {bool noStdoutEncoding = false}) {
if (noStdoutEncoding) {
return Process.run(Platform.executable, dart2JsCommand(args),
stdoutEncoding: null);

View file

@ -70,7 +70,7 @@ main() {
/// Generate a component for a modular complation unit.
Future<List<int>> compileUnit(List<String> inputs, Map<String, dynamic> sources,
{List<String> deps: const []}) async {
{List<String> deps = const []}) async {
var fs = MemoryFileSystem(_defaultDir);
sources.forEach((name, data) {
var entity = fs.entityForUri(toTestUri(name));

View file

@ -45,7 +45,7 @@ class TestRandomAccessFileOutputProvider implements api.CompilerOutput {
CompileFunc oldCompileFunc;
Future<Null> test(List<String> arguments, List<String> expectedOutput,
{List<String> groupOutputs: const <String>[]}) async {
{List<String> groupOutputs = const <String>[]}) async {
List<String> options = new List<String>.from(arguments)
..add('--platform-binaries=$sdkPlatformBinariesPath')
..add('--libraries-spec=$sdkLibrariesSpecificationUri');

View file

@ -46,7 +46,7 @@ main() {
}
void test(String title, RunResult result,
{List expectedLines: const [], List expectedExceptions: const []}) {
{List expectedLines = const [], List expectedExceptions = const []}) {
print('--------------------------------------------------------------------');
print('Running $title');
print('--------------------------------------------------------------------');
@ -66,7 +66,7 @@ void test(String title, RunResult result,
}
Future<RunResult> run(
{Map<String, String> memorySourceFiles: const {'main.dart': 'main() {}'},
{Map<String, String> memorySourceFiles = const {'main.dart': 'main() {}'},
api.CompilerDiagnostics diagnostics}) async {
RunResult result = new RunResult();
await runZoned(() async {

View file

@ -120,7 +120,7 @@ bool checkListEquivalence<T>(
/// but not in [set1] are returned.
Set<E> computeSetDifference<E>(
Iterable<E> set1, Iterable<E> set2, List<List<E>> common, List<E> unfound,
{bool sameElement(E a, E b): equality, void checkElements(E a, E b)}) {
{bool sameElement(E a, E b) = equality, void checkElements(E a, E b)}) {
// TODO(johnniwinther): Avoid the quadratic cost here. Some ideas:
// - convert each set to a list and sort it first, then compare by walking
// both lists in parallel
@ -185,7 +185,7 @@ bool checkMapEquivalence<K, V>(
Map<K, V> map2,
bool sameKey(K a, K b),
bool sameValue(V a, V b),
{bool allowExtra: false}) {
{bool allowExtra = false}) {
var common = <List<K>>[];
var unfound = <K>[];
var extra = computeSetDifference(map1.keys, map2.keys, common, unfound,
@ -207,12 +207,12 @@ bool checkMapEquivalence<K, V>(
void checkLists<T>(List<T> list1, List<T> list2, String messagePrefix,
bool sameElement(T a, T b),
{bool verbose: false,
{bool verbose = false,
void onSameElement(T a, T b),
void onDifferentElements(T a, T b),
void onUnfoundElement(T a),
void onExtraElement(T b),
String elementToString(key): defaultToString}) {
String elementToString(key) = defaultToString}) {
List<List> common = <List>[];
List mismatch = [];
List unfound = [];
@ -281,15 +281,15 @@ void checkLists<T>(List<T> list1, List<T> list2, String messagePrefix,
void checkSets<E>(Iterable<E> set1, Iterable<E> set2, String messagePrefix,
bool sameElement(E a, E b),
{bool failOnUnfound: true,
bool failOnExtra: true,
bool verbose: false,
{bool failOnUnfound = true,
bool failOnExtra = true,
bool verbose = false,
void onSameElement(E a, E b),
void onUnfoundElement(E a),
void onExtraElement(E b),
bool elementFilter(E element),
elementConverter(E element),
String elementToString(E key): defaultToString}) {
String elementToString(E key) = defaultToString}) {
if (elementFilter != null) {
set1 = set1.where(elementFilter);
set2 = set2.where(elementFilter);
@ -342,12 +342,12 @@ String defaultToString(obj) => '$obj';
void checkMaps<K, V>(Map<K, V> map1, Map<K, V> map2, String messagePrefix,
bool sameKey(K a, K b), bool sameValue(V a, V b),
{bool failOnUnfound: true,
bool failOnMismatch: true,
{bool failOnUnfound = true,
bool failOnMismatch = true,
bool keyFilter(K key),
bool verbose: false,
String keyToString(K key): defaultToString,
String valueToString(V key): defaultToString}) {
bool verbose = false,
String keyToString(K key) = defaultToString,
String valueToString(V key) = defaultToString}) {
var common = <List<K>>[];
var unfound = <K>[];
var mismatch = <List<K>>[];

View file

@ -124,14 +124,14 @@ void reportError(
/// Actual data is computed using [computeMemberData].
Future<CompiledData<T>> computeData<T>(String name, Uri entryPoint,
Map<String, String> memorySourceFiles, DataComputer<T> dataComputer,
{List<String> options: const <String>[],
bool verbose: false,
bool testFrontend: false,
bool printCode: false,
bool forUserLibrariesOnly: true,
bool skipUnprocessedMembers: false,
bool skipFailedCompilations: false,
Iterable<Id> globalIds: const <Id>[],
{List<String> options = const <String>[],
bool verbose = false,
bool testFrontend = false,
bool printCode = false,
bool forUserLibrariesOnly = true,
bool skipUnprocessedMembers = false,
bool skipFailedCompilations = false,
Iterable<Id> globalIds = const <Id>[],
Future<void> verifyCompiler(String test, Compiler compiler)}) async {
OutputCollector outputCollector = new OutputCollector();
DiagnosticCollector diagnosticCollector = new DiagnosticCollector();
@ -368,7 +368,7 @@ class Dart2jsCompiledData<T> extends CompiledData<T> {
@override
void reportError(Uri uri, int offset, String message,
{bool succinct: false}) {
{bool succinct = false}) {
compiler.reporter.reportErrorMessage(
computeSourceSpanFromUriOffset(uri, offset),
MessageKind.GENERIC,
@ -400,14 +400,14 @@ class TestConfig {
/// If [forUserSourceFilesOnly] is true, we examine the elements in the main
/// file and any supporting libraries.
Future<void> checkTests<T>(Directory dataDir, DataComputer<T> dataComputer,
{List<String> skip: const <String>[],
{List<String> skip = const <String>[],
bool filterActualData(IdValue idValue, ActualData<T> actualData),
List<String> options: const <String>[],
List<String> args: const <String>[],
bool forUserLibrariesOnly: true,
List<String> options = const <String>[],
List<String> args = const <String>[],
bool forUserLibrariesOnly = true,
Callback setUpFunction,
int shards: 1,
int shardIndex: 0,
int shards = 1,
int shardIndex = 0,
void onTest(Uri uri),
List<TestConfig> testedConfigs = const [],
Map<String, List<String>> perTestOptions = const {},
@ -498,11 +498,11 @@ Future<TestResult<T>> runTestForConfiguration<T>(
TestData testData,
List<String> options,
{bool filterActualData(IdValue idValue, ActualData<T> actualData),
bool verbose: false,
bool succinct: false,
bool printCode: false,
bool forUserLibrariesOnly: true,
bool testAfterFailures: false,
bool verbose = false,
bool succinct = false,
bool printCode = false,
bool forUserLibrariesOnly = true,
bool testAfterFailures = false,
Future<void> verifyCompiler(String test, Compiler compiler)}) async {
MemberAnnotations<IdValue> annotations =
testData.expectedMaps[testConfiguration.marker];

View file

@ -29,7 +29,7 @@ class IdTestingDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
KernelFrontendStrategy frontendStrategy = compiler.frontendStrategy;
KernelToElementMap elementMap = frontendStrategy.elementMap;
ir.Member node = elementMap.getMemberNode(member);

View file

@ -27,7 +27,7 @@ ArgParser createArgParser() {
}
show<T>(ArgResults argResults, DataComputer<T> dataComputer,
{List<String> options: const <String>[]}) async {
{List<String> options = const <String>[]}) async {
dataComputer.setup();
if (argResults.wasParsed('colors')) {

View file

@ -15,18 +15,18 @@ class Class1 {
/*member: Class1.field1:constant=BoolConstant(false)*/
final bool field1;
const Class1({this.field1: false});
const Class1({this.field1 = false});
}
class Class2 {
/*spec.member: Class2.field2:constant=BoolConstant(true)*/
final bool field2;
const Class2({this.field2: false});
const Class2({this.field2 = false});
}
class Class3 {
final bool field3;
const Class3({this.field3: false});
const Class3({this.field3 = false});
}

View file

@ -28,7 +28,7 @@ class Class {
/*member: Class.state2:constant=ConstructedConstant(Enum(_name=StringConstant("c"),index=IntConstant(2)))*/
final Enum state2;
Class({this.state1: 1, this.state2: Enum.c});
Class({this.state1 = 1, this.state2 = Enum.c});
@pragma('dart2js:noInline')
method1a() {

View file

@ -41,7 +41,7 @@ class JAllocatorAnalysisDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
if (member.isField) {
DartTypes dartTypes = compiler.frontendStrategy.commonElements.dartTypes;
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;

View file

@ -15,19 +15,19 @@ class Class1 {
/*member: Class1.field1:Class1.=field1:BoolConstant(false),initial=NullConstant*/
final bool field1;
const Class1({this.field1: false});
const Class1({this.field1 = false});
}
class Class2 {
/*member: Class2.field2:Class2.=field2:BoolConstant(false),initial=NullConstant*/
final bool field2;
const Class2({this.field2: false});
const Class2({this.field2 = false});
}
class Class3 {
/*member: Class3.field3:Class3.=field3:BoolConstant(false),initial=NullConstant*/
final bool field3;
const Class3({this.field3: false});
const Class3({this.field3 = false});
}

View file

@ -35,7 +35,7 @@ class KAllocatorAnalysisDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
if (member.isField) {
KernelFrontendStrategy frontendStrategy = compiler.frontendStrategy;
DartTypes dartTypes = frontendStrategy.commonElements.dartTypes;

View file

@ -133,7 +133,7 @@ main() {
}
testRelations(DartType a, DartType b,
{bool areEqual: false, bool isSubtype: false}) {
{bool areEqual = false, bool isSubtype = false}) {
if (areEqual) {
isSubtype = true;
}

View file

@ -37,17 +37,17 @@ String _commonTestPath(bool soundNullSafety) {
/// If [check] is provided, it is executed on the code for [entry] before
/// returning.
Future<String> compile(String code,
{String entry: 'main',
{String entry = 'main',
String methodName,
bool enableTypeAssertions: false,
bool minify: false,
bool disableInlining: true,
bool disableTypeInference: true,
bool omitImplicitChecks: true,
bool enableVariance: false,
bool enableTypeAssertions = false,
bool minify = false,
bool disableInlining = true,
bool disableTypeInference = true,
bool omitImplicitChecks = true,
bool enableVariance = false,
void check(String generatedEntry),
bool returnAll: false,
bool soundNullSafety: false}) async {
bool returnAll = false,
bool soundNullSafety = false}) async {
OutputCollector outputCollector = returnAll ? new OutputCollector() : null;
List<String> options = <String>[];
if (disableTypeInference) {
@ -109,9 +109,9 @@ Future<String> compile(String code,
}
Future<String> compileAll(String code,
{bool disableInlining: true,
bool minify: false,
bool soundNullSafety: false,
{bool disableInlining = true,
bool minify = false,
bool soundNullSafety = false,
int expectedErrors,
int expectedWarnings}) async {
OutputCollector outputCollector = new OutputCollector();

View file

@ -19,7 +19,7 @@ import 'package:sourcemap_testing/src/stacktrace_helper.dart';
import '../helpers/memory_compiler.dart';
Future createTemp(Uri entryPoint, Map<String, String> memorySourceFiles,
{bool printSteps: false}) async {
{bool printSteps = false}) async {
if (memorySourceFiles.isNotEmpty) {
Directory dir = await Directory.systemTemp.createTemp('dart2js-with-dill');
if (printSteps) {
@ -35,11 +35,11 @@ Future createTemp(Uri entryPoint, Map<String, String> memorySourceFiles,
Future<D8Result> runWithD8(
{Uri entryPoint,
Map<String, String> memorySourceFiles: const <String, String>{},
List<String> options: const <String>[],
Map<String, String> memorySourceFiles = const <String, String>{},
List<String> options = const <String>[],
String expectedOutput,
bool printJs: false,
bool printSteps: false}) async {
bool printJs = false,
bool printSteps = false}) async {
retainDataForTesting = true;
entryPoint ??= Uri.parse('memory:main.dart');
Uri mainFile =

View file

@ -37,7 +37,7 @@ ClassEntity findClass(JClosedWorld closedWorld, String name) {
MemberEntity findClassMember(
JClosedWorld closedWorld, String className, String memberName,
{bool required: true}) {
{bool required = true}) {
bool isSetter = false;
if (memberName.endsWith('=')) {
memberName = memberName.substring(0, memberName.length - 1);

View file

@ -56,7 +56,7 @@ class MultiDiagnostics implements api.CompilerDiagnostics {
api.CompilerDiagnostics createCompilerDiagnostics(
api.CompilerDiagnostics diagnostics, SourceFileProvider provider,
{bool showDiagnostics: true, bool verbose: false}) {
{bool showDiagnostics = true, bool verbose = false}) {
api.CompilerDiagnostics handler = diagnostics;
if (showDiagnostics) {
if (diagnostics == null) {
@ -79,16 +79,16 @@ fe.InitializedCompilerState kernelInitializedCompilerState;
/// contents or string file name to binary file contents (hence the `dynamic`
/// type for the second parameter).
Future<api.CompilationResult> runCompiler(
{Map<String, dynamic> memorySourceFiles: const <String, dynamic>{},
{Map<String, dynamic> memorySourceFiles = const <String, dynamic>{},
Uri entryPoint,
api.CompilerDiagnostics diagnosticHandler,
api.CompilerOutput outputProvider,
List<String> options: const <String>[],
bool showDiagnostics: true,
List<String> options = const <String>[],
bool showDiagnostics = true,
Uri librariesSpecificationUri,
Uri packageConfig,
void beforeRun(Compiler compiler),
bool unsafeToTouchSourceFiles: false}) async {
bool unsafeToTouchSourceFiles = false}) async {
if (entryPoint == null) {
entryPoint = Uri.parse('memory:main.dart');
}
@ -114,14 +114,14 @@ Future<api.CompilationResult> runCompiler(
Compiler compilerFor(
{Uri entryPoint,
Map<String, dynamic> memorySourceFiles: const <String, dynamic>{},
Map<String, dynamic> memorySourceFiles = const <String, dynamic>{},
api.CompilerDiagnostics diagnosticHandler,
api.CompilerOutput outputProvider,
List<String> options: const <String>[],
bool showDiagnostics: true,
List<String> options = const <String>[],
bool showDiagnostics = true,
Uri librariesSpecificationUri,
Uri packageConfig,
bool unsafeToTouchSourceFiles: false}) {
bool unsafeToTouchSourceFiles = false}) {
retainDataForTesting = true;
librariesSpecificationUri ??= sdkLibrariesSpecificationUri;

View file

@ -64,6 +64,6 @@ class MemorySourceFileProvider extends SourceFileProvider {
@override
Future<api.Input> readFromUri(Uri resourceUri,
{api.InputKind inputKind: api.InputKind.UTF8}) =>
{api.InputKind inputKind = api.InputKind.UTF8}) =>
readBytesFromUri(resourceUri, inputKind);
}

View file

@ -8,7 +8,7 @@
/// of the [windowSize] lines before and after are printed and the mismatch line
/// number is returned. If identical, nothing is printed and `null` is returned.
int checkEqualContentAndShowDiff(String text1, String text2,
{int windowSize: 20,
{int windowSize = 20,
bool Function(int, List<String>, List<String>) filter}) {
List<String> lines1 = text1.split('\n');
List<String> lines2 = text2.split('\n');

View file

@ -35,11 +35,11 @@ class TypeEnvironment {
final bool testBackendWorld;
static Future<TypeEnvironment> create(String source,
{bool expectNoErrors: false,
bool expectNoWarningsOrErrors: false,
bool testBackendWorld: false,
List<String> options: const <String>[],
Map<String, String> fieldTypeMap: const <String, String>{}}) async {
{bool expectNoErrors = false,
bool expectNoWarningsOrErrors = false,
bool testBackendWorld = false,
List<String> options = const <String>[],
Map<String, String> fieldTypeMap = const <String, String>{}}) async {
memory.DiagnosticCollector collector = new memory.DiagnosticCollector();
Uri uri = Uri.parse('memory:main.dart');
memory.CompilationResult result = await memory.runCompiler(
@ -62,7 +62,7 @@ class TypeEnvironment {
return new TypeEnvironment._(compiler, testBackendWorld: testBackendWorld);
}
TypeEnvironment._(Compiler this.compiler, {this.testBackendWorld: false});
TypeEnvironment._(Compiler this.compiler, {this.testBackendWorld = false});
DartType legacyWrap(DartType type) {
return options.useLegacySubtyping ? types.legacyType(type) : type;
@ -225,7 +225,7 @@ class FunctionTypeData {
///
/// $returnType $name$parameters => null;
String createMethods(List<FunctionTypeData> dataList,
{String additionalData: '', String prefix: ''}) {
{String additionalData = '', String prefix = ''}) {
StringBuffer sb = new StringBuffer();
for (FunctionTypeData data in dataList) {
sb.writeln(
@ -243,7 +243,7 @@ String createMethods(List<FunctionTypeData> dataList,
///
/// where a field using the typedef is add to make the type accessible by name.
String createTypedefs(List<FunctionTypeData> dataList,
{String additionalData: '', String prefix: ''}) {
{String additionalData = '', String prefix = ''}) {
StringBuffer sb = new StringBuffer();
for (int index = 0; index < dataList.length; index++) {
FunctionTypeData data = dataList[index];
@ -259,7 +259,7 @@ String createTypedefs(List<FunctionTypeData> dataList,
}
/// Return source code that uses the function types in [dataList].
String createUses(List<FunctionTypeData> dataList, {String prefix: ''}) {
String createUses(List<FunctionTypeData> dataList, {String prefix = ''}) {
StringBuffer sb = new StringBuffer();
for (int index = 0; index < dataList.length; index++) {
FunctionTypeData data = dataList[index];

View file

@ -116,7 +116,7 @@ testDefaultValuesPositional([bool value = false]) {}
inst:JSBool,
param:bool*]
*/
testDefaultValuesNamed({bool value: false}) {}
testDefaultValuesNamed({bool value = false}) {}
class ClassFieldInitializer1 {
/*member: ClassFieldInitializer1.field:type=[inst:JSNull]*/

View file

@ -46,7 +46,7 @@ class ImpactDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
KernelFrontendStrategy frontendStrategy = compiler.frontendStrategy;
WorldImpact impact = compiler.impactCache[member];
ir.Member node = frontendStrategy.elementMap.getMemberNode(member);

View file

@ -32,7 +32,7 @@ class CallersDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
MemberDefinition definition = elementMap.getMemberDefinition(member);

View file

@ -28,19 +28,19 @@ defaultFn6(/*[exact=JSUInt31]*/ a) => a;
foo1([/*[subclass=Closure]*/ fn = defaultFn1]) => fn(54);
/*member: foo2:[null|subclass=Object]*/
foo2({/*[subclass=Closure]*/ fn: defaultFn2}) => fn(54);
foo2({/*[subclass=Closure]*/ fn = defaultFn2}) => fn(54);
/*member: foo3:[null|subclass=Object]*/
foo3([/*[subclass=Closure]*/ fn = defaultFn3]) => fn(54);
/*member: foo4:[null|subclass=Object]*/
foo4({/*[subclass=Closure]*/ fn: defaultFn4}) => fn(54);
foo4({/*[subclass=Closure]*/ fn = defaultFn4}) => fn(54);
/*member: foo5:[null|subclass=Object]*/
foo5([/*[null|subclass=Object]*/ fn = defaultFn5]) => fn(54);
/*member: foo6:[null|subclass=Object]*/
foo6({/*[null|subclass=Object]*/ fn: defaultFn6}) => fn(54);
foo6({/*[null|subclass=Object]*/ fn = defaultFn6}) => fn(54);
/*member: main:[null]*/
main() {

View file

@ -26,7 +26,7 @@ class C {
/*member: C.b:[exact=C]*/
C.b(int /*[exact=JSUInt31]*/ x,
{var /*Union([exact=JSString], [exact=_SECRET])*/ b: const _SECRET()})
{var /*Union([exact=JSString], [exact=_SECRET])*/ b = const _SECRET()})
: this.x = x,
this.y = b;

View file

@ -147,7 +147,7 @@ _returnDefaultZeroCalled([/*[exact=JSNumNotInt]*/ a = 0]) => a;
staticCallWithNamedArguments1() => _returnNamedDefaultZero();
/*member: _returnNamedDefaultZero:[exact=JSUInt31]*/
_returnNamedDefaultZero({/*[exact=JSUInt31]*/ a: 0}) => a;
_returnNamedDefaultZero({/*[exact=JSUInt31]*/ a = 0}) => a;
////////////////////////////////////////////////////////////////////////////////
/// A static method that has a named parameter with a default value of `0`.
@ -158,7 +158,7 @@ _returnNamedDefaultZero({/*[exact=JSUInt31]*/ a: 0}) => a;
staticCallWithNamedArguments2() => _returnNamedDefaultZeroCalled(a: 0.5);
/*member: _returnNamedDefaultZeroCalled:[exact=JSNumNotInt]*/
_returnNamedDefaultZeroCalled({/*[exact=JSNumNotInt]*/ a: 0}) => a;
_returnNamedDefaultZeroCalled({/*[exact=JSNumNotInt]*/ a = 0}) => a;
////////////////////////////////////////////////////////////////////////////////
/// A static method that has a named parameter. Two call sites, one with an

View file

@ -44,7 +44,7 @@ class InferenceDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
MemberDefinition definition = elementMap.getMemberDefinition(member);

View file

@ -48,7 +48,7 @@ class TypeMaskDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
GlobalTypeInferenceResults results =

View file

@ -37,7 +37,7 @@ main() async {
});
}
runTest(List<String> options, {bool trust: true}) async {
runTest(List<String> options, {bool trust = true}) async {
CompilationResult result = await runCompiler(
memorySourceFiles: {'main.dart': source}, options: options);
Expect.isTrue(result.isSuccess);

View file

@ -37,7 +37,7 @@ class SideEffectsDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
MemberDefinition definition = elementMap.getMemberDefinition(member);

View file

@ -54,7 +54,7 @@ main() {
/// Checks the expectation of `isDisjoint` for two mask. Also checks that
/// the result is consistent with an equivalent (but slower) implementation
/// based on intersection.
checkMask(TypeMask m1, TypeMask m2, {areDisjoint: false}) {
checkMask(TypeMask m1, TypeMask m2, {areDisjoint = false}) {
print('masks: $m1 $m2');
Expect.equals(areDisjoint, m1.isDisjoint(m2, world));
Expect.equals(areDisjoint, m2.isDisjoint(m1, world));
@ -116,14 +116,14 @@ main() {
/// Checks the expectation of `isDisjoint` for two mask descriptors (see
/// [maskOf] for details).
check(String typeMaskDescriptor1, String typeMaskDescriptor2,
{areDisjoint: true}) {
{areDisjoint = true}) {
print('[$typeMaskDescriptor1] & [$typeMaskDescriptor2]');
checkMask(maskOf(typeMaskDescriptor1), maskOf(typeMaskDescriptor2),
areDisjoint: areDisjoint);
}
checkUnions(List<String> descriptors1, List<String> descriptors2,
{areDisjoint: true}) {
{areDisjoint = true}) {
print('[$descriptors1] & [$descriptors2]');
var m1 =
new TypeMask.unionOf(descriptors1.map(maskOf).toList(), commonMasks);

View file

@ -25,7 +25,7 @@ AbstractValue simplify(AbstractValue value, AbstractValueDomain domain) {
}
TypeMask interceptorOrComparable(JClosedWorld closedWorld,
{bool nullable: false}) {
{bool nullable = false}) {
// TODO(johnniwinther): The mock libraries are missing 'Comparable' and
// therefore consider the union of for instance 'String' and 'num' to be
// 'Interceptor' and not 'Comparable'. Maybe the union mask should be changed

View file

@ -36,7 +36,7 @@ class InliningDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
MemberDefinition definition = elementMap.getMemberDefinition(member);

View file

@ -43,7 +43,7 @@ main() {
Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation');
void test(String name,
{bool expectNoInline: false, bool expectTryInline: false}) {
{bool expectNoInline = false, bool expectTryInline = false}) {
LibraryEntity mainLibrary = elementEnvironment.mainLibrary;
FunctionEntity method =
elementEnvironment.lookupLibraryMember(mainLibrary, name);

View file

@ -8,7 +8,7 @@ import 'package:expect/expect.dart';
import 'package:compiler/src/js/js.dart' as js;
import 'package:compiler/src/js/placeholder_safety.dart';
void test(String source, int expected, {List notNull: const []}) {
void test(String source, int expected, {List notNull = const []}) {
var predicate = (int pos) => !notNull.contains(pos);
js.Template template = js.js.parseForeignJS(source);
int actual = PlaceholderSafetyAnalysis.analyze(template.ast, predicate);

View file

@ -52,7 +52,7 @@ void test(DartTypes dartTypes, String specString,
NativeThrowBehavior expectedThrows,
bool expectedNew,
bool expectedGvn,
bool expectError: false}) {
bool expectError = false}) {
List actualReturns = [];
List actualCreates = [];
SideEffects actualSideEffects;
@ -91,7 +91,7 @@ void test(DartTypes dartTypes, String specString,
}
void testWithSideEffects(DartTypes dartTypes, String specString,
{List returns, List creates, bool expectError: false}) {
{List returns, List creates, bool expectError = false}) {
void sideEffectsTest(String newSpecString, SideEffects expectedSideEffects,
{bool sideEffectsExpectError}) {
test(dartTypes, newSpecString,

View file

@ -377,13 +377,13 @@ class Test {
final List<MessageKind> warnings;
const Test(this.name, this._source,
{this.errors: const <MessageKind>[],
this.warnings: const <MessageKind>[]})
{this.errors = const <MessageKind>[],
this.warnings = const <MessageKind>[]})
: _sources = null;
const Test.multi(this.name, this._sources,
{this.errors: const <MessageKind>[],
this.warnings: const <MessageKind>[]})
{this.errors = const <MessageKind>[],
this.warnings = const <MessageKind>[]})
: _source = null;
String get source => _source ?? _sources['main.dart'];

View file

@ -28,9 +28,9 @@ void main() {
testClasses(String import1, String import2) async {
test(String mainSource,
{List<String> directlyInstantiated: const <String>[],
List<String> abstractlyInstantiated: const <String>[],
List<String> indirectlyInstantiated: const <String>[]}) async {
{List<String> directlyInstantiated = const <String>[],
List<String> abstractlyInstantiated = const <String>[],
List<String> indirectlyInstantiated = const <String>[]}) async {
String mainFile = 'sdk/tests/web_2/native/main.dart';
Uri entryPoint = Uri.parse('memory:$mainFile');
CompilationResult result =

View file

@ -26,9 +26,9 @@ void main() {
testClasses() async {
test(String mainSource,
{List<String> directlyInstantiated: const <String>[],
List<String> abstractlyInstantiated: const <String>[],
List<String> indirectlyInstantiated: const <String>[]}) async {
{List<String> directlyInstantiated = const <String>[],
List<String> abstractlyInstantiated = const <String>[],
List<String> indirectlyInstantiated = const <String>[]}) async {
CompilationResult result = await runCompiler(memorySourceFiles: {
'main.dart': """
import 'package:js/js.dart';

View file

@ -35,7 +35,7 @@ class JumpDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
JsToElementMap elementMap = closedWorld.elementMap;
GlobalLocalsMap localsMap =

View file

@ -79,7 +79,7 @@ class ClosedWorldDataComputer extends DataComputer<Features> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<Features>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
KernelFrontendStrategy frontendStrategy = compiler.frontendStrategy;
ResolutionWorldBuilder resolutionWorldBuilder =
compiler.resolutionWorldBuilderForTesting;

View file

@ -12,9 +12,9 @@ import 'package:expect/expect.dart';
main() {
asyncTest(() async {
test(List<String> expectedSuffixes,
{int positionalParameters: 0,
int typeParameters: 0,
List<String> namedParameters: const <String>[]}) {
{int positionalParameters = 0,
int typeParameters = 0,
List<String> namedParameters = const <String>[]}) {
CallStructure callStructure = new CallStructure(
positionalParameters + namedParameters.length,
namedParameters,

View file

@ -47,7 +47,7 @@ class ConstantDataComputer extends DataComputer<String> {
@override
void computeMemberData(Compiler compiler, MemberEntity member,
Map<Id, ActualData<String>> actualMap,
{bool verbose: false}) {
{bool verbose = false}) {
KernelFrontendStrategy frontendStrategy = compiler.frontendStrategy;
KernelToElementMap elementMap = frontendStrategy.elementMap;
ir.Member node = elementMap.getMemberNode(member);

View file

@ -65,7 +65,8 @@ testIterators() async {
ClassEntity G = env.getClass("G");
void checkClass(ClassEntity cls,
{bool directlyInstantiated: false, bool indirectlyInstantiated: false}) {
{bool directlyInstantiated = false,
bool indirectlyInstantiated = false}) {
ClassHierarchyNode node = world.classHierarchy.getClassHierarchyNode(cls);
Expect.isNotNull(node, "Expected ClassHierarchyNode for $cls.");
Expect.equals(
@ -420,8 +421,8 @@ testForEach() async {
void checkForEach(ClassEntity cls, List<ClassEntity> expected,
{ClassEntity stop,
List<ClassEntity> skipSubclasses: const <ClassEntity>[],
bool forEachSubtype: false,
List<ClassEntity> skipSubclasses = const <ClassEntity>[],
bool forEachSubtype = false,
EnumSet<Instantiation> mask}) {
if (mask == null) {
mask = ClassHierarchyNode.ALL;
@ -483,7 +484,7 @@ testForEach() async {
forEachSubtype: true, mask: ClassHierarchyNode.INSTANTIATED);
void checkAny(ClassEntity cls, List<ClassEntity> expected,
{ClassEntity find, bool expectedResult, bool anySubtype: false}) {
{ClassEntity find, bool expectedResult, bool anySubtype = false}) {
ClassSet classSet = world.classHierarchy.getClassSet(cls);
List<ClassEntity> visited = <ClassEntity>[];
@ -551,7 +552,7 @@ testClosures() async {
ClassEntity closureClass = world.commonElements.closureClass;
ClassEntity A = env.getClass("A");
checkIsFunction(ClassEntity cls, {bool expected: true}) {
checkIsFunction(ClassEntity cls, {bool expected = true}) {
Expect.equals(
expected,
world.classHierarchy.isSubtypeOf(cls, functionClass),

View file

@ -206,7 +206,7 @@ main() {
}
runTest(String fileName, String location, Map<String, Kind> expectations,
{List<String> skipList: const <String>[]}) async {
{List<String> skipList = const <String>[]}) async {
print('--------------------------------------------------------------------');
print('Testing $fileName');
print('--------------------------------------------------------------------');
@ -261,7 +261,7 @@ runPositiveTest(Uri entryPoint, Map<String, String> sources,
ElementEnvironment elementEnvironment = closedWorld.elementEnvironment;
void checkClass(ClassEntity cls,
{bool isNative: false, bool isJsInterop: false}) {
{bool isNative = false, bool isJsInterop = false}) {
if (isJsInterop) {
isNative = true;
}
@ -276,7 +276,7 @@ runPositiveTest(Uri entryPoint, Map<String, String> sources,
}
void checkMember(MemberEntity member,
{bool isNative: false, bool isJsInterop: false}) {
{bool isNative = false, bool isJsInterop = false}) {
if (isJsInterop) {
isNative = true;
}

View file

@ -27,13 +27,13 @@ class NoSuchMethodInfo {
const NoSuchMethodInfo(this.className,
{this.superClassName,
this.hasThrowingSyntax: false,
this.hasForwardingSyntax: false,
this.isThrowing: false,
this.isDefault: false,
this.isOther: false,
this.isComplexNoReturn: false,
this.isComplexReturn: false});
this.hasThrowingSyntax = false,
this.hasForwardingSyntax = false,
this.isThrowing = false,
this.isDefault = false,
this.isOther = false,
this.isComplexNoReturn = false,
this.isComplexReturn = false});
}
class NoSuchMethodTest {
@ -42,7 +42,7 @@ class NoSuchMethodTest {
final bool isNoSuchMethodUsed;
const NoSuchMethodTest(this.code, this.methods,
{this.isNoSuchMethodUsed: false});
{this.isNoSuchMethodUsed = false});
}
const List<NoSuchMethodTest> TESTS = const <NoSuchMethodTest>[

View file

@ -114,7 +114,7 @@ main() {
JClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
void check(String className,
{bool hasMethod, bool isAbstract: false, String declaringClass}) {
{bool hasMethod, bool isAbstract = false, String declaringClass}) {
MemberEntity member =
findClassMember(closedWorld, className, 'method', required: false);
if (hasMethod) {

View file

@ -142,10 +142,10 @@ class Impact {
final List<String> parameterChecks;
const Impact(
{this.checkedModeChecks: const <String>[],
this.asCasts: const <String>[],
this.implicitCasts: const <String>[],
this.parameterChecks: const <String>[]});
{this.checkedModeChecks = const <String>[],
this.asCasts = const <String>[],
this.implicitCasts = const <String>[],
this.parameterChecks = const <String>[]});
@override
String toString() {

View file

@ -22,7 +22,7 @@ void main() {
});
}
runTests({bool strongMode: false}) async {
runTests({bool strongMode = false}) async {
var env = await TypeEnvironment.create(r"""
/// A
/// / \
@ -65,7 +65,7 @@ runTests({bool strongMode: false}) async {
ClassEntity Function_ = env.getElement("Function");
void checkClass(ClassEntity cls, List<ClassEntity> expectedSubtypes,
{bool checkSubset: false}) {
{bool checkSubset = false}) {
ClassSet node = world.classHierarchy.getClassSet(cls);
Set<ClassEntity> actualSubtypes = node.subtypes().toSet();
if (checkSubset) {

View file

@ -71,7 +71,7 @@ testClassSets() async {
void checkClasses(String property, ClassEntity cls,
Iterable<ClassEntity> foundClasses, List<ClassEntity> expectedClasses,
{bool exact: true}) {
{bool exact = true}) {
for (ClassEntity expectedClass in expectedClasses) {
Expect.isTrue(
foundClasses.contains(expectedClass),
@ -92,7 +92,7 @@ testClassSets() async {
void check(String property, ClassEntity cls,
Iterable<ClassEntity> foundClasses, List<ClassEntity> expectedClasses,
{bool exact: true,
{bool exact = true,
void forEach(ClassEntity cls, ForEachFunction f),
int getCount(ClassEntity cls)}) {
checkClasses(property, cls, foundClasses, expectedClasses, exact: exact);
@ -118,14 +118,14 @@ testClassSets() async {
}
void testSubclasses(ClassEntity cls, List<ClassEntity> expectedClasses,
{bool exact: true}) {
{bool exact = true}) {
check('subclassesOf', cls, closedWorld.classHierarchy.subclassesOf(cls),
expectedClasses,
exact: exact);
}
void testStrictSubclasses(ClassEntity cls, List<ClassEntity> expectedClasses,
{bool exact: true}) {
{bool exact = true}) {
check('strictSubclassesOf', cls,
closedWorld.classHierarchy.strictSubclassesOf(cls), expectedClasses,
exact: exact,
@ -134,7 +134,7 @@ testClassSets() async {
}
void testStrictSubtypes(ClassEntity cls, List<ClassEntity> expectedClasses,
{bool exact: true}) {
{bool exact = true}) {
check('strictSubtypesOf', cls,
closedWorld.classHierarchy.strictSubtypesOf(cls), expectedClasses,
exact: exact,
@ -143,7 +143,7 @@ testClassSets() async {
}
void testMixinUses(ClassEntity cls, List<ClassEntity> expectedClasses,
{bool exact: true}) {
{bool exact = true}) {
check('mixinUsesOf', cls, closedWorld.mixinUsesOf(cls), expectedClasses,
exact: exact);
}
@ -365,8 +365,8 @@ testNativeClasses() async {
ClassEntity lubOfInstantiatedSubtypes,
int instantiatedSubclassCount,
int instantiatedSubtypeCount,
List<ClassEntity> subclasses: const <ClassEntity>[],
List<ClassEntity> subtypes: const <ClassEntity>[]}) {
List<ClassEntity> subclasses = const <ClassEntity>[],
List<ClassEntity> subtypes = const <ClassEntity>[]}) {
ClassSet classSet = closedWorld.classHierarchy.getClassSet(cls);
ClassHierarchyNode node = classSet.node;

Some files were not shown because too many files have changed in this diff Show more