Fix the builtin Math.min and Math.max function
JerryScript-DCO-1.0-Signed-off-by: Kristof Kosztyo kkosztyo.u-szeged@partner.samsung.com
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
|
||||
assert(isNaN (Math['max'] (1.0, NaN)));
|
||||
assert(isNaN (Math['max'] (NaN, 1.0)));
|
||||
assert(isNaN (Math['max'] (Infinity, NaN)));
|
||||
assert(isNaN (Math['max'] (NaN, Infinity)));
|
||||
assert(Math['max'] (1.0, 3.0, 0.0) === 3.0);
|
||||
assert(Math['max'] (1.0, 3.0, Infinity) === Infinity);
|
||||
assert(Math['max'] (1.0, 3.0, -Infinity) === 3.0);
|
||||
@@ -23,9 +25,5 @@ assert(Math['max'] (Infinity, Infinity) === Infinity);
|
||||
assert(Math['max'] (-Infinity, -Infinity) === -Infinity);
|
||||
assert(Math['max'] () === -Infinity);
|
||||
|
||||
/*
|
||||
FIXME: Uncomment when unary minus support appears.
|
||||
|
||||
assert(Math['max'] (0.0, -0.0) === 0.0);
|
||||
assert(Math['max'] (-0.0, 0.0) === 0.0);
|
||||
*/
|
||||
|
||||
Vendored
+2
-4
@@ -14,6 +14,8 @@
|
||||
|
||||
assert(isNaN (Math['min'] (1.0, NaN)));
|
||||
assert(isNaN (Math['min'] (NaN, 1.0)));
|
||||
assert(isNaN (Math['min'] (-Infinity, NaN)));
|
||||
assert(isNaN (Math['min'] (NaN, -Infinity)));
|
||||
assert(Math['min'] (1.0, 3.0, 0.0) === 0.0);
|
||||
assert(Math['min'] (1.0, 3.0, Infinity) === 1.0);
|
||||
assert(Math['min'] (1.0, 3.0, -Infinity) === -Infinity);
|
||||
@@ -23,9 +25,5 @@ assert(Math['min'] (Infinity, Infinity) === Infinity);
|
||||
assert(Math['min'] (-Infinity, -Infinity) === -Infinity);
|
||||
assert(Math['min'] () === Infinity);
|
||||
|
||||
/*
|
||||
FIXME: Uncomment when unary minus support appears.
|
||||
|
||||
assert(Math['min'] (0.0, -0.0) === -0.0);
|
||||
assert(Math['min'] (-0.0, 0.0) === -0.0);
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user