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

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

Issue 2970943002: Use index in J/KTypeVariable and fix remaining inequivalence (Closed)
Patch Set: Fix Created 3 years, 5 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 | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common_elements.dart
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index 379e9c8ba2922db9ee8ba59b4a985287c5009780..580935ed9c6c8cae97da7357fa2eabdefaedd99d 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -5,6 +5,7 @@
// TODO(sigmund): rename and move to common/elements.dart
library dart2js.type_system;
+import 'common.dart';
import 'common/names.dart' show Identifiers, Uris;
import 'constants/values.dart';
import 'elements/entities.dart';
@@ -1161,6 +1162,17 @@ class CommonElements {
_ensureExpectAnnotations();
return _expectAssumeDynamicClass;
}
+
+ /// Returns `true` if the implementation of the 'operator ==' [function] is
+ /// known to handle `null` as argument.
+ bool operatorEqHandlesNullArgument(FunctionEntity function) {
+ assert(function.name == '==',
+ failedAt(function, "Unexpected function $function."));
+ ClassEntity cls = function.enclosingClass;
+ return cls == objectClass ||
+ cls == jsInterceptorClass ||
+ cls == jsNullClass;
+ }
}
/// Interface for accessing libraries, classes and members.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698