| Index: tests/language/vm/unregistered_closure_in_finally_test.dart
|
| diff --git a/tests/language/vm/unregistered_closure_in_finally_test.dart b/tests/language/vm/unregistered_closure_in_finally_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..135be5d0540db5ab30b8179aefc2e3c9d3e815ed
|
| --- /dev/null
|
| +++ b/tests/language/vm/unregistered_closure_in_finally_test.dart
|
| @@ -0,0 +1,38 @@
|
| +// Copyright (c) 2017, 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.
|
| +// VMOptions=--no-background-compilation --enable-inlining-annotations
|
| +
|
| +const NeverInline = 'NeverInline';
|
| +
|
| +@NeverInline
|
| +doSomething() {
|
| + print("Hello!");
|
| +}
|
| +
|
| +@NeverInline
|
| +maybeThrow(bool doThrow) {
|
| + if (doThrow) {
|
| + throw new Exception();
|
| + }
|
| +}
|
| +
|
| +@NeverInline
|
| +run(action) {
|
| + try { action(); } catch(e) {}
|
| +}
|
| +
|
| +test(bool doThrow) {
|
| + try {
|
| + maybeThrow(doThrow);
|
| + } finally {
|
| + run(() {
|
| + doSomething(); // Should not crash here.
|
| + });
|
| + }
|
| +}
|
| +
|
| +main() {
|
| + try { test(true); } catch(e) {}
|
| + try { test(false); } catch(e) {}
|
| +}
|
|
|