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

Unified Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart

Issue 2424553002: Fix custom elements in startup emitter (Closed)
Patch Set: Created 4 years, 2 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 | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
index 3d4e9ba4fa4ccbde30f52b50d2c6c02ae2781c3e..57e10a27476da1f9ba1acc929d562460215bdb17 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
@@ -1333,7 +1333,7 @@ class FragmentEmitter {
Map<String, js.Expression> interceptorsByTag = <String, js.Expression>{};
Map<String, js.Expression> leafTags = <String, js.Expression>{};
- js.Statement subclassAssignment = new js.EmptyStatement();
+ List<js.Statement> subclassAssignments = <js.Statement>[];
for (Library library in fragment.libraries) {
for (Class cls in library.classes) {
@@ -1350,15 +1350,15 @@ class FragmentEmitter {
}
if (cls.nativeExtensions != null) {
List<Class> subclasses = cls.nativeExtensions;
- js.Expression value = js.string(cls.nativeNonLeafTags[0]);
+ js.Expression base = js.string(cls.nativeNonLeafTags[0]);
+
for (Class subclass in subclasses) {
- value = js.js('#.# = #', [
+ subclassAssignments.add(js.js.statement('#.# = #;', [
classReference(subclass),
NATIVE_SUPERCLASS_TAG_NAME,
- js.string(cls.nativeNonLeafTags[0])
- ]);
+ base
+ ]));
}
- subclassAssignment = new js.ExpressionStatement(value);
}
}
}
@@ -1367,7 +1367,7 @@ class FragmentEmitter {
js.objectLiteral(interceptorsByTag)));
statements.add(
js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags)));
- statements.add(subclassAssignment);
+ statements.addAll(subclassAssignments);
return new js.Block(statements);
}
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698