Kaido Kert | f309f9a | 2021-04-30 12:09:15 -0700 | [diff] [blame] | 1 | // Copyright 2020 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "src/execution/isolate.h" |
| 6 | #include "src/heap/factory.h" |
| 7 | #include "test/unittests/test-utils.h" |
| 8 | |
| 9 | namespace v8 { |
| 10 | namespace internal { |
| 11 | |
| 12 | using NewUninitializedFixedArrayTest = TestWithIsolateAndZone; |
| 13 | |
| 14 | TEST_F(NewUninitializedFixedArrayTest, ThrowOnNegativeLength) { |
| 15 | ASSERT_DEATH_IF_SUPPORTED({ factory()->NewUninitializedFixedArray(-1); }, |
| 16 | "Fatal javascript OOM in invalid array length"); |
| 17 | } |
| 18 | |
| 19 | } // namespace internal |
| 20 | } // namespace v8 |