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

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

Issue 12036088: Fix argument test for the captured parameter of an outer function (issue 8007). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/language/argument_definition4_test.dart ('k') | tests/language/language.status » ('j') | 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) 2013, 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 var x = "";
6
7 test(String str, [onError(String)]) {
8 return (() {
9 try {
10 throw "";
11 } catch(e) {
12 if (?onError) {
13 onError(str);
14 } else {
15 x = "${str} error";
16 }
17 }
18 });
19 }
20
21 ignoreError(String str) {
22 x = "${str} error ignored";
23 }
24
25 main() {
26 Expect.equals("", x);
27 test("test")();
28 Expect.equals("test error", x);
29 test("test", ignoreError)();
30 Expect.equals("test error ignored", x);
31 }
OLDNEW
« no previous file with comments | « tests/language/argument_definition4_test.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698