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

Unified Diff: tests/language/const_global_test.dart

Issue 348053002: dart2dart: Support for all constants in new backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Formatting stuff Created 6 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/const_global_test.dart
diff --git a/tests/language/constructor_default_test.dart b/tests/language/const_global_test.dart
similarity index 64%
copy from tests/language/constructor_default_test.dart
copy to tests/language/const_global_test.dart
index a8fc22ea3bb7195d3a6e81a57645ea699b0fbcdd..20d8a58340f566528b3046da2e893dab4a541e69 100644
--- a/tests/language/constructor_default_test.dart
+++ b/tests/language/const_global_test.dart
@@ -1,20 +1,18 @@
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// 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.
-// Dart test program for default constructors.
import "package:expect/expect.dart";
-class A {
- A() : a = 499;
-
- var a;
-}
+const a = 1;
-class B extends A {
- B() { Expect.equals(499, a); }
+main() {
+ Expect.equals(1, a);
+ Expect.equals(1, const A(a).a);
+ Expect.equals(1, const [const A(a)][0].a);
}
-main() {
- new B();
+class A {
+ final a;
+ const A(this.a);
}

Powered by Google App Engine
This is Rietveld 408576698