mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 20:51:19 +00:00
33d13b8809
BUG= Review URL: https://codereview.chromium.org//22548003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25860 260f80e4-7a28-3924-810f-c04153c831b5
50 lines
1 KiB
Dart
50 lines
1 KiB
Dart
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// Regression test for dart2js that used to not treat the finally
|
|
// block as a successor of a nested try block.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
class A {
|
|
var field;
|
|
start() {}
|
|
stop() { field = 42; }
|
|
}
|
|
|
|
class B {
|
|
var totalCompileTime = new A();
|
|
var runCompiler = new Object();
|
|
|
|
run() {
|
|
totalCompileTime.start();
|
|
try {
|
|
throw 'foo';
|
|
} catch (exception) {
|
|
try {
|
|
// Use [runCompiler] twice to ensure it will have a local
|
|
// variable.
|
|
runCompiler.toString();
|
|
runCompiler.toString();
|
|
} catch (exception) {
|
|
}
|
|
rethrow;
|
|
} finally {
|
|
totalCompileTime.stop();
|
|
}
|
|
}
|
|
}
|
|
|
|
main() {
|
|
var b = new B();
|
|
try {
|
|
b.run();
|
|
throw 'Expected exception';
|
|
} catch (exception) {
|
|
// Expected exception.
|
|
}
|
|
|
|
Expect.equals(42, b.totalCompileTime.field);
|
|
}
|