Chromium Code Reviews| Index: runtime/lib/math_patch.dart |
| =================================================================== |
| --- runtime/lib/math_patch.dart (revision 35009) |
| +++ runtime/lib/math_patch.dart (working copy) |
| @@ -20,6 +20,10 @@ |
| return 1.0; // ECMA-262 15.8.2.13 |
| } |
| if (base == 1.0) return 1.0; |
| + if (exponent == 1.0) return base; |
| + if (exponent == 2.0) return base * base; |
| + if (exponent == 3.0) return base * base * base; |
| + |
| if (base.isNaN || exponent.isNaN) { |
| return double.NAN; |
| } |