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

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

Issue 383413003: Add @Native(...) annotation for native class names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 5 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart
index f01e964e510c102b25e6a3608f369ab65fb95766..97393bc1631083f89555bf3888acc5d048c7e99d 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -389,6 +389,13 @@ abstract class Backend {
return compiler.patchParser.patchLibrary(loader, patchUri, library);
}
}
+ if (library.canUseNative) {
+ library.forEachLocalMember((Element element) {
+ if (element.isClass) {
+ checkNativeAnnotation(compiler, element);
+ }
+ });
+ }
return new Future.value();
}
@@ -722,6 +729,9 @@ abstract class Compiler implements DiagnosticListener {
/// The constant for the [patch] variable defined in dart:_js_helper.
Constant patchConstant;
+ // TODO(johnniwinther): Move this to the JavaScriptBackend.
+ ClassElement nativeAnnotationClass;
+
// Initialized after symbolClass has been resolved.
FunctionElement symbolConstructor;
@@ -1118,6 +1128,8 @@ abstract class Compiler implements DiagnosticListener {
deferredLibraryClass = findRequiredElement(library, 'DeferredLibrary');
} else if (uri == DART_NATIVE_TYPED_DATA) {
typedDataClass = findRequiredElement(library, 'NativeTypedData');
+ } else if (uri == js_backend.JavaScriptBackend.DART_JS_HELPER) {
+ nativeAnnotationClass = findRequiredElement(library, 'Native');
}
return backend.onLibraryScanned(library, loader);
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698