Commit 40605a3d authored by yufeng.freeman's avatar yufeng.freeman Committed by V8 LUCI CQ

Include count value to InvalidCountValue error message

This CL includes count value to InvalidCountValue error message to make
it easier to dignoise RangeError of String.prototype.repeat. When
InvalidCountValue error throw, we could not know it's
caused by which count value if count value is not included.

Bug: none
Change-Id: I16e6693da0fc3b181241cb90daca27957f59c77c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3593574Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80198}
parent 8b34a965
......@@ -108,6 +108,7 @@ Erich Ocean <erich.ocean@me.com>
Evan Lucas <evan.lucas@help.com>
Fedor Indutny <fedor@indutny.com>
Felix Geisendörfer <haimuiba@gmail.com>
Feng Yu <f3n67u@gmail.com>
Filipe David Manana <fdmanana@gmail.com>
Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Gao Sheng <gaosheng08@meituan.com>
......
......@@ -357,7 +357,7 @@ namespace internal {
T(InvalidAtomicAccessIndex, "Invalid atomic access index") \
T(InvalidCalendar, "Invalid calendar specified: %") \
T(InvalidCodePoint, "Invalid code point %") \
T(InvalidCountValue, "Invalid count value") \
T(InvalidCountValue, "Invalid count value: %") \
T(InvalidDataViewAccessorOffset, \
"Offset is outside the bounds of the DataView") \
T(InvalidDataViewLength, "Invalid DataView length %") \
......
......@@ -543,7 +543,17 @@ test(function() {
// kInvalidCountValue
test(function() {
"a".repeat(-1);
}, "Invalid count value", RangeError);
}, "Invalid count value: -1", RangeError);
// kInvalidCountValue
test(function() {
"a".repeat(Infinity);
}, "Invalid count value: Infinity", RangeError);
// kInvalidCountValue
test(function() {
"a".repeat(-Infinity);
}, "Invalid count value: -Infinity", RangeError);
// kInvalidArrayBufferLength
test(function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment