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

Unified Diff: tests/compiler/dart2js/semantic_visitor_test_send_data.dart

Issue 1842033004: Add *IndexSetIfNull methods to SemanticSendVisitor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 9 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: tests/compiler/dart2js/semantic_visitor_test_send_data.dart
diff --git a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
index 51eae03565bd11dea569b18019811221035838fa..b72e47964986159be3b02dc0d15ef125e501db33 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
@@ -2142,6 +2142,66 @@ const Map<String, List<Test>> SEND_TESTS = const {
error: MessageKind.NO_SUPER_IN_STATIC,
index: '42',
operator: '--')),
+ const Test(
+ '''
+ m() => [][42] ??= 0;
+ ''',
+ const Visit(VisitKind.VISIT_INDEX_SET_IF_NULL,
+ receiver: '[] ',
+ index: '42',
+ rhs: '0')),
+ const Test.clazz(
+ '''
+ class B {
+ operator [](_) => null;
+ operator []=(a, b) {}
+ }
+ class C extends B {
+ m() => super[42] ??= 0;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_SUPER_INDEX_SET_IF_NULL,
+ getter: 'function(B#[])',
+ setter: 'function(B#[]=)',
+ index: '42',
+ rhs: '0')),
+ const Test.clazz(
+ '''
+ class B {
+ operator []=(a, b) {}
+ }
+ class C extends B {
+ m() => super[42] ??= 0;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_INDEX_SET_IF_NULL,
+ setter: 'function(B#[]=)',
+ index: '42',
+ rhs: '0')),
+ const Test.clazz(
+ '''
+ class B {
+ operator [](_) => null;
+ }
+ class C extends B {
+ m() => super[42] ??= 0;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_INDEX_SET_IF_NULL,
+ getter: 'function(B#[])',
+ index: '42',
+ rhs: '0')),
+ const Test.clazz(
+ '''
+ class B {
+ }
+ class C extends B {
+ m() => super[42] ??= 0;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_SET_IF_NULL,
+ index: '42',
+ rhs: '0')),
],
'Equals': const [
// Equals
« no previous file with comments | « tests/compiler/dart2js/semantic_visitor_test.dart ('k') | tests/compiler/dart2js/semantic_visitor_test_send_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698