Changeset 34821 in webkit for trunk/JavaScriptCore/kjs/JSValue.h
- Timestamp:
- Jun 26, 2008, 7:53:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSValue.h
r34754 r34821 36 36 class ExecState; 37 37 class Identifier; 38 class JSCell; 38 39 class JSObject; 39 class JS Cell;40 class JSString; 40 41 class PropertySlot; 41 42 … … 131 132 bool deleteProperty(ExecState*, const Identifier& propertyName); 132 133 bool deleteProperty(ExecState*, unsigned propertyName); 134 133 135 JSObject* toThisObject(ExecState*) const; 136 UString toThisString(ExecState*) const; 137 JSString* toThisJSString(ExecState*); 138 139 JSValue* getJSNumber(); // 0 if this is not a JSNumber or number object 134 140 135 141 private: … … 199 205 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 200 206 virtual bool deleteProperty(ExecState*, unsigned propertyName); 207 201 208 virtual JSObject* toThisObject(ExecState*) const; 209 virtual UString toThisString(ExecState*) const; 210 virtual JSString* toThisJSString(ExecState*); 211 virtual JSValue* getJSNumber(); 202 212 203 213 private: … … 220 230 virtual UString toString(ExecState*) const; 221 231 virtual JSObject* toObject(ExecState*) const; 232 233 virtual UString toThisString(ExecState*) const; 222 234 virtual JSObject* toThisObject(ExecState*) const; 235 virtual JSValue* getJSNumber(); 223 236 224 237 void* operator new(size_t size, ExecState* exec) … … 244 257 }; 245 258 246 JS Cell* jsString(ExecState*, const UString&); // returns empty string if passed null string247 JS Cell* jsString(ExecState*, const char* = ""); // returns empty string if passed 0259 JSString* jsString(ExecState*, const UString&); // returns empty string if passed null string 260 JSString* jsString(ExecState*, const char* = ""); // returns empty string if passed 0 248 261 249 262 // should be used for strings that are owned by an object that will 250 263 // likely outlive the JSValue this makes, such as the parse tree or a 251 264 // DOM object that contains a UString 252 JS Cell* jsOwnedString(ExecState*, const UString&);265 JSString* jsOwnedString(ExecState*, const UString&); 253 266 254 267 extern const double NaN; … … 596 609 } 597 610 611 inline UString JSValue::toThisString(ExecState* exec) const 612 { 613 return JSImmediate::isImmediate(this) ? JSImmediate::toString(this) : asCell()->toThisString(exec); 614 } 615 616 inline JSString* JSValue::toThisJSString(ExecState* exec) 617 { 618 return JSImmediate::isImmediate(this) ? jsString(exec, JSImmediate::toString(this)) : asCell()->toThisJSString(exec); 619 } 620 621 inline JSValue* JSValue::getJSNumber() 622 { 623 return JSImmediate::isNumber(this) ? this : (JSImmediate::isImmediate(this) ? 0 : asCell()->getJSNumber()); 624 } 625 598 626 } // namespace KJS 599 627
Note:
See TracChangeset
for help on using the changeset viewer.