Ignore:
Timestamp:
Feb 9, 2010, 3:55:39 AM (15 years ago)
Author:
[email protected]
Message:

Three small string fixes:
(1) StringBuilder::release should CRASH if the buffer allocation failed.
(2) Remove weird, dead code from JSString::tryGetValue, replace with an ASSERT.
(3) Move UString::createFromUTF8 out to the API, as tryCreateStringFromUTF8.

This is only used from the API, and (now) unlike other UString::create
methods may return UString::null() to indicate failure cases. Better
handle these in the API.

Reviewed by Oliver Hunt.

  • API/JSClassRef.cpp:

(tryCreateStringFromUTF8):
(OpaqueJSClass::OpaqueJSClass):
(OpaqueJSClassContextData::OpaqueJSClassContextData):

  • runtime/JSString.h:

(JSC::Fiber::tryGetValue):

  • runtime/StringBuilder.h:

(JSC::StringBuilder::release):

  • runtime/UString.cpp:

(JSC::UString::UString):
(JSC::UString::from):
(JSC::UString::find):

  • runtime/UString.h:
File:
1 edited

Legend:

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

    r54464 r54545  
    8888    static PassRefPtr<UStringImpl> adopt(Vector<UChar, inlineCapacity>& vector)
    8989    {
     90        ASSERT(vector.data());
    9091        if (unsigned length = vector.size())
    9192            return adoptRef(new UStringImpl(vector.releaseBuffer(), length, BufferOwned));
Note: See TracChangeset for help on using the changeset viewer.