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 [email protected]
This commit is contained in:
1 parent
f8983cd2b5
commit
7345c83af7
5 files changed
+14
-20
No files matched your search
@@ -1037,9 +1037,16 @@ ecma_builtin_typedarray_prototype_sort_compare_helper (ecma_value_t lhs, /**< le
|
|||||||
{
|
{
|
||||||
if (ecma_is_value_undefined (compare_func))
|
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;
|
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 lhs_value = (double) ecma_get_number_from_value (lhs);
|
||||||
double rhs_value = (double) ecma_get_number_from_value (rhs);
|
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 */
|
/* ES2015 22.2.5 */
|
||||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||||
TYPEDARRAY_MAGIC_STRING_ID,
|
TYPEDARRAY_MAGIC_STRING_ID,
|
||||||
ECMA_PROPERTY_FIXED)
|
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||||
|
|
||||||
/* ES2015 22.2.5.2 */
|
/* ES2015 22.2.5.2 */
|
||||||
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||||
|
|||||||
@@ -22,14 +22,15 @@
|
|||||||
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
|
||||||
|
|
||||||
/* ES2015 22.2.2 */
|
/* ES2015 22.2.2 */
|
||||||
|
/* ES11 22.2.1.1 - value of length changed to 0 */
|
||||||
NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
|
||||||
3,
|
0,
|
||||||
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||||
|
|
||||||
/* ES2015 22.2.2 */
|
/* ES2015 22.2.2 */
|
||||||
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
STRING_VALUE (LIT_MAGIC_STRING_NAME,
|
||||||
LIT_MAGIC_STRING_TYPED_ARRAY_UL,
|
LIT_MAGIC_STRING_TYPED_ARRAY_UL,
|
||||||
ECMA_PROPERTY_FIXED)
|
ECMA_PROPERTY_FLAG_CONFIGURABLE)
|
||||||
|
|
||||||
/* ES2015 22.2.2.3 */
|
/* ES2015 22.2.2.3 */
|
||||||
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
|
||||||
|
|||||||
@@ -25,9 +25,10 @@
|
|||||||
assert(a[2] === 32.5);
|
assert(a[2] === 32.5);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
/* ES11 22.2.1.1 - length is equal to 0 */
|
||||||
(function tc_22_02_02__002() {
|
(function tc_22_02_02__002() {
|
||||||
var a = Object.getPrototypeOf(Int8Array);
|
var a = Object.getPrototypeOf(Int8Array);
|
||||||
assert(a.length === 3);
|
assert(a.length === 0);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(function tc_22_02_02__003() {
|
(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-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-error.js"><reason></reason></test>
|
||||||
<test id="built-ins/TypedArray/from/iter-next-value-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/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/Symbol.toStringTag/detached-buffer.js"><reason></reason></test>
|
||||||
<test id="built-ins/TypedArray/prototype/buffer/BigInt/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/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-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/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-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-comparefn.js"><reason></reason></test>
|
||||||
<test id="built-ins/TypedArray/prototype/sort/detached-buffer.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/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/BigInt/detached-buffer.js"><reason></reason></test>
|
||||||
<test id="built-ins/TypedArray/prototype/values/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/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-throws-sab.js"><reason></reason></test>
|
||||||
<test id="built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-negative-zero-sab.js"><reason></reason></test>
|
<test id="built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/byteoffset-is-negative-zero-sab.js"><reason></reason></test>
|
||||||
|
|||||||
Reference in new issue
Block a user