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

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

Issue 1160833003: Add support for null-aware operators to the CPS-IR. (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
Index: pkg/compiler/lib/src/resolution/operators.dart
diff --git a/pkg/compiler/lib/src/resolution/operators.dart b/pkg/compiler/lib/src/resolution/operators.dart
index 594e0a0c3077747c7d7d4e74b1ceb01ec6425058..4b9ec51968192cb284629641b327e0e52b5e27b7 100644
--- a/pkg/compiler/lib/src/resolution/operators.dart
+++ b/pkg/compiler/lib/src/resolution/operators.dart
@@ -170,7 +170,7 @@ class BinaryOperator {
/// The if-null ?? operator.
static const BinaryOperator IF_NULL =
- const _LogicalOperator(BinaryOperatorKind.IF_NULL, '??');
+ const _IfNullOperator(BinaryOperatorKind.IF_NULL, '??');
static BinaryOperator parse(String value) {
switch (value) {
@@ -221,6 +221,16 @@ class _LogicalOperator extends BinaryOperator {
String get selectorName => null;
}
+/// The operators ?? is not user definable.
+class _IfNullOperator extends BinaryOperator {
+ const _IfNullOperator(BinaryOperatorKind kind, String name)
+ : super._(kind, name);
+
+ bool get isUserDefinable => false;
+
+ String get selectorName => '??';
+}
+
enum AssignmentOperatorKind {
ASSIGN,
IF_NULL,
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698