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

Unified Diff: test/codegen/lib/mirrors/array_tracing2_test.dart

Issue 2265533002: Add mirrors tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 4 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: test/codegen/lib/mirrors/array_tracing2_test.dart
diff --git a/test/codegen/language/issue14242_test.dart b/test/codegen/lib/mirrors/array_tracing2_test.dart
similarity index 54%
copy from test/codegen/language/issue14242_test.dart
copy to test/codegen/lib/mirrors/array_tracing2_test.dart
index 1bd3fe694c2dd40d7f96307fc60df42f855b8f42..39411a10b77846901fde1642dc57c9151f13aad6 100644
--- a/test/codegen/language/issue14242_test.dart
+++ b/test/codegen/lib/mirrors/array_tracing2_test.dart
@@ -2,19 +2,18 @@
// 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.
-// Regression test for dart2js that used to crash on type literals
-// used in a cascade send.
+import 'dart:mirrors';
class A {
- var bar;
- var foo = {};
+ var field;
}
main() {
var a = new A();
- a..foo[Object] = 54
- ..bar = 42;
- if (a.foo.keys.first is! Type) {
- throw 'Test failed';
- }
+ var mirror = reflect(a);
+ var array = [42];
+ a.field = array;
+ var field = mirror.getField(#field);
+ field.invoke(#clear, []);
+ if (array.length == 1) throw 'Test failed';
}
« no previous file with comments | « test/codegen/lib/mirrors/accessor_cache_overflow_test.dart ('k') | test/codegen/lib/mirrors/array_tracing3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698