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

Side by Side Diff: tests/language/stacktrace_demangle_ctors_test.dart

Issue 2818933003: Fix #28740 demangle constructors in stack traces (A.A becomes new A). (Closed)
Patch Set: Fix ctor demangle test comments, kind() == ctor, and test status updates Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Test that stack traces are properly demangled in constructors (#28740).
6
7 import "package:expect/expect.dart";
8
9 class SomeClass {
10 SomeClass.namedConstructor() {
11 throw new Exception();
12 }
13
14 SomeClass() {
15 throw new Exception();
16 }
17
18 factory SomeClass.useFactory() {
19 throw new Exception();
20 }
21 }
22
23 class OnlyHasFactory {
24 factory OnlyHasFactory() {
25 throw new Exception();
26 }
27 }
28
29 void main() {
30 try {
31 new SomeClass();
32 } on Exception catch (e, st) {
33 final stString = st.toString();
34 Expect.isTrue(stString.contains("new SomeClass"));
35 Expect.isFalse(stString.contains("SomeClass."));
36 }
37
38 try {
39 new SomeClass.namedConstructor();
40 } on Exception catch (e, st) {
41 final stString = st.toString();
42 Expect.isTrue(stString.contains("new SomeClass.namedConstructor"));
43 }
44
45 try {
46 new OnlyHasFactory();
47 } on Exception catch (e, st) {
48 final stString = st.toString();
49 Expect.isTrue(stString.contains("new OnlyHasFactory"));
50 Expect.isFalse(stString.contains("OnlyHasFactory."));
51 }
52
53 try {
54 new SomeClass.useFactory();
55 } on Exception catch (e, st) {
56 final stString = st.toString();
57 Expect.isTrue(stString.contains("new SomeClass.useFactory"));
58 }
59 }
OLDNEW
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698