Changeset 37714 in webkit for trunk/JavaScriptCore/kjs/JSValue.h
- Timestamp:
- Oct 20, 2008, 12:29:28 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSValue.h
r37712 r37714 36 36 namespace JSC { 37 37 38 class ExecState;39 38 class Identifier; 40 class JSCell;41 class JSObject;42 39 class JSString; 43 40 class PropertySlot; 44 41 class PutPropertySlot; 45 class StructureID;46 42 47 43 struct ClassInfo; … … 50 46 enum PreferredPrimitiveType { NoPreference, PreferNumber, PreferString }; 51 47 52 /**53 * JSValue is the base type for all primitives (Undefined, Null, Boolean,54 * String, Number) and objects in ECMAScript.55 *56 * Note: you should never inherit from JSValue as it is for primitive types57 * only (all of which are provided internally by KJS). Instead, inherit from58 * JSObject.59 */60 48 class JSValue : Noncopyable { 61 friend class JSCell; // so it can derive from this class62 49 private: 63 50 JSValue(); 64 virtual~JSValue();51 ~JSValue(); 65 52 66 53 public: … … 74 61 bool isGetterSetter() const; 75 62 bool isObject() const; 76 bool isObject(const ClassInfo*) const; // FIXME: Merge with inherits.63 bool isObject(const ClassInfo*) const; 77 64 78 65 // Extracting the value. 79 66 bool getBoolean(bool&) const; 80 67 bool getBoolean() const; // false if not a boolean 81 bool getNumber(double&) const;82 68 double getNumber() const; // NaN if not a number 83 69 double uncheckedGetNumber() const; 84 70 bool getString(UString&) const; 85 71 UString getString() const; // null string if not a string 86 JSObject* getObject(); // NULL if not an object 87 const JSObject* getObject() const; // NULL if not an object 72 JSObject* getObject() const; // 0 if not an object 88 73 89 74 CallType getCallData(CallData&); … … 105 90 double toNumber(ExecState*) const; 106 91 JSValuePtr toJSNumber(ExecState*) const; // Fast path for when you expect that the value is an immediate number. 92 107 93 UString toString(ExecState*) const; 108 94 JSObject* toObject(ExecState*) const; … … 160 146 uint32_t toUInt32SlowCase(double, bool& ok); 161 147 162 inline JSValue::JSValue()163 {164 }165 166 inline JSValue::~JSValue()167 {168 }169 170 148 inline JSValuePtr JSValue::asValue() const 171 149 {
Note:
See TracChangeset
for help on using the changeset viewer.