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

Unified Diff: tests/compiler/dart2js/mirrors_test.dart

Issue 10823257: Refactored accessors in mirrors from methods to properties. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/mirrors_test.dart
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 76dcaa0759c177e8d03e14331033bfff6d9944b9..5de1ea19f781150d07593173a076ecccf457b8dd 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -32,21 +32,21 @@ main() {
var compilation = new Compilation(inputPath, libPath);
Expect.isNotNull(compilation, "No compilation created");
- var mirrors = compilation.mirrors();
+ var mirrors = compilation.mirrors;
Expect.isNotNull(mirrors, "No mirror system returned from compilation");
- var libraries = mirrors.libraries();
+ var libraries = mirrors.libraries;
Expect.isNotNull(libraries, "No libraries map returned");
Expect.isFalse(libraries.isEmpty(), "Empty libraries map returned");
var helperLibrary = findMirror(libraries, "mirrors_helper");
Expect.isNotNull(helperLibrary, "Library 'mirrors_helper' not found");
- Expect.stringEquals("mirrors_helper", helperLibrary.simpleName(),
+ Expect.stringEquals("mirrors_helper", helperLibrary.simpleName,
"Unexpected library simple name");
- Expect.stringEquals("mirrors_helper", helperLibrary.qualifiedName(),
+ Expect.stringEquals("mirrors_helper", helperLibrary.qualifiedName,
"Unexpected library qualified name");
- var types = helperLibrary.types();
+ var types = helperLibrary.types;
Expect.isNotNull(types, "No types map returned");
Expect.isFalse(types.isEmpty(), "Empty types map returned");
@@ -70,12 +70,12 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isNotNull(fooClass, "Type 'Foo' not found");
Expect.isTrue(fooClass is InterfaceMirror,
"Unexpected mirror type returned");
- Expect.stringEquals("Foo", fooClass.simpleName(),
+ Expect.stringEquals("Foo", fooClass.simpleName,
"Unexpected type simple name");
- Expect.stringEquals("mirrors_helper.Foo", fooClass.qualifiedName(),
+ Expect.stringEquals("mirrors_helper.Foo", fooClass.qualifiedName,
"Unexpected type qualified name");
- Expect.equals(helperLibrary, fooClass.library(),
+ Expect.equals(helperLibrary, fooClass.library,
"Unexpected library returned from type");
Expect.isFalse(fooClass.isObject, "Class is Object");
@@ -93,7 +93,7 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isFalse(fooClass.isInterface, "Class is interface");
Expect.isFalse(fooClass.isPrivate, "Class is private");
- var objectType = fooClass.superclass();
+ var objectType = fooClass.superclass;
Expect.isNotNull(objectType, "Superclass is null");
Expect.isTrue(objectType.isObject, "Object is not Object");
Expect.isFalse(objectType.isDeclaration, "Object type is declaration");
@@ -101,32 +101,32 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
computeSubdeclarations(objectType)),
"Class is not subclass of superclass");
- var fooInterfaces = fooClass.interfaces();
+ var fooInterfaces = fooClass.interfaces;
Expect.isNotNull(fooInterfaces, "Interfaces map is null");
Expect.isTrue(fooInterfaces.isEmpty(), "Interfaces map is not empty");
var fooSubdeclarations = computeSubdeclarations(fooClass);
Expect.equals(1, count(fooSubdeclarations), "Unexpected subtype count");
for (var fooSubdeclaration in fooSubdeclarations) {
- Expect.equals(fooClass, fooSubdeclaration.superclass().declaration,
+ Expect.equals(fooClass, fooSubdeclaration.superclass.declaration,
"Class is not superclass of subclass");
}
- Expect.throws(() => fooClass.typeArguments(),
+ Expect.throws(() => fooClass.typeArguments,
(exception) => true,
"Class has type arguments");
- var fooClassTypeVariables = fooClass.typeVariables();
+ var fooClassTypeVariables = fooClass.typeVariables;
Expect.isNotNull(fooClassTypeVariables, "Type variable list is null");
Expect.isTrue(fooClassTypeVariables.isEmpty(),
"Type variable list is not empty");
- Expect.isNull(fooClass.defaultType(), "Class has default type");
+ Expect.isNull(fooClass.defaultType, "Class has default type");
- var fooClassMembers = fooClass.declaredMembers();
+ var fooClassMembers = fooClass.declaredMembers;
Expect.isNotNull(fooClassMembers, "Declared members map is null");
Expect.isTrue(fooClassMembers.isEmpty(), "Declared members map is unempty");
- var fooClassConstructors = fooClass.constructors();
+ var fooClassConstructors = fooClass.constructors;
Expect.isNotNull(fooClassConstructors, "Constructors map is null");
Expect.isTrue(fooClassConstructors.isEmpty(),
"Constructors map is unempty");
@@ -143,12 +143,12 @@ void testBar(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isNotNull(barInterface, "Type 'Bar' not found");
Expect.isTrue(barInterface is InterfaceMirror,
"Unexpected mirror type returned");
- Expect.stringEquals("Bar", barInterface.simpleName(),
+ Expect.stringEquals("Bar", barInterface.simpleName,
"Unexpected type simple name");
- Expect.stringEquals("mirrors_helper.Bar", barInterface.qualifiedName(),
+ Expect.stringEquals("mirrors_helper.Bar", barInterface.qualifiedName,
"Unexpected type qualified name");
- Expect.equals(helperLibrary, barInterface.library(),
+ Expect.equals(helperLibrary, barInterface.library,
"Unexpected library returned from type");
Expect.isFalse(barInterface.isObject, "Interface is Object");
@@ -166,7 +166,7 @@ void testBar(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isTrue(barInterface.isInterface, "Interface is not interface");
Expect.isFalse(barInterface.isPrivate, "Interface is private");
- var objectType = barInterface.superclass();
+ var objectType = barInterface.superclass;
Expect.isNotNull(objectType, "Superclass is null");
Expect.isTrue(objectType.isObject, "Object is not Object");
Expect.isFalse(objectType.isDeclaration, "Object type is declaration");
@@ -174,7 +174,7 @@ void testBar(MirrorSystem system, LibraryMirror helperLibrary,
computeSubdeclarations(objectType)),
"Class is not subclass of superclass");
- var barInterfaces = barInterface.interfaces();
+ var barInterfaces = barInterface.interfaces;
Expect.isNotNull(barInterfaces, "Interfaces map is null");
Expect.isTrue(barInterfaces.isEmpty(), "Interfaces map is not empty");
@@ -182,14 +182,14 @@ void testBar(MirrorSystem system, LibraryMirror helperLibrary,
Expect.equals(1, count(barSubdeclarations), "Unexpected subtype count");
for (var barSubdeclaration in barSubdeclarations) {
Expect.isTrue(containsType(barInterface,
- barSubdeclaration.interfaces().getValues()),
+ barSubdeclaration.interfaces.getValues()),
"Interface is not superinterface of subclass");
}
- Expect.throws(() => barInterface.typeArguments(),
+ Expect.throws(() => barInterface.typeArguments,
(exception) => true,
"Interface has type arguments");
- var barInterfaceTypeVariables = barInterface.typeVariables();
+ var barInterfaceTypeVariables = barInterface.typeVariables;
Expect.isNotNull(barInterfaceTypeVariables, "Type variable list is null");
Expect.isFalse(barInterfaceTypeVariables.isEmpty(),
"Type variable list is empty");
@@ -200,14 +200,14 @@ void testBar(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isNotNull(barE, "Type variable is null");
Expect.isTrue(barE.isTypeVariable, "Type variable is not type variable");
- Expect.isNull(barInterface.defaultType(), "Interface has default type");
+ Expect.isNull(barInterface.defaultType, "Interface has default type");
- var barInterfaceMembers = barInterface.declaredMembers();
+ var barInterfaceMembers = barInterface.declaredMembers;
Expect.isNotNull(barInterfaceMembers, "Declared members map is null");
Expect.isTrue(barInterfaceMembers.isEmpty(),
"Declared members map is unempty");
- var barInterfaceConstructors = barInterface.constructors();
+ var barInterfaceConstructors = barInterface.constructors;
Expect.isNotNull(barInterfaceConstructors, "Constructors map is null");
Expect.isTrue(barInterfaceConstructors.isEmpty(),
"Constructors map is unempty");
@@ -233,12 +233,12 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isNotNull(bazClass, "Type 'Baz' not found");
Expect.isTrue(bazClass is InterfaceMirror,
"Unexpected mirror type returned");
- Expect.stringEquals("Baz", bazClass.simpleName(),
+ Expect.stringEquals("Baz", bazClass.simpleName,
"Unexpected type simple name");
- Expect.stringEquals("mirrors_helper.Baz", bazClass.qualifiedName(),
+ Expect.stringEquals("mirrors_helper.Baz", bazClass.qualifiedName,
"Unexpected type qualified name");
- Expect.equals(helperLibrary, bazClass.library(),
+ Expect.equals(helperLibrary, bazClass.library,
"Unexpected library returned from type");
Expect.isFalse(bazClass.isObject, "Class is Object");
@@ -256,7 +256,7 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isFalse(bazClass.isInterface, "Class is interface");
Expect.isFalse(bazClass.isPrivate, "Class is private");
- var objectType = bazClass.superclass();
+ var objectType = bazClass.superclass;
Expect.isNotNull(objectType, "Superclass is null");
Expect.isTrue(objectType.isObject, "Object is not Object");
Expect.isFalse(objectType.isDeclaration, "Object type is declaration");
@@ -264,7 +264,7 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
computeSubdeclarations(objectType)),
"Class is not subclass of superclass");
- var bazInterfaces = bazClass.interfaces();
+ var bazInterfaces = bazClass.interfaces;
Expect.isNotNull(bazInterfaces, "Interfaces map is null");
Expect.isTrue(!bazInterfaces.isEmpty(), "Interfaces map is empty");
for (var bazInterface in bazInterfaces.getValues()) {
@@ -279,46 +279,46 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
var barInterface = findMirror(bazInterfaces, "Bar");
Expect.isNotNull(barInterface, "Interface bar is missing");
Expect.isFalse(barInterface.isDeclaration, "Interface type is declaration");
- var barInterfaceTypeArguments = barInterface.typeArguments();
+ var barInterfaceTypeArguments = barInterface.typeArguments;
Expect.isNotNull(barInterfaceTypeArguments, "Type arguments are missing");
Expect.equals(1, barInterfaceTypeArguments.length,
"Type arguments is empty");
- Expect.throws(() => bazClass.typeArguments(),
+ Expect.throws(() => bazClass.typeArguments,
(exception) => true,
"Class has type arguments");
- var bazClassTypeVariables = bazClass.typeVariables();
+ var bazClassTypeVariables = bazClass.typeVariables;
Expect.isNotNull(bazClassTypeVariables, "Type variable list is null");
Expect.equals(2, bazClassTypeVariables.length,
"Type variable list is not empty");
var bazE = bazClassTypeVariables[0];
Expect.isNotNull(bazE, "Type variable is null");
- Expect.stringEquals('E', bazE.simpleName(), "Unexpected simpleName");
- Expect.stringEquals('mirrors_helper.Baz.E', bazE.qualifiedName(),
+ Expect.stringEquals('E', bazE.simpleName, "Unexpected simpleName");
+ Expect.stringEquals('mirrors_helper.Baz.E', bazE.qualifiedName,
"Unexpected qualifiedName");
- Expect.equals(bazClass, bazE.declarer(),
+ Expect.equals(bazClass, bazE.declarer,
"Unexpected type variable declarer");
- var bazEbound = bazE.bound();
+ var bazEbound = bazE.bound;
Expect.isNotNull(bazEbound, "Missing type variable bound");
Expect.isFalse(bazEbound.isDeclaration, "Bound is declaration");
Expect.isTrue(bazEbound.isObject, "Bound is not object");
var bazF = bazClassTypeVariables[1];
Expect.isNotNull(bazF, "Type variable is null");
- Expect.stringEquals('F', bazF.simpleName(), "Unexpected simpleName");
- Expect.stringEquals('mirrors_helper.Baz.F', bazF.qualifiedName(),
+ Expect.stringEquals('F', bazF.simpleName, "Unexpected simpleName");
+ Expect.stringEquals('mirrors_helper.Baz.F', bazF.qualifiedName,
"Unexpected qualifiedName");
- Expect.equals(bazClass, bazF.declarer());
- var bazFbound = bazF.bound();
+ Expect.equals(bazClass, bazF.declarer);
+ var bazFbound = bazF.bound;
Expect.isNotNull(bazFbound, "Missing type variable bound");
Expect.isFalse(bazFbound.isDeclaration, "Bound is declaration");
- Expect.stringEquals("mirrors_helper.Foo", bazFbound.qualifiedName(),
+ Expect.stringEquals("mirrors_helper.Foo", bazFbound.qualifiedName,
"Bound is not Foo");
- Expect.isNull(bazClass.defaultType(), "Class has default type");
+ Expect.isNull(bazClass.defaultType, "Class has default type");
- var bazClassMembers = bazClass.declaredMembers();
+ var bazClassMembers = bazClass.declaredMembers;
Expect.isNotNull(bazClassMembers, "Declared members map is null");
Expect.equals(8, bazClassMembers.length,
"Unexpected number of declared members");
@@ -328,11 +328,11 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
////////////////////////////////////////////////////////////////////////////
var method1 = findMirror(bazClassMembers, "method1");
Expect.isNotNull(method1, "method1 not found");
- Expect.stringEquals('method1', method1.simpleName(),
+ Expect.stringEquals('method1', method1.simpleName,
"Unexpected method simpleName");
- Expect.stringEquals('mirrors_helper.Baz.method1', method1.qualifiedName(),
+ Expect.stringEquals('mirrors_helper.Baz.method1', method1.qualifiedName,
"Unexpected method qualifiedName");
- Expect.equals(method1.surroundingDeclaration(), bazClass,
+ Expect.equals(method1.surroundingDeclaration, bazClass,
"Unexpected surrounding declaration");
Expect.isFalse(method1.isTopLevel, "Method is top level");
Expect.isFalse(method1.isConstructor, "Method is constructor");
@@ -351,7 +351,7 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isNull(method1.operatorName,
"Method operatorName is non-null");
- var dynamicType = method1.returnType();
+ var dynamicType = method1.returnType;
Expect.isNotNull(dynamicType, "Return type was null");
Expect.isFalse(dynamicType.isObject, "Dynamic is Object");
Expect.isTrue(dynamicType.isDynamic, "Dynamic is not Dynamic");
@@ -360,33 +360,33 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isFalse(dynamicType.isTypedef, "Dynamic is a typedef");
Expect.isFalse(dynamicType.isFunction, "Dynamic is a function");
- var method1Parameters = method1.parameters();
+ var method1Parameters = method1.parameters;
Expect.isNotNull(method1Parameters, "Method parameters is null");
Expect.equals(1, method1Parameters.length, "Unexpected parameter count");
var method1Parameter1 = method1Parameters[0];
Expect.isNotNull(method1Parameter1, "Parameter is null");
- Expect.equals(dynamicType, method1Parameter1.type());
- Expect.stringEquals("e", method1Parameter1.simpleName(),
+ Expect.equals(dynamicType, method1Parameter1.type);
+ Expect.stringEquals("e", method1Parameter1.simpleName,
"Unexpected parameter simpleName");
Expect.stringEquals("mirrors_helper.Baz.method1#e",
- method1Parameter1.qualifiedName(),
+ method1Parameter1.qualifiedName,
"Unexpected parameter qualifiedName");
- Expect.isFalse(method1Parameter1.hasDefaultValue(),
+ Expect.isFalse(method1Parameter1.hasDefaultValue,
"Parameter has default value");
- Expect.isNull(method1Parameter1.defaultValue(),
+ Expect.isNull(method1Parameter1.defaultValue,
"Parameter default value is non-null");
- Expect.isFalse(method1Parameter1.isOptional(), "Parameter is optional");
+ Expect.isFalse(method1Parameter1.isOptional, "Parameter is optional");
////////////////////////////////////////////////////////////////////////////
// static void method2(E e, [F f = null]) {}
////////////////////////////////////////////////////////////////////////////
var method2 = findMirror(bazClassMembers, "method2");
Expect.isNotNull(method2, "method2 not found");
- Expect.stringEquals('method2', method2.simpleName(),
+ Expect.stringEquals('method2', method2.simpleName,
"Unexpected method simpleName");
- Expect.stringEquals('mirrors_helper.Baz.method2', method2.qualifiedName(),
+ Expect.stringEquals('mirrors_helper.Baz.method2', method2.qualifiedName,
"Unexpected method qualifiedName");
- Expect.equals(method2.surroundingDeclaration(), bazClass,
+ Expect.equals(method2.surroundingDeclaration, bazClass,
"Unexpected surrounding declaration");
Expect.isFalse(method2.isTopLevel, "Method is top level");
Expect.isFalse(method2.isConstructor, "Method is constructor");
@@ -405,7 +405,7 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isNull(method2.operatorName,
"Method operatorName is non-null");
- var voidType = method2.returnType();
+ var voidType = method2.returnType;
Expect.isNotNull(voidType, "Return type was null");
Expect.isFalse(voidType.isObject, "void is Object");
Expect.isFalse(voidType.isDynamic, "void is Dynamic");
@@ -414,46 +414,46 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isFalse(voidType.isTypedef, "void is a typedef");
Expect.isFalse(voidType.isFunction, "void is a function");
- var method2Parameters = method2.parameters();
+ var method2Parameters = method2.parameters;
Expect.isNotNull(method2Parameters, "Method parameters is null");
Expect.equals(2, method2Parameters.length, "Unexpected parameter count");
var method2Parameter1 = method2Parameters[0];
Expect.isNotNull(method2Parameter1, "Parameter is null");
- Expect.equals(bazE, method2Parameter1.type());
- Expect.stringEquals("e", method2Parameter1.simpleName(),
+ Expect.equals(bazE, method2Parameter1.type);
+ Expect.stringEquals("e", method2Parameter1.simpleName,
"Unexpected parameter simpleName");
Expect.stringEquals("mirrors_helper.Baz.method2#e",
- method2Parameter1.qualifiedName(),
+ method2Parameter1.qualifiedName,
"Unexpected parameter qualifiedName");
- Expect.isFalse(method2Parameter1.hasDefaultValue(),
+ Expect.isFalse(method2Parameter1.hasDefaultValue,
"Parameter has default value");
- Expect.isNull(method2Parameter1.defaultValue(),
+ Expect.isNull(method2Parameter1.defaultValue,
"Parameter default value is non-null");
- Expect.isFalse(method2Parameter1.isOptional(), "Parameter is optional");
+ Expect.isFalse(method2Parameter1.isOptional, "Parameter is optional");
var method2Parameter2 = method2Parameters[1];
Expect.isNotNull(method2Parameter2, "Parameter is null");
- Expect.equals(bazF, method2Parameter2.type());
- Expect.stringEquals("f", method2Parameter2.simpleName(),
+ Expect.equals(bazF, method2Parameter2.type);
+ Expect.stringEquals("f", method2Parameter2.simpleName,
"Unexpected parameter simpleName");
Expect.stringEquals("mirrors_helper.Baz.method2#f",
- method2Parameter2.qualifiedName(),
+ method2Parameter2.qualifiedName,
"Unexpected parameter qualifiedName");
- Expect.isTrue(method2Parameter2.hasDefaultValue(),
+ Expect.isTrue(method2Parameter2.hasDefaultValue,
"Parameter has default value");
- Expect.stringEquals("null", method2Parameter2.defaultValue(),
+ Expect.stringEquals("null", method2Parameter2.defaultValue,
"Parameter default value is non-null");
- Expect.isTrue(method2Parameter2.isOptional(), "Parameter is not optional");
+ Expect.isTrue(method2Parameter2.isOptional, "Parameter is not optional");
////////////////////////////////////////////////////////////////////////////
// void method3(E func1(F f), Func<E,F> func2) {}
////////////////////////////////////////////////////////////////////////////
var method3 = findMirror(bazClassMembers, "method3");
Expect.isNotNull(method3, "method3 not found");
- Expect.stringEquals('method3', method3.simpleName(),
+ Expect.stringEquals('method3', method3.simpleName,
"Unexpected method simpleName");
- Expect.stringEquals('mirrors_helper.Baz.method3', method3.qualifiedName(),
+ Expect.stringEquals('mirrors_helper.Baz.method3', method3.qualifiedName,
"Unexpected method qualifiedName");
- Expect.equals(method3.surroundingDeclaration(), bazClass,
+ Expect.equals(method3.surroundingDeclaration, bazClass,
"Unexpected surrounding declaration");
Expect.isFalse(method3.isTopLevel, "Method is top level");
Expect.isFalse(method3.isConstructor, "Method is constructor");
@@ -472,49 +472,49 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isNull(method3.operatorName,
"Method operatorName is non-null");
- Expect.equals(voidType, method3.returnType(), "Return type is not void");
+ Expect.equals(voidType, method3.returnType, "Return type is not void");
- var method3Parameters = method3.parameters();
+ var method3Parameters = method3.parameters;
Expect.isNotNull(method3Parameters, "Method parameters is null");
Expect.equals(2, method3Parameters.length, "Unexpected parameter count");
var method3Parameter1 = method3Parameters[0];
Expect.isNotNull(method3Parameter1, "Parameter is null");
- var method3Parameter1type = method3Parameter1.type();
+ var method3Parameter1type = method3Parameter1.type;
Expect.isNotNull(method3Parameter1type, "Parameter type of 'func1' is null");
Expect.isTrue(method3Parameter1type is FunctionTypeMirror,
"Parameter type of 'func1' is not a function");
- Expect.equals(bazE, method3Parameter1type.returnType(),
+ Expect.equals(bazE, method3Parameter1type.returnType,
"Return type of 'func1' is not a E");
- Expect.isNotNull(method3Parameter1type.parameters(),
+ Expect.isNotNull(method3Parameter1type.parameters,
"Parameters of 'func1' is null");
- Expect.equals(1, method3Parameter1type.parameters().length,
+ Expect.equals(1, method3Parameter1type.parameters.length,
"Unexpected parameter count of 'func1'");
- Expect.equals(bazE, method3Parameter1type.returnType(),
+ Expect.equals(bazE, method3Parameter1type.returnType,
"Return type of 'func1' is not a E");
- Expect.isNotNull(method3Parameter1type.parameters()[0],
+ Expect.isNotNull(method3Parameter1type.parameters[0],
"Parameter 1 of 'func1' is null");
- Expect.stringEquals('f', method3Parameter1type.parameters()[0].simpleName(),
+ Expect.stringEquals('f', method3Parameter1type.parameters[0].simpleName,
"Unexpected name parameter 1 of 'func1'");
- Expect.equals(bazF, method3Parameter1type.parameters()[0].type(),
+ Expect.equals(bazF, method3Parameter1type.parameters[0].type,
"Argument type of 'func1' is not a F");
- Expect.stringEquals("func1", method3Parameter1.simpleName(),
+ Expect.stringEquals("func1", method3Parameter1.simpleName,
"Unexpected parameter simpleName");
Expect.stringEquals("mirrors_helper.Baz.method3#func1",
- method3Parameter1.qualifiedName(),
+ method3Parameter1.qualifiedName,
"Unexpected parameter qualifiedName");
- Expect.isFalse(method3Parameter1.hasDefaultValue(),
+ Expect.isFalse(method3Parameter1.hasDefaultValue,
"Parameter has default value");
- Expect.isNull(method3Parameter1.defaultValue(),
+ Expect.isNull(method3Parameter1.defaultValue,
"Parameter default value is non-null");
- Expect.isFalse(method3Parameter1.isOptional(), "Parameter is optional");
+ Expect.isFalse(method3Parameter1.isOptional, "Parameter is optional");
var method3Parameter2 = method3Parameters[1];
Expect.isNotNull(method3Parameter2, "Parameter is null");
- var funcTypedef = method3Parameter2.type();
+ var funcTypedef = method3Parameter2.type;
Expect.isNotNull(funcTypedef, "Parameter type is null");
- Expect.stringEquals("Func", funcTypedef.simpleName(),
+ Expect.stringEquals("Func", funcTypedef.simpleName,
"Unexpected simpleName");
- Expect.stringEquals("mirrors_helper.Func", funcTypedef.qualifiedName(),
+ Expect.stringEquals("mirrors_helper.Func", funcTypedef.qualifiedName,
"Unexpected simpleName");
Expect.isFalse(funcTypedef.isObject, "Typedef is Object");
Expect.isFalse(funcTypedef.isDynamic, "Typedef is Dynamic");
@@ -523,16 +523,16 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isTrue(funcTypedef.isTypedef, "Typedef is not a typedef");
Expect.isFalse(funcTypedef.isFunction, "Typedef is a function");
- Expect.equals(helperLibrary, funcTypedef.library(),
+ Expect.equals(helperLibrary, funcTypedef.library,
"Unexpected typedef library");
- Expect.isNull(funcTypedef.superclass(), "Non-null superclass on typedef");
- Expect.isNotNull(funcTypedef.interfaces(),
+ Expect.isNull(funcTypedef.superclass, "Non-null superclass on typedef");
+ Expect.isNotNull(funcTypedef.interfaces,
"Null interfaces map on typedef");
- Expect.isTrue(funcTypedef.interfaces().isEmpty(),
+ Expect.isTrue(funcTypedef.interfaces.isEmpty(),
"Non-empty interfaces map on typedef");
- Expect.isNotNull(funcTypedef.declaredMembers(),
+ Expect.isNotNull(funcTypedef.declaredMembers,
"Declared members map is null on type def");
- Expect.isTrue(funcTypedef.declaredMembers().isEmpty(),
+ Expect.isTrue(funcTypedef.declaredMembers.isEmpty(),
"Non-empty declared members map on typedef");
// TODO(johnniwinther): Returned typedef should not be the declaration:
@@ -540,43 +540,43 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isFalse(funcTypedef.isClass, "Typedef is class");
Expect.isFalse(funcTypedef.isInterface, "Typedef is interface");
Expect.isFalse(funcTypedef.isPrivate, "Typedef is private");
- Expect.isNull(funcTypedef.defaultType(),
+ Expect.isNull(funcTypedef.defaultType,
"Typedef default type is non-null");
// TODO(johnniwinther): Should not throw an exception since the type should
// not be the declaration.
- Expect.throws(() => funcTypedef.typeArguments(),
+ Expect.throws(() => funcTypedef.typeArguments,
(exception) => true,
"Typedef has type arguments");
- Expect.isNotNull(funcTypedef.typeVariables(), "Type variables is null");
+ Expect.isNotNull(funcTypedef.typeVariables, "Type variables is null");
// TODO(johnniwinther): Should return a non-empty map.
- Expect.isTrue(funcTypedef.typeVariables().isEmpty(),
+ Expect.isTrue(funcTypedef.typeVariables.isEmpty(),
"Type variables is non-empty");
// TODO(johnniwinther): Provide access to the definition type.
- Expect.isNull(funcTypedef.definition(), "Typedef definition is not null");
+ Expect.isNull(funcTypedef.definition, "Typedef definition is not null");
- Expect.stringEquals("func2", method3Parameter2.simpleName(),
+ Expect.stringEquals("func2", method3Parameter2.simpleName,
"Unexpected parameter simpleName");
Expect.stringEquals("mirrors_helper.Baz.method3#func2",
- method3Parameter2.qualifiedName(),
+ method3Parameter2.qualifiedName,
"Unexpected parameter qualifiedName");
- Expect.isFalse(method3Parameter2.hasDefaultValue(),
+ Expect.isFalse(method3Parameter2.hasDefaultValue,
"Parameter 'func2' has default value: "
- "${method3Parameter2.defaultValue()}");
- Expect.isNull(method3Parameter2.defaultValue(),
+ "${method3Parameter2.defaultValue}");
+ Expect.isNull(method3Parameter2.defaultValue,
"Parameter default value is non-null");
- Expect.isFalse(method3Parameter2.isOptional(), "Parameter is optional");
+ Expect.isFalse(method3Parameter2.isOptional, "Parameter is optional");
////////////////////////////////////////////////////////////////////////////
// bool operator==(Object other) => return false;
////////////////////////////////////////////////////////////////////////////
var operator_eq = findMirror(bazClassMembers, "operator", operatorName: '==');
Expect.isNotNull(operator_eq, "operator == not found");
- Expect.stringEquals('operator', operator_eq.simpleName(),
+ Expect.stringEquals('operator', operator_eq.simpleName,
"Unexpected method simpleName");
Expect.stringEquals('mirrors_helper.Baz.operator ==',
- operator_eq.qualifiedName(),
+ operator_eq.qualifiedName,
"Unexpected method qualifiedName");
- Expect.equals(operator_eq.surroundingDeclaration(), bazClass,
+ Expect.equals(operator_eq.surroundingDeclaration, bazClass,
"Unexpected surrounding declaration");
Expect.isFalse(operator_eq.isTopLevel, "Method is top level");
Expect.isFalse(operator_eq.isConstructor, "Method is constructor");
@@ -601,12 +601,12 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
var operator_negate = findMirror(bazClassMembers, "operator",
operatorName: 'negate');
Expect.isNotNull(operator_negate, "operator < not found");
- Expect.stringEquals('operator', operator_negate.simpleName(),
+ Expect.stringEquals('operator', operator_negate.simpleName,
"Unexpected method simpleName");
Expect.stringEquals('mirrors_helper.Baz.operator negate',
- operator_negate.qualifiedName(),
+ operator_negate.qualifiedName,
"Unexpected method qualifiedName");
- Expect.equals(operator_negate.surroundingDeclaration(), bazClass,
+ Expect.equals(operator_negate.surroundingDeclaration, bazClass,
"Unexpected surrounding declaration");
Expect.isFalse(operator_negate.isTopLevel, "Method is top level");
Expect.isFalse(operator_negate.isConstructor, "Method is constructor");
@@ -627,7 +627,7 @@ void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
"Unexpected operatorName");
- var bazClassConstructors = bazClass.constructors();
+ var bazClassConstructors = bazClass.constructors;
Expect.isNotNull(bazClassConstructors, "Constructors map is null");
Expect.equals(3, bazClassConstructors.length,
"Unexpected number of constructors");

Powered by Google App Engine
This is Rietveld 408576698