Improve BigInt support (#4118)

This patch adds several small features:
- Support right shift with negative numbers
- Support exponentation operator
- BigInts can be enabled in ES5.1 mode
- Remove dead code from ecma_deref_bigint
- Support longer BigInt literals in the parser
- Fix various BigInt comparison issues
- Do not discard unary plus for BigInt constants

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-08-11 11:25:01 +02:00
committed by GitHub
parent 286e515f9f
commit f761427a3e
13 changed files with 409 additions and 138 deletions
+10 -7
View File
@@ -92,9 +92,9 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
}
/* Swap values. */
ecma_value_t tmp = x;
x = y;
y = tmp;
x ^= y;
y ^= x;
x ^= y;
}
if (ecma_is_value_string (x))
@@ -127,9 +127,9 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
}
/* Swap values. */
ecma_value_t tmp = x;
x = y;
y = tmp;
x ^= y;
y ^= x;
x ^= y;
}
if (ecma_is_value_boolean (y))
@@ -192,7 +192,10 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
return ecma_make_boolean_value (ecma_bigint_is_equal_to_number (x, ecma_get_number_from_value (y)));
}
return ECMA_VALUE_FALSE;
/* Swap values. */
x ^= y;
y ^= x;
x ^= y;
}
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */