| Index: sdk/lib/_internal/compiler/implementation/universe/universe.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/universe/universe.dart b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
|
| index 05a45eeed6a0d781a9045bee3e0b5ccff9037bee..a48e86f69c1395a33d698fe7a64f97a815ea6fc1 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/universe/universe.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
|
| @@ -187,7 +187,7 @@ class Selector {
|
|
|
| factory Selector.fromElement(Element element, Compiler compiler) {
|
| String name = element.name;
|
| - if (element.isFunction()) {
|
| + if (element.isFunction) {
|
| if (name == '[]') {
|
| return new Selector.index();
|
| } else if (name == '[]=') {
|
| @@ -208,14 +208,14 @@ class Selector {
|
| SelectorKind.OPERATOR, name, null, arity, namedArguments);
|
| } else {
|
| return new Selector.call(
|
| - name, element.getLibrary(), arity, namedArguments);
|
| + name, element.library, arity, namedArguments);
|
| }
|
| - } else if (element.isSetter()) {
|
| - return new Selector.setter(name, element.getLibrary());
|
| - } else if (element.isGetter()) {
|
| - return new Selector.getter(name, element.getLibrary());
|
| - } else if (element.isField()) {
|
| - return new Selector.getter(name, element.getLibrary());
|
| + } else if (element.isSetter) {
|
| + return new Selector.setter(name, element.library);
|
| + } else if (element.isGetter) {
|
| + return new Selector.getter(name, element.library);
|
| + } else if (element.isField) {
|
| + return new Selector.getter(name, element.library);
|
| } else {
|
| throw new SpannableAssertionFailure(
|
| element, "Can't get selector from $element");
|
| @@ -274,22 +274,22 @@ class Selector {
|
| factory Selector.callDefaultConstructor(LibraryElement library)
|
| => new Selector(SelectorKind.CALL, "", library, 0);
|
|
|
| - bool isGetter() => identical(kind, SelectorKind.GETTER);
|
| - bool isSetter() => identical(kind, SelectorKind.SETTER);
|
| - bool isCall() => identical(kind, SelectorKind.CALL);
|
| - bool isClosureCall() {
|
| + bool get isGetter => identical(kind, SelectorKind.GETTER);
|
| + bool get isSetter => identical(kind, SelectorKind.SETTER);
|
| + bool get isCall => identical(kind, SelectorKind.CALL);
|
| + bool get isClosureCall {
|
| String callName = Compiler.CALL_OPERATOR_NAME;
|
| - return isCall() && name == callName;
|
| + return isCall && name == callName;
|
| }
|
|
|
| - bool isIndex() => identical(kind, SelectorKind.INDEX) && argumentCount == 1;
|
| - bool isIndexSet() => identical(kind, SelectorKind.INDEX) && argumentCount == 2;
|
| + bool get isIndex => identical(kind, SelectorKind.INDEX) && argumentCount == 1;
|
| + bool get isIndexSet => identical(kind, SelectorKind.INDEX) && argumentCount == 2;
|
|
|
| - bool isOperator() => identical(kind, SelectorKind.OPERATOR);
|
| - bool isUnaryOperator() => isOperator() && argumentCount == 0;
|
| + bool get isOperator => identical(kind, SelectorKind.OPERATOR);
|
| + bool get isUnaryOperator => isOperator && argumentCount == 0;
|
|
|
| /** Check whether this is a call to 'assert'. */
|
| - bool isAssert() => isCall() && identical(name, "assert");
|
| + bool get isAssert => isCall && identical(name, "assert");
|
|
|
| int get namedArgumentCount => namedArguments.length;
|
| int get positionalArgumentCount => argumentCount - namedArgumentCount;
|
| @@ -302,16 +302,16 @@ class Selector {
|
| * The member name for invocation mirrors created from this selector.
|
| */
|
| String get invocationMirrorMemberName =>
|
| - isSetter() ? '$name=' : name;
|
| + isSetter ? '$name=' : name;
|
|
|
| int get invocationMirrorKind {
|
| const int METHOD = 0;
|
| const int GETTER = 1;
|
| const int SETTER = 2;
|
| int kind = METHOD;
|
| - if (isGetter()) {
|
| + if (isGetter) {
|
| kind = GETTER;
|
| - } else if (isSetter()) {
|
| + } else if (isSetter) {
|
| kind = SETTER;
|
| }
|
| return kind;
|
| @@ -325,17 +325,17 @@ class Selector {
|
| bool appliesUntyped(Element element, Compiler compiler) {
|
| assert(sameNameHack(element, compiler));
|
| if (Elements.isUnresolved(element)) return false;
|
| - if (isPrivateName(name) && library != element.getLibrary()) return false;
|
| + if (isPrivateName(name) && library != element.library) return false;
|
| if (element.isForeign(compiler)) return true;
|
| - if (element.isSetter()) return isSetter();
|
| - if (element.isGetter()) return isGetter() || isCall();
|
| - if (element.isField()) {
|
| - return isSetter()
|
| - ? !element.modifiers.isFinalOrConst()
|
| - : isGetter() || isCall();
|
| + if (element.isSetter) return isSetter;
|
| + if (element.isGetter) return isGetter || isCall;
|
| + if (element.isField) {
|
| + return isSetter
|
| + ? !element.modifiers.isFinalOrConst
|
| + : isGetter || isCall;
|
| }
|
| - if (isGetter()) return true;
|
| - if (isSetter()) return false;
|
| + if (isGetter) return true;
|
| + if (isSetter) return false;
|
| return signatureApplies(element, compiler);
|
| }
|
|
|
| @@ -375,7 +375,7 @@ class Selector {
|
| bool sameNameHack(Element element, Compiler compiler) {
|
| // TODO(ngeoffray): Remove workaround checks.
|
| return element == compiler.assertMethod
|
| - || element.isConstructor()
|
| + || element.isConstructor
|
| || name == element.name;
|
| }
|
|
|
| @@ -506,7 +506,7 @@ class Selector {
|
| signature.optionalParameters.toList().map((e) => e.name).toList();
|
| }
|
| Selector selector = new Selector.call(callee.name,
|
| - caller.getLibrary(),
|
| + caller.library,
|
| signature.parameterCount,
|
| namedParameters);
|
|
|
| @@ -660,14 +660,14 @@ class TypedSelector extends Selector {
|
| assert(sameNameHack(element, compiler));
|
| // [TypedSelector] are only used after resolution.
|
| assert(compiler.phase > Compiler.PHASE_RESOLVING);
|
| - if (!element.isMember()) return false;
|
| + if (!element.isMember) return false;
|
|
|
| // A closure can be called through any typed selector:
|
| // class A {
|
| // get foo => () => 42;
|
| // bar() => foo(); // The call to 'foo' is a typed selector.
|
| // }
|
| - if (element.getEnclosingClass().isClosure()) {
|
| + if (element.enclosingClass.isClosure) {
|
| return appliesUntyped(element, compiler);
|
| }
|
|
|
|
|