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

Unified Diff: src/js/math.js

Issue 1404943002: Use import/export for more functions (instead of js builtins object). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/macros.py ('k') | src/js/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/math.js
diff --git a/src/js/math.js b/src/js/math.js
index 2c0c30ef54c088033a50b90fdde63666d9eb9c55..1a9a349b25979f6d79951f679671225c7b726d9c 100644
--- a/src/js/math.js
+++ b/src/js/math.js
@@ -15,6 +15,7 @@ var rngstate; // Initialized to a Uint32Array during genesis.
var GlobalMath = global.Math;
var GlobalObject = global.Object;
var InternalArray = utils.InternalArray;
+var NaN = %GetRootNaN();
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
//-------------------------------------------------------------------
@@ -82,7 +83,7 @@ function MathMax(arg1, arg2) { // length == 2
return (arg1 === 0 && %_IsMinusZero(arg1)) ? arg2 : arg1;
}
// All comparisons failed, one of the arguments must be NaN.
- return NAN;
+ return NaN;
}
var r = -INFINITY;
for (var i = 0; i < length; i++) {
@@ -109,7 +110,7 @@ function MathMin(arg1, arg2) { // length == 2
return (arg1 === 0 && %_IsMinusZero(arg1)) ? arg1 : arg2;
}
// All comparisons failed, one of the arguments must be NaN.
- return NAN;
+ return NaN;
}
var r = INFINITY;
for (var i = 0; i < length; i++) {
@@ -206,7 +207,7 @@ function MathAsinh(x) {
// ES6 draft 09-27-13, section 20.2.2.3.
function MathAcosh(x) {
x = TO_NUMBER(x);
- if (x < 1) return NAN;
+ if (x < 1) return NaN;
// Idempotent for NaN and +Infinity.
if (!NUMBER_IS_FINITE(x)) return x;
return MathLog(x + %_MathSqrt(x + 1) * %_MathSqrt(x - 1));
@@ -218,7 +219,7 @@ function MathAtanh(x) {
// Idempotent for +/-0.
if (x === 0) return x;
// Returns NaN for NaN and +/- Infinity.
- if (!NUMBER_IS_FINITE(x)) return NAN;
+ if (!NUMBER_IS_FINITE(x)) return NaN;
return 0.5 * MathLog((1 + x) / (1 - x));
}
« no previous file with comments | « src/js/macros.py ('k') | src/js/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698