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

Unified Diff: dart/lib/compiler/implementation/universe.dart

Issue 10892005: Revert "Support unary - operator." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 | « dart/lib/compiler/implementation/ssa/builder.dart ('k') | dart/pkg/dartdoc/mirrors/dart2js_mirror.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/universe.dart
diff --git a/dart/lib/compiler/implementation/universe.dart b/dart/lib/compiler/implementation/universe.dart
index 95677c991dad559598f5fc75e6a3155173ec70dc..d65df03c6fbe49bfbfe89b0d5d68d4be767cc18b 100644
--- a/dart/lib/compiler/implementation/universe.dart
+++ b/dart/lib/compiler/implementation/universe.dart
@@ -117,24 +117,16 @@ class Selector implements Hashable {
: this(SelectorKind.SETTER, name, library, 1);
Selector.unaryOperator(SourceString name)
- : this(SelectorKind.OPERATOR,
- Elements.constructOperatorName(name, true),
- null, 0);
+ : this(SelectorKind.OPERATOR, operatorName(name, true), null, 0);
Selector.binaryOperator(SourceString name)
- : this(SelectorKind.OPERATOR,
- Elements.constructOperatorName(name, false),
- null, 1);
+ : this(SelectorKind.OPERATOR, operatorName(name, false), null, 1);
Selector.index()
- : this(SelectorKind.INDEX,
- Elements.constructOperatorName(const SourceString("[]"), false),
- null, 1);
+ : this(SelectorKind.INDEX, indexName(), null, 1);
Selector.indexSet()
- : this(SelectorKind.INDEX,
- Elements.constructOperatorName(const SourceString("[]="), false),
- null, 2);
+ : this(SelectorKind.INDEX, indexSetName(), null, 2);
Selector.call(SourceString name,
LibraryElement library,
@@ -165,6 +157,16 @@ class Selector implements Hashable {
bool isUnaryOperator() => isOperator() && argumentCount == 0;
bool isBinaryOperator() => isOperator() && argumentCount == 1;
+ static SourceString operatorName(SourceString name, bool isUnary)
+ => Elements.constructOperatorName(
+ const SourceString('operator'), name, isUnary);
+
+ static SourceString indexName()
+ => operatorName(const SourceString('[]'), false);
+
+ static SourceString indexSetName()
+ => operatorName(const SourceString('[]='), false);
+
int hashCode() => argumentCount + 1000 * namedArguments.length;
int get namedArgumentCount => namedArguments.length;
int get positionalArgumentCount => argumentCount - namedArgumentCount;
« no previous file with comments | « dart/lib/compiler/implementation/ssa/builder.dart ('k') | dart/pkg/dartdoc/mirrors/dart2js_mirror.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698