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

Unified Diff: pkg/compiler/lib/src/native/enqueue.dart

Issue 1318043005: Support user generated custom native JS classes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal Created 5 years, 3 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: pkg/compiler/lib/src/native/enqueue.dart
diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
index 1f9b47b5d070e8b23178b0a348399a3fd4ea1bf6..18ef9d0bacdfa2e1edea3d04342964d8b816d11e 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -139,6 +139,7 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
if (backend.isolateHelperLibrary != null) {
processNativeClassesInLibrary(backend.isolateHelperLibrary);
}
+ libraries.forEach(processJsInteropAnnotationsInLibrary);
processSubclassesOfNativeClasses(libraries);
if (!enableLiveTypeAnalysis) {
nativeClasses.forEach((c) => enqueueClass(c, 'forced'));
@@ -146,6 +147,13 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
}
}
+ void processJsInteropAnnotationsInLibrary(LibraryElement library) {
+ checkJsInteropAnnotation(compiler, library);
+ library.implementation.forEachLocalMember((Element element) {
+ checkJsInteropAnnotation(compiler, element);
+ });
+ }
+
void processNativeClassesInLibrary(LibraryElement library) {
// Use implementation to ensure the inclusion of injected members.
library.implementation.forEachLocalMember((Element element) {
@@ -608,6 +616,8 @@ class NativeResolutionEnqueuer extends NativeEnqueuerBase {
void processNativeClass(ClassElement classElement) {
super.processNativeClass(classElement);
+ // Js Interop interfaces do not have tags.
+ if (classElement.isJsInterop) return;
// Since we map from dispatch tags to classes, a dispatch tag must be used
// on only one native class.
for (String tag in nativeTagsOfClass(classElement)) {

Powered by Google App Engine
This is Rietveld 408576698