Skip to content

Commit 60f8317

Browse files
skomskiCommit bot
authored andcommitted
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}
1 parent 9d66c88 commit 60f8317

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/messages.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ class CallSite {
253253
T(DateRange, "Provided date is not in valid range.") \
254254
T(ExpectedLocation, "Expected Area/Location for time zone, got %") \
255255
T(InvalidArrayBufferLength, "Invalid array buffer length") \
256+
T(ArrayBufferAllocationFailed, "Array buffer allocation failed") \
256257
T(InvalidArrayLength, "Invalid array length") \
257258
T(InvalidCodePoint, "Invalid code point %") \
258259
T(InvalidCountValue, "Invalid count value") \

src/runtime/runtime-typedarray.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUNTIME_FUNCTION(Runtime_ArrayBufferInitialize) {
3333
holder, isolate, allocated_length, true,
3434
is_shared ? SharedFlag::kShared : SharedFlag::kNotShared)) {
3535
THROW_NEW_ERROR_RETURN_FAILURE(
36-
isolate, NewRangeError(MessageTemplate::kInvalidArrayBufferLength));
36+
isolate, NewRangeError(MessageTemplate::kArrayBufferAllocationFailed));
3737
}
3838
return *holder;
3939
}

0 commit comments

Comments
 (0)