| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013, 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 // Dart test program for testing throw statement |
| 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
| 8 class Helper1 { |
| 9 static int func1() { |
| 10 return func2(); |
| 11 } |
| 12 static int func2() { |
| 13 return func3(); |
| 14 } |
| 15 static int func3() { |
| 16 return func4(); |
| 17 } |
| 18 static int func4() { |
| 19 var i = 0; |
| 20 try { |
| 21 i = 10; |
| 22 func5(); |
| 23 } on OutOfMemoryError catch (e) { |
| 24 i = 100; |
| 25 Expect.isNull(e.stackTrace, "OOM should not have a stackTrace on throw"); |
| 26 } |
| 27 return i; |
| 28 } |
| 29 static List func5() { |
| 30 // Cause an OOM(out of memory) exception. |
| 31 var l1 = new List(268435455); |
| 32 return l1; |
| 33 } |
| 34 } |
| 35 |
| 36 class OOMErrorStackTraceTest { |
| 37 static testMain() { |
| 38 Expect.equals(100, Helper1.func1()); |
| 39 } |
| 40 } |
| 41 |
| 42 main() { |
| 43 OOMErrorStackTraceTest.testMain(); |
| 44 } |
| OLD | NEW |