Changeset 37333 in webkit for trunk/JavaScriptCore/kjs/JSObject.h
- Timestamp:
- Oct 6, 2008, 10:50:08 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSObject.h
r37068 r37333 29 29 #include "ExecState.h" 30 30 #include "JSNumberCell.h" 31 #include "JSString.h" 31 32 #include "PropertyMap.h" 32 33 #include "PropertySlot.h" … … 110 111 virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const; 111 112 virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value); 112 virtual bool toBoolean(ExecState*) const;113 bool toBoolean() const { return true; } 113 114 virtual double toNumber(ExecState*) const; 114 115 virtual UString toString(ExecState*) const; … … 245 246 } 246 247 return false; 248 } 249 250 inline bool JSCell::toBoolean() const 251 { 252 JSType type = structureID()->typeInfo().type(); 253 if (type == NumberType) 254 return static_cast<const JSNumberCell*>(this)->toBoolean(); 255 if (type == ObjectType) 256 return static_cast<const JSObject*>(this)->toBoolean(); 257 ASSERT(type == StringType); 258 return static_cast<const JSString*>(this)->toBoolean(); 247 259 } 248 260
Note:
See TracChangeset
for help on using the changeset viewer.