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

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

Issue 11299220: Add @JSName annotation for native fields and methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix _NodeList Created 8 years, 1 month 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/elements/elements.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index b521f1b1641f1725c6f7ef13ab99f1c4d089f6bf..7d82d36ab60bddf04b925b9259fc2a7953e2eff3 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -355,9 +355,11 @@ class Element implements Spannable {
}
}
- bool _isNative = false;
- void setNative() { _isNative = true; }
- bool isNative() => _isNative;
+ String _nativeName = null;
+ bool isNative() => _nativeName != null;
+ String nativeName() => _nativeName;
+ /// Marks this element as a native element.
+ void setNative(String name) { _nativeName = name; }
FunctionElement asFunctionElement() => null;
@@ -1387,7 +1389,7 @@ abstract class ClassElement extends ScopeContainerElement
DartType supertype;
DartType defaultClass;
Link<DartType> interfaces;
- SourceString nativeName;
+ SourceString nativeTagInfo;
int supertypeLoadState;
int resolutionState;
@@ -1724,7 +1726,7 @@ abstract class ClassElement extends ScopeContainerElement
}
bool isInterface() => false;
- bool isNative() => nativeName != null;
+ bool isNative() => nativeTagInfo != null;
int get hashCode => id;
Scope buildScope() => new ClassScope(enclosingElement.buildScope(), this);

Powered by Google App Engine
This is Rietveld 408576698