mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 06:18:38 +09:00
Issue #2543 - adjust toFixed precision range according to spec update.
As pointed out in the ecma-262 spec change discussion, the behavior is inconsistent for negative numbers because the exponential fallback assumes all the digits will be displayed. The negative support was motivated just by consistency, without any particular concrete use cases, and it's not supported in other browsers, so this patch removes negatives. Resolves #2543
This commit is contained in:
parent
5bdec62cb0
commit
f4b6cee0cc
1 changed files with 1 additions and 1 deletions
|
|
@ -848,7 +848,7 @@ num_toFixed_impl(JSContext* cx, const CallArgs& args)
|
|||
if (!ToInteger(cx, args[0], &prec))
|
||||
return false;
|
||||
|
||||
if (!ComputePrecisionInRange(cx, -20, MAX_PRECISION, prec, &precision))
|
||||
if (!ComputePrecisionInRange(cx, 0, MAX_PRECISION, prec, &precision))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue