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

Unified Diff: sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 266913017: Convert property methods into getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 6 years, 7 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: sdk/lib/_internal/compiler/implementation/native_handler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart
index 20d082f52ba704adcfb6d90b65c10b39ece02092..3db15c9a703e42df106e9709e1f8f1d4f04aaf96 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -137,7 +137,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
void processNativeClassesInLibrary(LibraryElement library) {
// Use implementation to ensure the inclusion of injected members.
library.implementation.forEachLocalMember((Element element) {
- if (element.isClass() && element.isNative()) {
+ if (element.isClass && element.isNative) {
processNativeClass(element);
}
});
@@ -161,7 +161,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
libraries.forEach((library) {
library.implementation.forEachLocalMember((element) {
- if (element.isClass()) {
+ if (element.isClass) {
String name = element.name;
String extendsName = findExtendsNameOfClass(element);
if (extendsName != null) {
@@ -180,7 +180,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
// fact a subclass of a native class.
ClassElement nativeSuperclassOf(ClassElement classElement) {
- if (classElement.isNative()) return classElement;
+ if (classElement.isNative) return classElement;
if (classElement.superclass == null) return null;
return nativeSuperclassOf(classElement.superclass);
}
@@ -191,7 +191,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
ClassElement nativeSuperclass = nativeSuperclassOf(element);
if (nativeSuperclass != null) {
nativeClassesAndSubclasses.add(element);
- if (!element.isNative()) {
+ if (!element.isNative) {
nonNativeSubclasses.putIfAbsent(nativeSuperclass,
() => new Set<ClassElement>())
.add(element);
@@ -264,7 +264,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
}
return compiler.withCurrentElement(classElement, () {
- return scanForExtendsName(classElement.position());
+ return scanForExtendsName(classElement.position);
});
}
@@ -368,14 +368,14 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
registerElement(Element element) {
compiler.withCurrentElement(element, () {
- if (element.isFunction() || element.isGetter() || element.isSetter()) {
+ if (element.isFunction || element.isGetter || element.isSetter) {
handleMethodAnnotations(element);
- if (element.isNative()) {
+ if (element.isNative) {
registerMethodUsed(element);
}
- } else if (element.isField()) {
+ } else if (element.isField) {
handleFieldAnnotations(element);
- if (element.isNative()) {
+ if (element.isNative) {
registerFieldLoad(element);
registerFieldStore(element);
}
@@ -384,12 +384,12 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
}
handleFieldAnnotations(Element element) {
- if (element.enclosingElement.isNative()) {
+ if (element.enclosingElement.isNative) {
// Exclude non-instance (static) fields - they not really native and are
// compiled as isolate globals. Access of a property of a constructor
// function or a non-method property in the prototype chain, must be coded
// using a JS-call.
- if (element.isInstanceMember()) {
+ if (element.isInstanceMember) {
setNativeName(element);
}
}
@@ -410,7 +410,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
}
bool isNativeMethod(Element element) {
- if (!element.getLibrary().canUseNative) return false;
+ if (!element.library.canUseNative) return false;
// Native method?
return compiler.withCurrentElement(element, () {
Node node = element.parseNode(compiler);
@@ -596,7 +596,7 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase {
}
void addSubtypes(ClassElement cls, NativeEmitter emitter) {
- if (!cls.isNative()) return;
+ if (!cls.isNative) return;
if (doneAddSubtypes.contains(cls)) return;
doneAddSubtypes.add(cls);
@@ -616,7 +616,7 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase {
// natives classes.
ClassElement superclass = cls.superclass;
while (superclass != null && superclass.isMixinApplication) {
- assert(!superclass.isNative());
+ assert(!superclass.isNative);
superclass = superclass.superclass;
}
@@ -991,7 +991,7 @@ class NativeBehavior {
}
void checkAllowedLibrary(ElementListener listener, Token token) {
- LibraryElement currentLibrary = listener.compilationUnitElement.getLibrary();
+ LibraryElement currentLibrary = listener.compilationUnitElement.library;
if (!currentLibrary.canUseNative) {
listener.recoverableError(token, "Unexpected token");
}
@@ -1112,8 +1112,8 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
// 3) foo() native "return 42";
// hasBody = true
bool hasBody = false;
- assert(element.isNative());
- String nativeMethodName = element.fixedBackendName();
+ assert(element.isNative);
+ String nativeMethodName = element.fixedBackendName;
if (nativeBody != null) {
LiteralString jsCode = nativeBody.asLiteralString();
String str = jsCode.dartString.slowToString();
@@ -1133,7 +1133,7 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
List<String> arguments = <String>[];
List<HInstruction> inputs = <HInstruction>[];
String receiver = '';
- if (element.isInstanceMember()) {
+ if (element.isInstanceMember) {
receiver = '#.';
inputs.add(builder.localsHandler.readThis());
}

Powered by Google App Engine
This is Rietveld 408576698