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

Unified Diff: src/math.js

Issue 1148007: Merge bleeding_edge from version 2.1.3 up to revision 4205... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 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
Index: src/math.js
===================================================================
--- src/math.js (revision 4205)
+++ src/math.js (working copy)
@@ -45,7 +45,8 @@
function MathAbs(x) {
if (%_IsSmi(x)) return x >= 0 ? x : -x;
if (!IS_NUMBER(x)) x = ToNumber(x);
- return %Math_abs(x);
+ if (x === 0) return 0; // To handle -0.
+ return x > 0 ? x : -x;
}
// ECMA 262 - 15.8.2.2
@@ -84,7 +85,7 @@
// ECMA 262 - 15.8.2.7
function MathCos(x) {
if (!IS_NUMBER(x)) x = ToNumber(x);
- return %_Math_cos(x);
+ return %_MathCos(x);
}
// ECMA 262 - 15.8.2.8
@@ -159,7 +160,7 @@
function MathPow(x, y) {
if (!IS_NUMBER(x)) x = ToNumber(x);
if (!IS_NUMBER(y)) y = ToNumber(y);
- return %_Math_pow(x, y);
+ return %_MathPow(x, y);
}
// ECMA 262 - 15.8.2.14
@@ -170,19 +171,19 @@
// ECMA 262 - 15.8.2.15
function MathRound(x) {
if (!IS_NUMBER(x)) x = ToNumber(x);
- return %Math_round(x);
+ return %RoundNumber(x);
}
// ECMA 262 - 15.8.2.16
function MathSin(x) {
if (!IS_NUMBER(x)) x = ToNumber(x);
- return %_Math_sin(x);
+ return %_MathSin(x);
}
// ECMA 262 - 15.8.2.17
function MathSqrt(x) {
if (!IS_NUMBER(x)) x = ToNumber(x);
- return %_Math_sqrt(x);
+ return %_MathSqrt(x);
}
// ECMA 262 - 15.8.2.18

Powered by Google App Engine
This is Rietveld 408576698