Changeset 2783 in webkit for trunk/JavaScriptCore/kjs/internal.cpp
- Timestamp:
- Nov 20, 2002, 1:12:14 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/internal.cpp
r2760 r2783 222 222 // ------------------------------ NumberImp ------------------------------------ 223 223 224 NumberImp *NumberImp::staticNaN; 225 226 ValueImp *NumberImp::create(int i) 227 { 228 if (SimpleNumber::fits(i)) 229 return SimpleNumber::make(i); 230 NumberImp *imp = new NumberImp(static_cast<double>(i)); 231 imp->setGcAllowedFast(); 232 return imp; 233 } 234 235 ValueImp *NumberImp::create(double d) 236 { 237 if (SimpleNumber::fits(d)) 238 return SimpleNumber::make((int)d); 239 if (isNaN(d)) 240 return staticNaN; 241 NumberImp *imp = new NumberImp(d); 242 imp->setGcAllowedFast(); 243 return imp; 244 } 245 224 246 Value NumberImp::toPrimitive(ExecState *, Type) const 225 247 { … … 453 475 BooleanImp::staticFalse = new BooleanImp(false); 454 476 BooleanImp::staticFalse->ref(); 477 NumberImp::staticNaN = new NumberImp(NaN); 478 NumberImp::staticNaN->ref(); 455 479 } 456 480 … … 470 494 BooleanImp::staticFalse->setGcAllowed(); 471 495 BooleanImp::staticFalse = 0L; 496 NumberImp::staticNaN->deref(); 497 NumberImp::staticNaN->setGcAllowed(); 498 NumberImp::staticNaN = 0; 472 499 } 473 500 … … 787 814 788 815 InternalFunctionImp::InternalFunctionImp(FunctionPrototypeImp *funcProto) 789 : ObjectImp( Object(funcProto))816 : ObjectImp(funcProto) 790 817 { 791 818 }
Note:
See TracChangeset
for help on using the changeset viewer.