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

Unified Diff: tests/language/dead_field_access_test.dart

Issue 1188253006: dart2js cps: Replace getter/setter calls with direct field access. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix test case Created 5 years, 6 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/language/dead_field_access_test.dart
diff --git a/tests/language/regress_21998_1_test.dart b/tests/language/dead_field_access_test.dart
similarity index 61%
copy from tests/language/regress_21998_1_test.dart
copy to tests/language/dead_field_access_test.dart
index 3237f3396629f6fd11270e1adc290bec78713958..e3fc11b6c5f33af074b45ea57a53194aadb20daa 100644
--- a/tests/language/regress_21998_1_test.dart
+++ b/tests/language/dead_field_access_test.dart
@@ -2,17 +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.
-import 'dart:math' as Math;
import 'package:expect/expect.dart';
-main() {
- Expect.equals(4, new C().m());
+class Foo {
+ var field = 10;
}
-class C {
- max(a) => a;
+@NoInline()
+getField(x) {
+ x.field;
+ return 34;
+}
- m() {
- return max(Math.max(2, 4));
- }
-}
+main() {
+ Expect.equals(34, getField(new Foo()));
+ Expect.throws(() => getField(null));
+}

Powered by Google App Engine
This is Rietveld 408576698