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

Unified Diff: tests/compiler/dart2js_extra/conditional_send_test.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 | « tests/compiler/dart2js/parser_test.dart ('k') | tests/compiler/dart2js_extra/if_null_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js_extra/conditional_send_test.dart
diff --git a/tests/language/issue13179_test.dart b/tests/compiler/dart2js_extra/conditional_send_test.dart
similarity index 53%
copy from tests/language/issue13179_test.dart
copy to tests/compiler/dart2js_extra/conditional_send_test.dart
index 0439ceab895f5925234763b90cb323007bc19b14..c95203d244861f2861d83148405a0f1d7ddd6e7b 100644
--- a/tests/language/issue13179_test.dart
+++ b/tests/compiler/dart2js_extra/conditional_send_test.dart
@@ -2,18 +2,19 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// SharedOptions=--enable-null-aware-operators
import "package:expect/expect.dart";
-int count = 0;
+@NoInline() @AssumeDynamic()
+confuse(x) => x;
-void f([void f([x]) = f]) {
- count++;
- if (f != null) {
- f(null);
- }
+class A {
+ int x;
+ m() => "a";
}
-main() {
- f();
- Expect.equals(2, count);
+main(args) {
+ var a = confuse(true) ? null : new A();
+ a?.x = 3;
+ Expect.throws(() => a.m());
}
« no previous file with comments | « tests/compiler/dart2js/parser_test.dart ('k') | tests/compiler/dart2js_extra/if_null_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698