| // Copyright 2019 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| new Error("Simple Error"); |
| class CustomError extends Error {}; |
| new CustomError("Custom Error"); |
| new Error("Error from inlined function!"); |
| function Middle() { Inner(); } |
| function Outer() { Middle(); } |
| %PrepareFunctionForOptimization(Outer); |
| %OptimizeFunctionOnNextCall(Outer); |
| const kInitialRecursionValue = 10; |
| if (val <= 0) return new Error("Error in StepOne!"); |
| if (val <= 0) return new Error("Error in StepTwo!"); |
| StepOne(kInitialRecursionValue); |
| createSuite('Simple-Capture-Error', 1000, Simple, () => {}); |
| createSuite('Custom-Capture-Error', 1000, Custom, () => {}); |
| createSuite('Inline-Capture-Error', 1000, Inline, () => {}); |
| createSuite('Recursive-Capture-Error', 1000, Recursive, () => {}); |