Index: src/heap-inl.h |
diff --git a/src/heap-inl.h b/src/heap-inl.h |
index 7e465d5c9386858c05088c89073d3365c232167e..063cf30ff3cd178b4c7efda22fcc2447252e90c8 100644 |
--- a/src/heap-inl.h |
+++ b/src/heap-inl.h |
@@ -138,7 +138,7 @@ MaybeObject* Heap::AllocateInternalizedStringImpl( |
MaybeObject* Heap::AllocateOneByteInternalizedString(Vector<const uint8_t> str, |
uint32_t hash_field) { |
if (str.length() > String::kMaxLength) { |
- v8::internal::Heap::FatalProcessOutOfMemory("invalid string length", true); |
+ return isolate()->ThrowInvalidStringLength(); |
} |
// Compute map and object size. |
Map* map = ascii_internalized_string_map(); |
@@ -171,7 +171,7 @@ MaybeObject* Heap::AllocateOneByteInternalizedString(Vector<const uint8_t> str, |
MaybeObject* Heap::AllocateTwoByteInternalizedString(Vector<const uc16> str, |
uint32_t hash_field) { |
if (str.length() > String::kMaxLength) { |
- v8::internal::Heap::FatalProcessOutOfMemory("invalid string length", true); |
+ return isolate()->ThrowInvalidStringLength(); |
} |
// Compute map and object size. |
Map* map = internalized_string_map(); |