diff --git a/lib/Runtime/Library/JavascriptString.cpp b/lib/Runtime/Library/JavascriptString.cpp index bcd6b45bb6d..673170929b6 100644 --- a/lib/Runtime/Library/JavascriptString.cpp +++ b/lib/Runtime/Library/JavascriptString.cpp @@ -205,7 +205,7 @@ namespace Js { if (!IsValidCharCount(newLength)) { - JavascriptExceptionOperators::ThrowOutOfMemory(this->GetScriptContext()); + JavascriptError::ThrowRangeError(this->GetScriptContext(), JSERR_OutOfBoundString); } m_charLength = newLength; } diff --git a/test/Error/outofmem.baseline b/test/Error/outofmem.baseline index 54c59ebcd1c..e6a99cc0f24 100644 --- a/test/Error/outofmem.baseline +++ b/test/Error/outofmem.baseline @@ -1,3 +1,3 @@ -Error -Out of memory --2146828281 +RangeError +String length is out of bound +-2146822618