mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Update TypedArray properties to conform with newest standard (#4194)
name and length properties has been updated. Enabling BigInt support in TypedArray.prototype.sort when no comparefn function is provided. JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
This commit is contained in:
parent
f8983cd2b5
commit
7345c83af7
@ -1037,9 +1037,16 @@ ecma_builtin_typedarray_prototype_sort_compare_helper (ecma_value_t lhs, /**< le
|
||||
{
|
||||
if (ecma_is_value_undefined (compare_func))
|
||||
{
|
||||
/* Default comparison when no comparefn is passed. */
|
||||
#if ENABLED (JERRY_BUILTIN_BIGINT)
|
||||
if (ecma_is_value_bigint (lhs) && ecma_is_value_bigint (rhs))
|
||||
{
|
||||
return ecma_make_number_value (ecma_bigint_compare_to_bigint (lhs, rhs));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
|
||||
|
||||
ecma_number_t result = ECMA_NUMBER_ZERO;
|
||||
|
||||
/* Default comparison when no comparefn is passed. */
|
||||
double lhs_value = (double) ecma_get_number_from_value (lhs);
|
||||
double rhs_value = (double) ecma_get_number_from_value (rhs);
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U,
|
||||
/* ES2015 22.2.5 */
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
TYPEDARRAY_MAGIC_STRING_ID,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
/* ES2015 22.2.5.2 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
|
||||
@ -22,14 +22,15 @@
|
||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/* ES2015 22.2.2 */
|
||||
/* ES11 22.2.1.1 - value of length changed to 0 */
|
||||
NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||
3,
|
||||
0,
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
/* ES2015 22.2.2 */
|
||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||
LIT_MAGIC_STRING_TYPED_ARRAY_UL,
|
||||
ECMA_PROPERTY_FIXED)
|
||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||
|
||||
/* ES2015 22.2.2.3 */
|
||||
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||
|
||||
@ -25,9 +25,10 @@
|
||||
assert(a[2] === 32.5);
|
||||
})();
|
||||
|
||||
/* ES11 22.2.1.1 - length is equal to 0 */
|
||||
(function tc_22_02_02__002() {
|
||||
var a = Object.getPrototypeOf(Int8Array);
|
||||
assert(a.length === 3);
|
||||
assert(a.length === 0);
|
||||
})();
|
||||
|
||||
(function tc_22_02_02__003() {
|
||||
|
||||
@ -1617,8 +1617,6 @@
|
||||
<test id="built-ins/TypedArray/from/iter-invoke-error.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/from/iter-next-error.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/from/iter-next-value-error.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/length.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/detached-buffer.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/Symbol.toStringTag/detached-buffer.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js"><reason></reason></test>
|
||||
@ -1818,8 +1816,6 @@
|
||||
<test id="built-ins/TypedArray/prototype/some/detached-buffer.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/sort/BigInt/detached-buffer-comparefn.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/sort/BigInt/detached-buffer.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/sort/detached-buffer-comparefn-coerce.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/sort/detached-buffer-comparefn.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/sort/detached-buffer.js"><reason></reason></test>
|
||||
@ -1866,17 +1862,6 @@
|
||||
<test id="built-ins/TypedArray/prototype/toString/detached-buffer.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/values/BigInt/detached-buffer.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArray/prototype/values/detached-buffer.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/BigInt64Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/BigUint64Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Float32Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Float64Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Int16Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Int32Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Int8Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Uint16Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Uint32Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Uint8Array/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/Uint8ClampedArray/name.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-negative-throws-sab.js"><reason></reason></test>
|
||||
<test id="built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-negative-zero-sab.js"><reason></reason></test>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user