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

Side by Side Diff: pkg/kernel/testcases/interpreter/function_expressions_test.dart

Issue 2997443002: Add support for function declarations and function expressions (Closed)
Patch Set: Remove environment location Created 3 years, 4 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
(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 library function_expression_test;
6
7 main() {
8 var f = (int m, int n) => print('${m++}$n');
9 var a1 = 3;
10 var a2 = 7;
11
12 f(a1, a2);
13
14 int foo(int f1, String f2) {
15 print('$f1, $f2');
16 a1++;
17 return a1;
18 }
19
20 var m = foo(1, 'test');
21 print(m);
22 print(a1);
23
24 int bar(int i) {
25 if (i < 0 || i == 0) return 0;
26 return bar(--i);
27 }
28
29 print(bar(5));
30 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/interpreter/interpreter.dart ('k') | pkg/kernel/testcases/interpreter/function_expressions_test.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698