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

Side by Side Diff: tests/compiler/dart2js_extra/useful_error_message_1_test.dart

Issue 1411243003: Upgrade some tests to use annotations instead of 'clever' confuse() function (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Test that closures have a useful string that identifies the function by name 5 // Test that closures have a useful string that identifies the function by name
6 // in error messages. 6 // in error messages.
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 @NoInline 10 @NoInline()
11 @AssumeDynamic 11 @AssumeDynamic()
12 confuse(x) => x; 12 confuse(x) => x;
13 13
14 class CCCC { 14 class CCCC {
15 instanceMethod([a, b]) => '[$a, $b]'; 15 instanceMethod([a, b]) => '[$a, $b]';
16 static staticMethod() => 'hi'; 16 static staticMethod() => 'hi';
17 // Default `toString` method returns "Instance of 'CCCC'" or similar with a 17 // Default `toString` method returns "Instance of 'CCCC'" or similar with a
18 // shorter name if minified. 18 // shorter name if minified.
19 } 19 }
20 20
21 main() { 21 main() {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 checkContains(s5, "main_closure"); 74 checkContains(s5, "main_closure");
75 checkContains('$anon', "main_closure"); 75 checkContains('$anon', "main_closure");
76 76
77 // Local named closure. 77 // Local named closure.
78 localFunction() => c; 78 localFunction() => c;
79 var e6 = new ArgumentError.value(localFunction); 79 var e6 = new ArgumentError.value(localFunction);
80 var s6 = '$e6'; 80 var s6 = '$e6';
81 checkContains(s6, "localFunction"); 81 checkContains(s6, "localFunction");
82 checkContains('$localFunction', "localFunction"); 82 checkContains('$localFunction', "localFunction");
83 } 83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698