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

Unified Diff: pkg/compiler/lib/src/js_emitter/native_emitter.dart

Issue 957973006: dart2js: don't emit unneeded native info. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/js_emitter/native_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/native_emitter.dart b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
index 5749e7903fe34ba65a292e9a74be72a988352bf9..03759c607718a6289f08c1162ef28a6639fbd0f1 100644
--- a/pkg/compiler/lib/src/js_emitter/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
@@ -168,10 +168,14 @@ class NativeEmitter {
}
}
- // Add properties containing the information needed to construct maps used
- // by getNativeInterceptor and custom elements.
- if (compiler.enqueuer.codegen.nativeEnqueuer
- .hasInstantiatedNativeClasses()) {
+ Set<Class> unneededClasses = classes
+ .where((Class cls) => cls.isNative && !neededClasses.contains(cls))
+ .toSet();
+
+ // If native classes are emitted, add properties containing the information
+ // needed to construct maps used by getNativeInterceptor and custom
+ // elements.
+ if (classes.length != unneededClasses.length) {
floitsch 2015/02/26 18:12:12 Explain when/why this can happen. From what I und
zarah 2015/02/27 09:03:48 It happens in the case you mention, I am not compl
void generateClassInfo(Class cls) {
// Property has the form:
//
@@ -218,9 +222,7 @@ class NativeEmitter {
// (floitsch: was run on every native class.)
//assert(!classElement.hasBackendMembers);
- return classes
- .where((Class cls) => cls.isNative && !neededClasses.contains(cls))
- .toSet();
+ return unneededClasses;
}
/**

Powered by Google App Engine
This is Rietveld 408576698