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

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

Issue 11967010: Internal libraries supported. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 c0af4bf09d038b30e783aab7607d3964f8f58072..2429763f877f5af97c9cd6c6a843cf3d387993f9 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -223,18 +223,20 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
}
registerElement(Element element) {
- if (element.isFunction() || element.isGetter() || element.isSetter()) {
- handleMethodAnnotations(element);
- if (element.isNative()) {
- registerMethodUsed(element);
- }
- } else if (element.isField()) {
- handleFieldAnnotations(element);
- if (element.isNative()) {
- registerFieldLoad(element);
- registerFieldStore(element);
+ compiler.withCurrentElement(element, () {
+ if (element.isFunction() || element.isGetter() || element.isSetter()) {
+ handleMethodAnnotations(element);
+ if (element.isNative()) {
+ registerMethodUsed(element);
+ }
+ } else if (element.isField()) {
+ handleFieldAnnotations(element);
+ if (element.isNative()) {
+ registerFieldLoad(element);
+ registerFieldStore(element);
+ }
}
- }
+ });
}
handleFieldAnnotations(Element element) {
@@ -449,9 +451,8 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase {
}
void maybeEnableNative(Compiler compiler,
- LibraryElement library,
- Uri uri) {
- String libraryName = uri.toString();
+ LibraryElement library) {
+ String libraryName = library.uri.toString();
if (library.entryCompilationUnit.script.name.contains(
'dart/tests/compiler/dart2js_native')
|| libraryName == 'dart:async'

Powered by Google App Engine
This is Rietveld 408576698