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

Unified Diff: pkg/compiler/lib/src/resolution/send_resolver.dart

Issue 1157333003: Compute more SendStructures on ResolverVisitor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Check for explicit this property access. Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/resolved_visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/send_resolver.dart
diff --git a/pkg/compiler/lib/src/resolution/send_resolver.dart b/pkg/compiler/lib/src/resolution/send_resolver.dart
index cbee33c05956d56abb23a35a3c577aaebc3c0942..5910234a3252c6f13811bf11d901444710070896 100644
--- a/pkg/compiler/lib/src/resolution/send_resolver.dart
+++ b/pkg/compiler/lib/src/resolution/send_resolver.dart
@@ -269,33 +269,17 @@ abstract class SendResolverMixin {
if (node.isOperator) {
String operatorText = node.selector.asOperator().source;
if (node.arguments.isEmpty) {
- unaryOperator = UnaryOperator.parse(operatorText);
- if (unaryOperator != null) {
- switch (unaryOperator.kind) {
- case UnaryOperatorKind.NOT:
- kind = SendStructureKind.NOT;
- break;
- default:
- kind = SendStructureKind.UNARY;
- break;
- }
- } else {
- return const InvalidUnaryStructure();
- }
+ return internalError(node, "Unexpected unary $operatorText.");
} else {
binaryOperator = BinaryOperator.parse(operatorText);
if (binaryOperator != null) {
switch (binaryOperator.kind) {
case BinaryOperatorKind.EQ:
kind = SendStructureKind.EQ;
- break;
+ return internalError(node, "Unexpected binary $kind.");
case BinaryOperatorKind.NOT_EQ:
- if (node.isSuperCall) {
- // `super != foo` is a compile-time error.
- return const InvalidBinaryStructure();
- }
kind = SendStructureKind.NOT_EQ;
- break;
+ return internalError(node, "Unexpected binary $kind.");
case BinaryOperatorKind.INDEX:
if (node.isPrefix) {
kind = SendStructureKind.INDEX_PREFIX;
@@ -304,6 +288,7 @@ abstract class SendResolverMixin {
} else if (node.arguments.tail.isEmpty) {
// a[b]
kind = SendStructureKind.INDEX;
+ return internalError(node, "Unexpected binary $kind.");
} else {
if (kind == SendStructureKind.COMPOUND) {
// a[b] += c
@@ -316,10 +301,11 @@ abstract class SendResolverMixin {
break;
default:
kind = SendStructureKind.BINARY;
- break;
+ return internalError(node, "Unexpected binary $kind.");
}
} else {
- return const InvalidBinaryStructure();
+ return internalError(
+ node, "Unexpected invalid binary $operatorText.");
}
}
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/resolved_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698