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

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

Issue 1006463003: Fix restoring of contexts in inlined finally code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Regression test for issue 22822. The assignment in the finally block
6 // used to crash because it was executed at context level 1 instead of
7 // context level 2.
8
9 import 'package:expect/expect.dart';
10
11 test(b) {
12 try {
13 for (int i = 0; i < 10; i++) {
14 // Closurizing i and b, thus the return statement
15 // executes at context level 2, and the code in
16 // the finally block runs at context level 1.
17 return () => i + b;
18 }
19 } finally {
20 b = 10;
21 }
22 }
23
24 main() {
25 var c = test(0);
26 Expect.equals(10, c());
27 }
OLDNEW
« runtime/vm/flow_graph_builder.cc ('K') | « tests/language/language.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698