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

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

Issue 2865693002: Create closed world for hello world using .dill file (Closed)
Patch Set: Updated cf. comments. 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 2bc426950debc213b15a71f2540c261443e9407a..ab0ea4ec14f89c624333ade95b7f4e398789c3b0 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;
import '../elements/entities.dart';
import '../elements/names.dart';
+import '../elements/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"));
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_strategy.dart ('k') | tests/compiler/dart2js/analyze_test_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698