mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fixed Array.prototype.concat error type (#4117)
JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
parent
f4f9cde3e7
commit
58a649ffe8
@ -359,7 +359,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
|
||||
/* 4 . */
|
||||
if (*length_p + arg_len > ECMA_NUMBER_MAX_SAFE_INTEGER)
|
||||
{
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid array length."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid array length."));
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
/* 5.b.ii */
|
||||
|
||||
@ -31,14 +31,14 @@ function compareArray(a, b) {
|
||||
Array.prototype.concat.call({}, {[Symbol.isConcatSpreadable]: true, length : 2 **53 - 1})
|
||||
assert(false);
|
||||
} catch (e) {
|
||||
assert(e instanceof RangeError);
|
||||
assert(e instanceof TypeError);
|
||||
}
|
||||
|
||||
try {
|
||||
Array.prototype.concat.call([1, 2, 3, 4], {[Symbol.isConcatSpreadable]: true, length : 2 **53 - 4})
|
||||
assert(false);
|
||||
} catch (e) {
|
||||
assert(e instanceof RangeError);
|
||||
assert(e instanceof TypeError);
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
@ -152,7 +152,6 @@
|
||||
<test id="built-ins/Array/proto-from-ctor-realm-two.js"><reason></reason></test>
|
||||
<test id="built-ins/Array/proto-from-ctor-realm-zero.js"><reason></reason></test>
|
||||
<test id="built-ins/Array/prototype/Symbol.unscopables/value.js"><reason></reason></test>
|
||||
<test id="built-ins/Array/prototype/concat/arg-length-exceeding-integer-limit.js"><reason></reason></test>
|
||||
<test id="built-ins/Array/prototype/concat/create-proto-from-ctor-realm-array.js"><reason></reason></test>
|
||||
<test id="built-ins/Array/prototype/concat/create-proto-from-ctor-realm-non-array.js"><reason></reason></test>
|
||||
<test id="built-ins/Array/prototype/copyWithin/coerced-values-start-change-start.js"><reason></reason></test>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user