Ignore:
Timestamp:
Feb 8, 2010, 11:40:57 PM (15 years ago)
Author:
[email protected]
Message:

Make String.replace throw an exception on out-of-memory, rather than
returning a null (err, empty-ish) string. Move String::replaceRange
and String::spliceSubstringsWithSeparators out to StringPrototype -
these were fairly specific use anyway, and we can better integrate
throwing the JS expcetion this way.

Reviewed by Oliver Hunt

Also removes redundant assignment operator from UString.

(JSC::StringRange::StringRange):
(JSC::jsSpliceSubstringsWithSeparators):
(JSC::jsReplaceRange):
(JSC::stringProtoFuncReplace):

  • runtime/UString.cpp:
  • runtime/UString.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/UString.h

    r54518 r54531  
    118118        static UString from(double);
    119119
    120         struct Range {
    121         public:
    122             Range(int pos, int len)
    123                 : position(pos)
    124                 , length(len)
    125             {
    126             }
    127 
    128             Range()
    129             {
    130             }
    131 
    132             int position;
    133             int length;
    134         };
    135 
    136         UString spliceSubstringsWithSeparators(const Range* substringRanges, int rangeCount, const UString* separators, int separatorCount) const;
    137 
    138         UString replaceRange(int rangeStart, int RangeEnd, const UString& replacement) const;
    139 
    140120        bool getCString(CStringBuffer&) const;
    141121
     
    153133         */
    154134        CString UTF8String(bool strict = false) const;
    155 
    156         UString& operator=(const char*c);
    157135
    158136        const UChar* data() const { return m_rep->data(); }
Note: See TracChangeset for help on using the changeset viewer.