mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix Number.prototype.toString() when radix is undefined.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
This commit is contained in:
parent
b5da46f2aa
commit
f1248b9780
@ -97,7 +97,8 @@ ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this
|
||||
if (arguments_list_len == 0
|
||||
|| ecma_number_is_nan (this_arg_number)
|
||||
|| ecma_number_is_infinity (this_arg_number)
|
||||
|| ecma_number_is_zero (this_arg_number))
|
||||
|| ecma_number_is_zero (this_arg_number)
|
||||
|| (arguments_list_len > 0 && ecma_is_value_undefined (arguments_list_p[0])))
|
||||
{
|
||||
ecma_string_t *ret_str_p = ecma_new_ecma_string_from_number (this_arg_number);
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ assert((-0.0001).toString(4) === "-0.000000122031232023223013010030231")
|
||||
assert((-0).toString(16) === "0");
|
||||
assert((1e+73).toString(35) === "2nx1mg1l0w4ujlpt449c5qfrkkmtpgpsfsc2prlaqtnjbli2")
|
||||
assert((-1e+73).toString(35) === "-2nx1mg1l0w4ujlpt449c5qfrkkmtpgpsfsc2prlaqtnjbli2")
|
||||
assert((1).toString(undefined) === "1")
|
||||
|
||||
assert((123400).toString(2) === "11110001000001000");
|
||||
assert((123400).toString(3) === "20021021101");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user