Emit better error message if array buffer allocation fails

Now emits `Array buffer allocation failed` instead of
`Invalid array buffer length`.

Review URL: https://codereview.chromium.org/1393263003

Cr-Commit-Position: refs/heads/master@{#31200}
This commit is contained in:
karl 2015-10-09 13:44:29 -07:00 committed by Commit bot
parent 9d66c8813a
commit 60f831749f
2 changed files with 2 additions and 1 deletions

View File

@ -253,6 +253,7 @@ class CallSite {
T(DateRange, "Provided date is not in valid range.") \
T(ExpectedLocation, "Expected Area/Location for time zone, got %") \
T(InvalidArrayBufferLength, "Invalid array buffer length") \
T(ArrayBufferAllocationFailed, "Array buffer allocation failed") \
T(InvalidArrayLength, "Invalid array length") \
T(InvalidCodePoint, "Invalid code point %") \
T(InvalidCountValue, "Invalid count value") \

View File

@ -33,7 +33,7 @@ RUNTIME_FUNCTION(Runtime_ArrayBufferInitialize) {
holder, isolate, allocated_length, true,
is_shared ? SharedFlag::kShared : SharedFlag::kNotShared)) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewRangeError(MessageTemplate::kInvalidArrayBufferLength));
isolate, NewRangeError(MessageTemplate::kArrayBufferAllocationFailed));
}
return *holder;
}