Bug 896264 - Disable Math.hypot until spec settles down. r=jorendorff a=lsblakk
authorBenjamin Peterson <benjamin@python.org>
Fri, 23 Aug 2013 16:38:23 -0500
changeset 153864 23bb539f70001f6bc5e01c69e9a2b408e6946c81
parent 153863 6efa0e1a63ab5505deda7587b538c386ba06d2b3
child 153865 83ae78484491e745ddf548770267654a5e434b95
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff, lsblakk
bugs896264
milestone25.0a2
Bug 896264 - Disable Math.hypot until spec settles down. r=jorendorff a=lsblakk
js/src/jsmath.cpp
js/src/jsmath.h
js/src/tests/ecma_6/Math/hypot-approx.js
js/src/tests/ecma_6/Math/hypot-exact.js
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -1096,16 +1096,18 @@ js::math_atanh_impl(MathCache *cache, do
 }
 
 JSBool
 js::math_atanh(JSContext *cx, unsigned argc, Value *vp)
 {
     return math_function<math_atanh_impl>(cx, argc, vp);
 }
 
+// Math.hypot is disabled pending the resolution of spec issues (bug 896264).
+#if 0
 #if !HAVE_HYPOT
 double hypot(double x, double y)
 {
     if (mozilla::IsInfinite(x) || mozilla::IsInfinite(y))
         return js_PositiveInfinity;
 
     if (mozilla::IsNaN(x) || mozilla::IsNaN(y))
         return js_NaN;
@@ -1161,16 +1163,17 @@ js::math_hypot(JSContext *cx, unsigned a
     double z;
     if (!ToNumber(cx, args[2], &z)) {
         return false;
     }
 
     args.rval().setNumber(math_hypot_impl(math_hypot_impl(x, y), z));
     return true;
 }
+#endif
 
 #if !HAVE_TRUNC
 double trunc(double x)
 {
     return x > 0 ? floor(x) : ceil(x);
 }
 #endif
 
@@ -1269,17 +1272,20 @@ static const JSFunctionSpec math_static_
     JS_FN("log1p",          math_log1p,           1, 0),
     JS_FN("expm1",          math_expm1,           1, 0),
     JS_FN("cosh",           math_cosh,            1, 0),
     JS_FN("sinh",           math_sinh,            1, 0),
     JS_FN("tanh",           math_tanh,            1, 0),
     JS_FN("acosh",          math_acosh,           1, 0),
     JS_FN("asinh",          math_asinh,           1, 0),
     JS_FN("atanh",          math_atanh,           1, 0),
+// Math.hypot is disabled pending the resolution of spec issues (bug 896264).
+#if 0
     JS_FN("hypot",          math_hypot,           2, 0),
+#endif
     JS_FN("trunc",          math_trunc,           1, 0),
     JS_FN("sign",           math_sign,            1, 0),
     JS_FN("cbrt",           math_cbrt,            1, 0),
     JS_FS_END
 };
 
 JSObject *
 js_InitMathClass(JSContext *cx, HandleObject obj)
--- a/js/src/jsmath.h
+++ b/js/src/jsmath.h
@@ -154,18 +154,21 @@ extern JSBool
 math_acosh(JSContext *cx, unsigned argc, js::Value *vp);
 
 extern JSBool
 math_asinh(JSContext *cx, unsigned argc, js::Value *vp);
 
 extern JSBool
 math_atanh(JSContext *cx, unsigned argc, js::Value *vp);
 
-extern JSBool
+// Math.hypot is disabled pending the resolution of spec issues (bug 896264).
+#if 0
+extern bool
 math_hypot(JSContext *cx, unsigned argc, Value *vp);
+#endif
 
 extern JSBool
 math_trunc(JSContext *cx, unsigned argc, Value *vp);
 
 extern JSBool
 math_sign(JSContext *cx, unsigned argc, Value *vp);
 
 extern JSBool
@@ -238,18 +241,21 @@ extern double
 math_acosh_impl(MathCache *cache, double x);
 
 extern double 
 math_asinh_impl(MathCache *cache, double x);
 
 extern double 
 math_atanh_impl(MathCache *cache, double x);
 
+// Math.hypot is disabled pending the resolution of spec issues (bug 896264).
+#if 0
 extern double 
 math_hypot_impl(double x, double y);
+#endif
 
 extern double 
 math_trunc_impl(MathCache *cache, double x);
 
 extern double 
 math_sign_impl(MathCache *cache, double x);
 
 extern double 
--- a/js/src/tests/ecma_6/Math/hypot-approx.js
+++ b/js/src/tests/ecma_6/Math/hypot-approx.js
@@ -1,8 +1,11 @@
+// |reftest| skip
+// Math.hypot is disabled pending the resolution of spec issues (bug 896264).
+
 for (var i = -20; i < 20; i++)
     assertEq(Math.hypot(+0, i), Math.abs(i));
 
 for (var i = -20; i < 20; i++)
     assertEq(Math.hypot(-0, i), Math.abs(i));
 
 for (var i = 1, j = 1; i < 2; i += 0.05, j += 0.05)
     assertNear(Math.hypot(i, j), Math.sqrt(i * i + j * j));
--- a/js/src/tests/ecma_6/Math/hypot-exact.js
+++ b/js/src/tests/ecma_6/Math/hypot-exact.js
@@ -1,8 +1,11 @@
+// |reftest| skip
+// Math.hypot is disabled pending the resolution of spec issues (bug 896264).
+
 // Properties of Math.hypot that are guaranteed by the spec.
 
 // If any argument is +∞, the result is +∞.
 // If any argument is −∞, the result is +∞.
 for (let inf of [Infinity, -Infinity]) {
     assertEq(Math.hypot(inf, 0), Infinity);
     assertEq(Math.hypot(0, inf), Infinity);
     assertEq(Math.hypot(inf, inf), Infinity);