Show
Ignore:
Timestamp:
08/20/08 13:23:52 (5 months ago)
Author:
mbensi
Message:

merge with webkit revision 35853

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/JavaScriptCore/kjs/JSCell.h

    r440 r447  
    4444    public: 
    4545        // Querying the type. 
    46         virtual JSType type() const = 0; 
    4746        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; 
    5151 
    5252        // Extracting the value. 
     
    6767 
    6868        // Basic conversions. 
    69         virtual JSValue* toPrimitive(ExecState*, JSType preferredType = UnspecifiedType) const = 0; 
     69        virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const = 0; 
    7070        virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*&) = 0; 
    7171        virtual bool toBoolean(ExecState*) const = 0; 
     
    111111    inline bool JSCell::isNumber() const 
    112112    { 
    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)); 
    124114    } 
    125115 
     
    157147    { 
    158148        return !JSImmediate::isImmediate(this) && asCell()->isString(); 
     149    } 
     150 
     151    inline bool JSValue::isGetterSetter() const 
     152    { 
     153        return !JSImmediate::isImmediate(this) && asCell()->isGetterSetter(); 
    159154    } 
    160155 
     
    234229    } 
    235230 
    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 
    242232    { 
    243233        return JSImmediate::isImmediate(this) ? const_cast<JSValue*>(this) : asCell()->toPrimitive(exec, preferredType);