Changeset 447 for trunk/JavaScriptCore/kjs/JSCell.h
- Timestamp:
- 08/20/08 13:23:52 (5 months ago)
- Files:
-
- trunk/JavaScriptCore/kjs/JSCell.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/JavaScriptCore/kjs/JSCell.h
r440 r447 44 44 public: 45 45 // Querying the type. 46 virtual JSType type() const = 0;47 46 bool isNumber() const; 48 bool isString() const; 49 bool isObject() const; 50 bool isObject(const ClassInfo*) const; // FIXME: Merge with inherits. 47 virtual bool isString() const; 48 virtual bool isGetterSetter() const; 49 virtual bool isObject() const; 50 virtual bool isObject(const ClassInfo*) const; 51 51 52 52 // Extracting the value. … … 67 67 68 68 // Basic conversions. 69 virtual JSValue* toPrimitive(ExecState*, JSType preferredType = UnspecifiedType) const = 0;69 virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const = 0; 70 70 virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*&) = 0; 71 71 virtual bool toBoolean(ExecState*) const = 0; … … 111 111 inline bool JSCell::isNumber() const 112 112 { 113 return type() == NumberType; 114 } 115 116 inline bool JSCell::isString() const 117 { 118 return type() == StringType; 119 } 120 121 inline bool JSCell::isObject() const 122 { 123 return type() == ObjectType; 113 return Heap::isNumber(const_cast<JSCell*>(this)); 124 114 } 125 115 … … 157 147 { 158 148 return !JSImmediate::isImmediate(this) && asCell()->isString(); 149 } 150 151 inline bool JSValue::isGetterSetter() const 152 { 153 return !JSImmediate::isImmediate(this) && asCell()->isGetterSetter(); 159 154 } 160 155 … … 234 229 } 235 230 236 inline JSType JSValue::type() const 237 { 238 return JSImmediate::isImmediate(this) ? JSImmediate::type(this) : asCell()->type(); 239 } 240 241 inline JSValue* JSValue::toPrimitive(ExecState* exec, JSType preferredType) const 231 inline JSValue* JSValue::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const 242 232 { 243 233 return JSImmediate::isImmediate(this) ? const_cast<JSValue*>(this) : asCell()->toPrimitive(exec, preferredType);
