Show
Ignore:
Timestamp:
08/18/08 11:14:49 (5 months ago)
Author:
odole
Message:

merge with webkit revision 35814

Files:

Legend:

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

    r402 r440  
    2828#include "ExecState.h" 
    2929#include "JSCell.h" 
     30#include "JSNumberCell.h" 
    3031#include "PropertySlot.h" 
    3132#include "identifier.h" 
     
    5152 
    5253        bool getStringPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 
    53         bool getStringPropertySlot(unsigned propertyName, PropertySlot&); 
     54        bool getStringPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 
    5455 
    5556        bool canGetIndex(unsigned i) { return i < static_cast<unsigned>(m_value.size()); } 
     
    7879        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 
    7980 
    80         static JSValue* lengthGetter(ExecState*, const Identifier&, const PropertySlot&); 
    81         static JSValue* indexGetter(ExecState*, const Identifier&, const PropertySlot&); 
    82         static JSValue* indexNumericPropertyGetter(ExecState*, unsigned, const PropertySlot&); 
    83  
    8481        UString m_value; 
    8582    }; 
     
    9693    { 
    9794        if (propertyName == exec->propertyNames().length) { 
    98             slot.setCustom(this, lengthGetter); 
     95            slot.setValue(jsNumber(exec, value().size())); 
    9996            return true; 
    10097        } 
     
    103100        unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); 
    104101        if (isStrictUInt32 && i < static_cast<unsigned>(m_value.size())) { 
    105             slot.setCustomIndex(this, i, indexGetter); 
     102            slot.setValue(jsString(exec, value().substr(i, 1))); 
    106103            return true; 
    107104        } 
     
    110107    } 
    111108         
    112     ALWAYS_INLINE bool JSString::getStringPropertySlot(unsigned propertyName, PropertySlot& slot) 
     109    ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 
    113110    { 
    114111        if (propertyName < static_cast<unsigned>(m_value.size())) { 
    115             slot.setCustomNumeric(this, indexNumericPropertyGetter); 
     112            slot.setValue(jsString(exec, value().substr(propertyName, 1))); 
    116113            return true; 
    117114        }