Index: test/mjsunit/harmony/math-log2-log10.js |
diff --git a/test/mjsunit/regress/regress-crbug-233737.js b/test/mjsunit/harmony/math-log2-log10.js |
similarity index 68% |
copy from test/mjsunit/regress/regress-crbug-233737.js |
copy to test/mjsunit/harmony/math-log2-log10.js |
index 38b44e056f24397d319d544f41afaea09b8b8d95..2ab496012cbe9785920b7f43f87f4bf571fcd435 100644 |
--- a/test/mjsunit/regress/regress-crbug-233737.js |
+++ b/test/mjsunit/harmony/math-log2-log10.js |
@@ -25,18 +25,23 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+// Flags: --harmony-maths |
-var a = new Array(2); |
-a[0] = 1; |
-assertTrue(%HasFastSmiElements(a)); |
-assertTrue(%HasFastHoleyElements(a)); |
+[Math.log10, Math.log2].forEach( function(fun) { |
+ assertTrue(isNaN(fun(NaN))); |
+ assertTrue(isNaN(fun(fun))); |
+ assertTrue(isNaN(fun({ toString: function() { return NaN; } }))); |
+ assertTrue(isNaN(fun({ valueOf: function() { return -1; } }))); |
+ assertTrue(isNaN(fun({ valueOf: function() { return "abc"; } }))); |
+ assertTrue(isNaN(fun(-0.1))); |
+ assertTrue(isNaN(fun(-1))); |
+ assertEquals("-Infinity", String(fun(0))); |
+ assertEquals("-Infinity", String(fun(-0))); |
+ assertEquals(0, fun(1)); |
+ assertEquals("Infinity", String(fun(Infinity))); |
+}); |
-function hole(i) { |
- return a[i] << 0; |
+for (var i = -300; i < 300; i += 0.7) { |
+ assertEqualsDelta(i, Math.log10(Math.pow(10, i)), 1E-13); |
+ assertEqualsDelta(i, Math.log2(Math.pow(2, i)), 1E-13); |
} |
- |
-assertEquals(1, hole(0)); |
-assertEquals(1, hole(0)); |
-%OptimizeFunctionOnNextCall(hole); |
-assertEquals(0, hole(1)); |