Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 1c31840a55c1077b583c67a4db3d62d3a438c7cd..589f36d46d4e5e835fe89188255c19bc8982decb 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1214,6 +1214,13 @@ Handle<Object> Factory::NewError(Handle<JSFunction> constructor, |
return maybe_error.ToHandleChecked(); |
} |
+Handle<Object> Factory::NewInvalidStringLengthError() { |
+ // Invalidate the "string length" protector. |
+ if (isolate()->IsStringLengthOverflowIntact()) { |
+ isolate()->InvalidateStringLengthOverflowProtector(); |
+ } |
+ return NewRangeError(MessageTemplate::kInvalidStringLength); |
+} |
#define DEFINE_ERROR(NAME, name) \ |
Handle<Object> Factory::New##NAME(MessageTemplate::Template template_index, \ |