Ignore:
Timestamp:
Feb 22, 2010, 11:12:01 AM (15 years ago)
Author:
[email protected]
Message:

JSStringBuilder should not CRASH if allocation fails, it should throw a JSException.

Reviewed by Oliver Hunt.

  • runtime/JSGlobalObjectFunctions.cpp:
  • runtime/JSStringBuilder.h:

(JSC::JSStringBuilder::JSStringBuilder):
(JSC::JSStringBuilder::append):
(JSC::JSStringBuilder::build):

  • runtime/StringBuilder.h:

(JSC::StringBuilder::build):

  • wtf/Vector.h:

(WTF::VectorBufferBase::tryAllocateBuffer):
(WTF::):
(WTF::VectorBuffer::tryAllocateBuffer):
(WTF::::tryExpandCapacity):
(WTF::::tryReserveCapacity):
(WTF::::tryAppend):

File:
1 edited

Legend:

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

    r54571 r55093  
    7070    {
    7171        buffer.shrinkToFit();
    72         if (buffer.size() && !buffer.data())
    73             CRASH();
     72        ASSERT(buffer.data() || !buffer.size());
    7473        return UString::adopt(buffer);
    7574    }
Note: See TracChangeset for help on using the changeset viewer.