Changeset 88587 in webkit for trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
- Timestamp:
- Jun 10, 2011, 7:03:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r86727 r88587 49 49 50 50 namespace JSC { 51 52 #define NaN std::numeric_limits<double>::quiet_NaN() 53 #define Inf std::numeric_limits<double>::infinity() 51 54 52 55 static JSValue encode(ExecState* exec, const char* doNotEscape) … … 473 476 if (isfinite(d)) 474 477 return JSValue::encode(jsNumber((d > 0) ? floor(d) : ceil(d))); 475 if (isnan(d) || isinf(d)) 476 return JSValue::encode(jsNaN()); 477 return JSValue::encode(jsNumber(0)); 478 return JSValue::encode(jsNaN()); 478 479 } 479 480 … … 494 495 { 495 496 double n = exec->argument(0).toNumber(exec); 496 return JSValue::encode(jsBoolean( !isnan(n) && !isinf(n)));497 return JSValue::encode(jsBoolean(isfinite(n))); 497 498 } 498 499
Note:
See TracChangeset
for help on using the changeset viewer.