Changeset 10456 in webkit for trunk/JavaScriptCore/kjs/operations.cpp
- Timestamp:
- Sep 3, 2005, 6:18:13 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/operations.cpp
r10412 r10456 21 21 */ 22 22 23 #ifdef HAVE_CONFIG_H 23 #include "operations.h" 24 24 25 #include "config.h" 25 #endif26 26 27 27 #include <stdio.h> … … 40 40 #endif 41 41 42 #include "operations.h"43 42 #include "object.h" 44 43 45 using namespace KJS; 44 namespace KJS { 46 45 47 46 #if !APPLE_CHANGES 48 47 49 bool KJS::isNaN(double d)48 bool isNaN(double d) 50 49 { 51 50 #ifdef HAVE_FUNC_ISNAN … … 58 57 } 59 58 60 bool KJS::isInf(double d) 61 { 62 #if defined(HAVE_FUNC_ISINF) 59 bool isInf(double d) 60 { 61 #if WIN32 62 int fpClass = _fpclass(d); 63 return _FPCLASS_PINF == fpClass || _FPCLASS_NINF == fpClass; 64 #elif defined(HAVE_FUNC_ISINF) 63 65 return isinf(d); 64 66 #elif HAVE_FUNC_FINITE … … 71 73 } 72 74 73 bool KJS::isPosInf(double d) 74 { 75 #if APPLE_CHANGES 76 return isinf(d) && d > 0; 77 #else 78 #if defined(HAVE_FUNC_ISINF) 75 bool isPosInf(double d) 76 { 77 #if WIN32 78 return _FPCLASS_PINF == _fpclass(d); 79 #elif defined(HAVE_FUNC_ISINF) 79 80 return (isinf(d) == 1); 80 81 #elif HAVE_FUNC_FINITE … … 85 86 return false; 86 87 #endif 87 #endif 88 } 89 90 bool KJS::isNegInf(double d) 91 { 92 #if APPLE_CHANGES 93 return isinf(d) && d < 0; 94 #else 95 #if defined(HAVE_FUNC_ISINF) 88 } 89 90 bool isNegInf(double d) 91 { 92 #if WIN32 93 return _FPCLASS_PINF == _fpclass(d); 94 #elif defined(HAVE_FUNC_ISINF) 96 95 return (isinf(d) == -1); 97 96 #elif HAVE_FUNC_FINITE … … 102 101 return false; 103 102 #endif 104 #endif105 103 } 106 104 … … 108 106 109 107 // ECMA 11.9.3 110 bool KJS::equal(ExecState *exec, ValueImp *v1, ValueImp *v2)108 bool equal(ExecState *exec, ValueImp *v1, ValueImp *v2) 111 109 { 112 110 Type t1 = v1->type(); … … 162 160 } 163 161 164 bool KJS::strictEqual(ExecState *exec, ValueImp *v1, ValueImp *v2)162 bool strictEqual(ExecState *exec, ValueImp *v1, ValueImp *v2) 165 163 { 166 164 Type t1 = v1->type(); … … 194 192 } 195 193 196 int KJS::relation(ExecState *exec, ValueImp *v1, ValueImp *v2)194 int relation(ExecState *exec, ValueImp *v1, ValueImp *v2) 197 195 { 198 196 ValueImp *p1 = v1->toPrimitive(exec,NumberType); … … 211 209 } 212 210 213 int KJS::maxInt(int d1, int d2)211 int maxInt(int d1, int d2) 214 212 { 215 213 return (d1 > d2) ? d1 : d2; 216 214 } 217 215 218 int KJS::minInt(int d1, int d2)216 int minInt(int d1, int d2) 219 217 { 220 218 return (d1 < d2) ? d1 : d2; … … 222 220 223 221 // ECMA 11.6 224 ValueImp * KJS::add(ExecState *exec, ValueImp *v1, ValueImp *v2, char oper)222 ValueImp *add(ExecState *exec, ValueImp *v1, ValueImp *v2, char oper) 225 223 { 226 224 // exception for the Date exception in defaultValue() … … 247 245 248 246 // ECMA 11.5 249 ValueImp * KJS::mult(ExecState *exec, ValueImp *v1, ValueImp *v2, char oper)247 ValueImp *mult(ExecState *exec, ValueImp *v1, ValueImp *v2, char oper) 250 248 { 251 249 bool n1KnownToBeInteger; … … 270 268 return jsNumber(result, resultKnownToBeInteger); 271 269 } 270 271 }
Note:
See TracChangeset
for help on using the changeset viewer.