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

Unified Diff: tests/compiler/dart2js_extra/invalid_annotation2_test.dart

Issue 1257513002: dart2js: fix crash when annotations have syntax errors (fix #23983) (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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_extra/invalid_annotation2_test.dart
diff --git a/tests/compiler/dart2js_extra/invalid_annotation2_test.dart b/tests/compiler/dart2js_extra/invalid_annotation2_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d8dafd57c0a9a4266858a6c5598b8661787c4fdb
--- /dev/null
+++ b/tests/compiler/dart2js_extra/invalid_annotation2_test.dart
@@ -0,0 +1,24 @@
+// Copyright (c) 2015, 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.
+
+// Regression test for http://dartbug.com/23893/
+//
+// Because annotations are parsed lazily, dart2js used to crash when an
+// annotation had a syntax error.
+// This checks the same behavior as invalid_annotation_test.dart, except that we
+// use mirrors to trigger the error in the vm. This also triggers the error in
+// dart2js differently.
+
+@MirrorsUsed(targets: const [A])
+import 'dart:mirrors';
+
+@Deprecated("m"
+, /// 01: compile-time error
+)
+class A {
+}
+
+main() {
+ reflectClass(A).metadata;
+}

Powered by Google App Engine
This is Rietveld 408576698