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

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

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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 import "package:expect/expect.dart";
6
7 closure0() { 5 closure0() {
8 // f and g will both capture a variable named 'x'. If we use the original 6 // f and g will both capture a variable named 'x'. If we use the original
9 // name in the (shared) box then there will be troubles. 7 // name in the (shared) box then there will be troubles.
10 var f; 8 var f;
11 var g; 9 var g;
12 { 10 {
13 var x = 499; 11 var x = 499;
14 // TODO(floitsch): remove name from functions. 12 // TODO(floitsch): remove name from functions.
15 f = fun() { return x; }; 13 f = fun() { return x; };
16 x++; 14 x++;
(...skipping 15 matching lines...) Expand all
32 // TODO(floitsch): remove name from functions. 30 // TODO(floitsch): remove name from functions.
33 var f = fun() { return $1; }; 31 var f = fun() { return $1; };
34 $1++; 32 $1++;
35 Expect.equals(500, f()); 33 Expect.equals(500, f());
36 } 34 }
37 35
38 main() { 36 main() {
39 closure0(); 37 closure0();
40 closure1(); 38 closure1();
41 } 39 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/closure7_test.dart ('k') | tests/compiler/dart2js_extra/closure_capture3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698