Chromium Code Reviews| Index: src/harmony-math.js |
| diff --git a/src/harmony-math.js b/src/harmony-math.js |
| index ee426ef1191f417b2178b17581c1a516704ecaab..7fb1ba0df6367e228e0ebdaa6d3abd3c83121459 100644 |
| --- a/src/harmony-math.js |
| +++ b/src/harmony-math.js |
| @@ -154,6 +154,26 @@ function MathHypot(x, y) { // Function length is 2. |
| } |
| +//ES6 draft 09-27-13, section 20.2.2.9. |
| +function MathCbrt(x) { |
| + if (!IS_NUMBER(x)) x = NonNumberToNumber(x); |
| + if (x === 0 || !NUMBER_IS_FINITE(x)) return x; |
|
Jarin
2014/02/18 14:08:53
Is there any reason why you check for the corner c
|
| + return %Math_cbrt(x); |
| +} |
| + |
| + |
| +//ES6 draft 09-27-13, section 20.2.2.14. |
| +function MathExpm1(x) { |
| + return %Math_expm1(TO_NUMBER_INLINE(x)); |
| +} |
| + |
| + |
| +//ES6 draft 09-27-13, section 20.2.2.20. |
| +function MathLog1p(x) { |
| + return %Math_log1p(TO_NUMBER_INLINE(x)); |
| +} |
| + |
| + |
| function ExtendMath() { |
| %CheckIsBootstrapping(); |
| @@ -169,7 +189,10 @@ function ExtendMath() { |
| "atanh", MathAtanh, |
| "log10", MathLog10, |
| "log2", MathLog2, |
| - "hypot", MathHypot |
| + "hypot", MathHypot, |
| + "cbrt", MathCbrt, |
| + "log1p", MathLog1p, |
| + "expm1", MathExpm1 |
| )); |
| } |