vendor/v8/test/mjsunit/math-sqrt.js in mustang-0.0.1 vs vendor/v8/test/mjsunit/math-sqrt.js in mustang-0.1.0

- old
+ new

@@ -27,10 +27,14 @@ // Tests the special cases specified by ES 15.8.2.17 function test(expected_sqrt, value) { assertEquals(expected_sqrt, Math.sqrt(value)); - if (isFinite(value)) { + if (isFinite(value)) { + if (value === 0 && (1 / value) == -Infinity) { + // Math.pow(-0, 0.5) must be zero, but Math.sqrt(-0) is -0. + expected_sqrt = 0; + } assertEquals(expected_sqrt, Math.pow(value, 0.5)); } } // Simple sanity check