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

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

Issue 10915030: Parse argument definition test expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2012, 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 parsing and resolution of argument definition test.
6
7 int test(int a, [int b = 2, int c = 3]) {
8 int result = 0;
9 print(?b);
10 print(?result); /// 01: compile-time error
11 print(?a);
12 print(?b);
13 print(?c);
14 {
15 var b;
16 ?b; /// 02: compile-time error
17 }
18 print((!?a?!?b:!?c) == (?a??b:?c));
19 print(!?a?!?b:!?c == ?a??b:?c);
20 }
21
22 closure_test(int a, [int b = 2, int c = 3]) {
23 var x = 0;
24 return () {
25 int result = 0;
26 print(?b);
27 print(?result); /// 03: compile-time error
28 print(?x); /// 04: compile-time error
29 print(?a);
30 print(?b);
31 print(?c);
32 {
33 var b;
34 ?b; /// 05: compile-time error
35 }
36 print((!?a?!?b:!?c) == (?a??b:?c));
37 print(!?a?!?b:!?c == ?a??b:?c);
38 };
39 }
40
41 main() {
42 test(1);
43 test(1, 2);
44 test(1, 2, 3);
45 test(1, c:3);
46
47 closure_test(1)();
48 closure_test(1, 2)();
49 closure_test(1, 2, 3)();
50 closure_test(1, c:3)();
51 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/ssa/builder.dart ('k') | dart/tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698