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

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

Issue 1151163004: Implementation of null-aware operators. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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/dart2js.dart ('k') | pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/elements.dart
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index 6dab617092caeaa3eedb7790dd9680afcd9fd7cd..87d13555fb5eb4d3389b963ea327c4c2ad3a24df 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -532,7 +532,9 @@ class Elements {
static bool isInstanceSend(Send send, TreeElements elements) {
Element element = elements[send];
if (element == null) return !isClosureSend(send, element);
- return isInstanceMethod(element) || isInstanceField(element);
+ return isInstanceMethod(element) ||
+ isInstanceField(element) ||
+ send.isConditional;
}
static bool isClosureSend(Send send, Element element) {
@@ -640,7 +642,7 @@ class Elements {
static String constructOperatorNameOrNull(String op, bool isUnary) {
if (isMinusOperator(op)) {
return isUnary ? 'unary-' : op;
- } else if (isUserDefinableOperator(op)) {
+ } else if (isUserDefinableOperator(op) || op == '??') {
return op;
} else {
return null;
@@ -666,6 +668,7 @@ class Elements {
if (identical(op, '&=')) return '&';
if (identical(op, '^=')) return '^';
if (identical(op, '|=')) return '|';
+ if (identical(op, '??=')) return '??';
return null;
}
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698