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

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: Rebased 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 f0c82013a66f3118a424fe816480dfbae1461e03..2eaa4af5f13df4d43059ebf794b00f8d0f6d48a7 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -224,18 +224,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) {
@@ -450,9 +452,8 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase {
}
void maybeEnableNative(Compiler compiler,
- LibraryElement library,
- Uri uri) {
- String libraryName = uri.toString();
+ LibraryElement library) {
+ String libraryName = library.canonicalUri.toString();
if (library.entryCompilationUnit.script.name.contains(
'dart/tests/compiler/dart2js_native')
|| libraryName == 'dart:async'

Powered by Google App Engine
This is Rietveld 408576698