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

Unified Diff: pkg/compiler/lib/src/js_backend/js_interop_analysis.dart

Issue 2814453005: Merge CommonElements and BackendHelpers! (Closed)
Patch Set: comments and re-merge, take two Created 3 years, 8 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_backend/js_interop_analysis.dart
diff --git a/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart b/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart
index 3b5a1195477275427afefb1bdd41a6ba67b08794..480b75d87ad4ac7a31951aa895749aafdc75a3c9 100644
--- a/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart
@@ -25,7 +25,6 @@ import '../js/js.dart' as jsAst;
import '../js/js.dart' show js;
import '../universe/selector.dart' show Selector;
import '../universe/world_builder.dart' show SelectorConstraints;
-import 'backend_helpers.dart' show BackendHelpers;
import 'js_backend.dart' show JavaScriptBackend;
class JsInteropAnalysis {
@@ -40,13 +39,11 @@ class JsInteropAnalysis {
JsInteropAnalysis(this.backend);
- BackendHelpers get helpers => backend.helpers;
-
void onQueueClosed() {
if (_inCodegen) return;
- if (helpers.jsAnnotationClass != null) {
- ClassElement cls = helpers.jsAnnotationClass;
+ if (backend.compiler.commonElements.jsAnnotationClass != null) {
+ ClassElement cls = backend.compiler.commonElements.jsAnnotationClass;
nameField = cls.lookupMember('name');
backend.compiler.libraryLoader.libraries
.forEach(processJsInteropAnnotationsInLibrary);
@@ -67,7 +64,8 @@ class JsInteropAnalysis {
backend.compiler.constants.getConstantValue(annotation.constant);
if (constant == null || constant is! ConstructedConstantValue) continue;
ConstructedConstantValue constructedConstant = constant;
- if (constructedConstant.type.element == helpers.jsAnnotationClass) {
+ if (constructedConstant.type.element ==
+ backend.compiler.commonElements.jsAnnotationClass) {
ConstantValue value = constructedConstant.fields[nameField];
String name;
if (value.isString) {
@@ -85,7 +83,7 @@ class JsInteropAnalysis {
}
bool hasAnonymousAnnotation(Element element) {
- if (backend.helpers.jsAnonymousClass == null) return false;
+ if (backend.compiler.commonElements.jsAnonymousClass == null) return false;
return element.metadata.any((MetadataAnnotation annotation) {
ConstantValue constant =
backend.compiler.constants.getConstantValue(annotation.constant);
@@ -93,7 +91,7 @@ class JsInteropAnalysis {
return false;
ConstructedConstantValue constructedConstant = constant;
return constructedConstant.type.element ==
- backend.helpers.jsAnonymousClass;
+ backend.compiler.commonElements.jsAnonymousClass;
});
}
@@ -142,7 +140,8 @@ class JsInteropAnalysis {
return;
}
- if (!classElement.implementsInterface(helpers.jsJavaScriptObjectClass)) {
+ if (!classElement.implementsInterface(
+ backend.compiler.commonElements.jsJavaScriptObjectClass)) {
backend.reporter.reportErrorMessage(classElement,
MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, {
'cls': classElement.name,
« no previous file with comments | « pkg/compiler/lib/src/js_backend/interceptor_data.dart ('k') | pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698