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

Unified Diff: pkg/compiler/lib/src/world.dart

Issue 2307883002: Fix type masks for js-interop types. (Closed)
Patch Set: Update status Created 4 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/world.dart
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index 87090deb797ef77020dc2caf090676d0e593a610..527240fff429725ac943e76c06bf144aa4986778 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -18,6 +18,7 @@ import 'elements/elements.dart'
MixinApplicationElement,
TypedefElement,
VariableElement;
+import 'js_backend/backend.dart' show JavaScriptBackend;
import 'ordered_typeset.dart';
import 'types/masks.dart' show TypeMask, FlatTypeMask;
import 'universe/class_set.dart';
@@ -405,6 +406,9 @@ class World implements ClassWorld {
@override
ClassElement getLubOfInstantiatedSubclasses(ClassElement cls) {
+ if (backend.isJsInterop(cls)) {
+ return backend.helpers.jsJavaScriptObjectClass;
+ }
ClassHierarchyNode hierarchy = _classHierarchyNodes[cls.declaration];
return hierarchy != null
? hierarchy.getLubOfInstantiatedSubclasses()
@@ -413,6 +417,9 @@ class World implements ClassWorld {
@override
ClassElement getLubOfInstantiatedSubtypes(ClassElement cls) {
+ if (backend.isJsInterop(cls)) {
+ return backend.helpers.jsJavaScriptObjectClass;
+ }
ClassSet classSet = _classSets[cls.declaration];
return classSet != null ? classSet.getLubOfInstantiatedSubtypes() : null;
}
@@ -548,7 +555,7 @@ class World implements ClassWorld {
}
final Compiler compiler;
- Backend get backend => compiler.backend;
+ JavaScriptBackend get backend => compiler.backend;
final FunctionSet allFunctions;
final Set<Element> functionsCalledInLoop = new Set<Element>();
final Map<Element, SideEffects> sideEffects = new Map<Element, SideEffects>();
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_members.dart ('k') | tests/compiler/dart2js/jsinterop/abstract_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698