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

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

Issue 2925263002: A step towards handling `new Object()` in compile_from_dill_test (Closed)
Patch Set: Created 3 years, 6 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/runtime_type_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
index ac562b6988635cf0d5fb78c6bf2aa10ff1379540..e2689ed1bd4df4227699efde574f10b567ff7f45 100644
--- a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
@@ -12,6 +12,7 @@ import '../elements/resolution_types.dart'
show ResolutionDartType, ResolutionFunctionType, ResolutionInterfaceType;
import '../elements/elements.dart'
show ClassElement, Element, FunctionElement, MixinApplicationElement;
+import '../elements/entities.dart';
import '../js/js.dart' as jsAst;
import '../js/js.dart' show js;
import '../js_backend/js_interop_analysis.dart';
@@ -97,11 +98,14 @@ class RuntimeTypeGenerator {
/// type (if class has one) in the metadata object and stores its index in
/// the result. This is only possible for function types that do not contain
/// type variables.
- TypeTestProperties generateIsTests(ClassElement classElement,
+ TypeTestProperties generateIsTests(ClassEntity cls,
{bool storeFunctionTypeInMetadata: true}) {
- assert(classElement.isDeclaration, failedAt(classElement));
-
TypeTestProperties result = new TypeTestProperties();
+ if (cls is! ClassElement) return result;
+
+ // TODO(johnniwinther): Handle class entities.
+ ClassElement classElement = cls;
+ assert(classElement.isDeclaration, failedAt(classElement));
/// Generates an is-test if the test is not inherited from a superclass
/// This assumes that for every class an is-tests is generated

Powered by Google App Engine
This is Rietveld 408576698