Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1937)

Unified Diff: test/mjsunit/to_number_order.js

Issue 1669773002: [math] Fix Math.hypot to properly call ToNumber on all arguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/math.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/to_number_order.js
diff --git a/test/mjsunit/to_number_order.js b/test/mjsunit/to_number_order.js
index 50e4bc762e57c5a493da390e267260e66214b5f0..c20ec5e147a24cc0b33f7b6296646610eb0c4e12 100644
--- a/test/mjsunit/to_number_order.js
+++ b/test/mjsunit/to_number_order.js
@@ -56,6 +56,13 @@ x = "";
assertEquals(1, Math.pow(v, w));
assertEquals("hestfisk", x, "pow");
+x = "";
+var a = {valueOf: function() { x += "hest"; return 1/0; }};
+var b = {valueOf: function() { x += "fisk"; return 1}};
+assertEquals(1/0, Math.hypot(a, b));
+assertEquals("hestfisk", x, "hypot");
+
+
var year = { valueOf: function() { x += 1; return 2007; } };
var month = { valueOf: function() { x += 2; return 2; } };
var date = { valueOf: function() { x += 3; return 4; } };
« no previous file with comments | « src/js/math.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698