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

Side by Side Diff: tests/kernel/unsorted/try_finally_test.dart

Issue 2487183002: VM: [Kernel] Ensure we have the correct try-index when translating finally blocks (Closed)
Patch Set: Rebased & remove print in test Created 4 years, 1 month 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
« no previous file with comments | « runtime/vm/kernel_to_il.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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'; 5 import 'package:expect/expect.dart';
6 6
7 testSimpleBreak() { 7 testSimpleBreak() {
8 var x = 1; 8 var x = 1;
9 while (true) { 9 while (true) {
10 try { 10 try {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 case 1: 138 case 1:
139 try { 139 try {
140 continue jump5; 140 continue jump5;
141 } finally { 141 } finally {
142 continue jump42; 142 continue jump42;
143 } 143 }
144 } 144 }
145 } 145 }
146 146
147 testNestedFinally() {
148 var events = '';
149 try {
150 try {
151 events = '$events|start';
152 } finally {
153 events = '$events|start-catch';
154 }
155 try {
156 try {
157 return;
158 } finally {
159 events = '$events|inner';
160 throw 0;
161 }
162 } finally {
163 events = '$events|middle';
164 }
165 } catch (e) {
166 events = '$events|outer-catch';
167 } finally {
168 events = '$events|outer-finally';
169 }
170 Expect.equals(
171 events,
172 '|start|start-catch|inner|middle|outer-catch|outer-finally');
173 }
174
147 main() { 175 main() {
148 Expect.isTrue(testSimpleBreak() == 3); 176 Expect.isTrue(testSimpleBreak() == 3);
149 Expect.isTrue(testReturnFinally() == 42); 177 Expect.isTrue(testReturnFinally() == 42);
150 Expect.isTrue(testNestedReturnFinally() == 42); 178 Expect.isTrue(testNestedReturnFinally() == 42);
151 Expect.isTrue(testReturnInsideLoop() == 42); 179 Expect.isTrue(testReturnInsideLoop() == 42);
152 Expect.isTrue(testStopContinueInsideLoop() == 42); 180 Expect.isTrue(testStopContinueInsideLoop() == 42);
153 Expect.isTrue(testStopBreakInsideLoop() == 42); 181 Expect.isTrue(testStopBreakInsideLoop() == 42);
154 Expect.isTrue(testStopBreakInsideLoop2() == 42); 182 Expect.isTrue(testStopBreakInsideLoop2() == 42);
155 Expect.isTrue(testStopContinueInsideLoop() == 42); 183 Expect.isTrue(testStopContinueInsideLoop() == 42);
156 Expect.isTrue(testStopContinueInsideSwitch() == 42); 184 Expect.isTrue(testStopContinueInsideSwitch() == 42);
157 Expect.isTrue(testStopContinueInsideSwitch2() == 42); 185 Expect.isTrue(testStopContinueInsideSwitch2() == 42);
186 testNestedFinally();
158 } 187 }
OLDNEW
« no previous file with comments | « runtime/vm/kernel_to_il.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698