Changeset 34372 in webkit for trunk/JavaScriptCore/kjs/value.cpp
- Timestamp:
- Jun 4, 2008, 10:36:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/value.cpp
r34355 r34372 81 81 static const double D32 = 4294967296.0; 82 82 83 void *JSCell::operator new(size_t size)83 void* JSCell::operator new(size_t size) 84 84 { 85 85 return Collector::allocate(size); … … 102 102 103 103 // ECMA 9.4 104 double JSValue::toInteger(ExecState *exec) const104 double JSValue::toInteger(ExecState* exec) const 105 105 { 106 106 int32_t i; … … 111 111 } 112 112 113 double JSValue::toIntegerPreserveNaN(ExecState *exec) const113 double JSValue::toIntegerPreserveNaN(ExecState* exec) const 114 114 { 115 115 int32_t i; … … 172 172 } 173 173 174 bool JSCell::getNumber(double &numericValue) const174 bool JSCell::getNumber(double& numericValue) const 175 175 { 176 176 if (!isNumber()) 177 177 return false; 178 numericValue = static_cast<const NumberImp 178 numericValue = static_cast<const NumberImp*>(this)->value(); 179 179 return true; 180 180 } … … 182 182 double JSCell::getNumber() const 183 183 { 184 return isNumber() ? static_cast<const NumberImp 185 } 186 187 bool JSCell::getString(UString 184 return isNumber() ? static_cast<const NumberImp*>(this)->value() : NaN; 185 } 186 187 bool JSCell::getString(UString&stringValue) const 188 188 { 189 189 if (!isString()) 190 190 return false; 191 stringValue = static_cast<const StringImp 191 stringValue = static_cast<const StringImp*>(this)->value(); 192 192 return true; 193 193 } … … 195 195 UString JSCell::getString() const 196 196 { 197 return isString() ? static_cast<const StringImp 198 } 199 200 JSObject 201 { 202 return isObject() ? static_cast<JSObject 203 } 204 205 const JSObject *JSCell::getObject() const206 { 207 return isObject() ? static_cast<const JSObject 197 return isString() ? static_cast<const StringImp*>(this)->value() : UString(); 198 } 199 200 JSObject*JSCell::getObject() 201 { 202 return isObject() ? static_cast<JSObject*>(this) : 0; 203 } 204 205 const JSObject* JSCell::getObject() const 206 { 207 return isObject() ? static_cast<const JSObject*>(this) : 0; 208 208 } 209 209
Note:
See TracChangeset
for help on using the changeset viewer.