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

Unified Diff: pkg/compiler/lib/src/universe/selector.dart

Issue 2865693002: Create closed world for hello world using .dill file (Closed)
Patch Set: Created 3 years, 7 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/universe/selector.dart
diff --git a/pkg/compiler/lib/src/universe/selector.dart b/pkg/compiler/lib/src/universe/selector.dart
index 00ebc0ba2874389a865909f47f786a26223f1eda..75d54109f3e2f06647173995e467bc939d04a37d 100644
--- a/pkg/compiler/lib/src/universe/selector.dart
+++ b/pkg/compiler/lib/src/universe/selector.dart
@@ -9,6 +9,7 @@ import '../common/names.dart' show Names;
import '../elements/elements.dart'
show Element, Elements, FunctionSignature, Name, PublicName;
import '../elements/entities.dart';
+import '../resolution/operators.dart';
import '../util/util.dart' show Hashing;
import 'call_structure.dart' show CallStructure;
@@ -52,6 +53,18 @@ class Selector {
LibraryEntity get library => memberName.library;
+ static bool isOperatorName(String name) {
+ if (name == Names.INDEX_SET_NAME.text) {
+ return true;
+ } else if (name == UnaryOperator.NEGATE.selectorName) {
+ return true;
+ } else if (name == UnaryOperator.COMPLEMENT.selectorName) {
+ return true;
+ } else {
+ return BinaryOperator.parseUserDefinable(name) != null;
+ }
+ }
+
Selector.internal(
this.kind, this.memberName, this.callStructure, this.hashCode) {
assert(invariant(
@@ -65,7 +78,7 @@ class Selector {
NO_LOCATION_SPANNABLE,
kind == SelectorKind.OPERATOR ||
kind == SelectorKind.INDEX ||
- !Elements.isOperatorName(memberName.text) ||
+ !isOperatorName(memberName.text) ||
memberName.text == '??',
message: "kind=$kind,memberName=$memberName,"
"callStructure:$callStructure"));
@@ -74,7 +87,7 @@ class Selector {
kind == SelectorKind.CALL ||
kind == SelectorKind.GETTER ||
kind == SelectorKind.SETTER ||
- Elements.isOperatorName(memberName.text) ||
+ isOperatorName(memberName.text) ||
memberName.text == '??',
message: "kind=$kind,memberName=$memberName,"
"callStructure:$callStructure"));

Powered by Google App Engine
This is Rietveld 408576698