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/UString.h

    r54531 r54545  
    8282   
    8383    public:
    84         // UString constructors passed char*s assume ISO Latin-1 encoding; for UTF8 use 'createFromUTF8', below.
    8584        UString();
    8685        UString(const char*); // Constructor for null-terminated string.
     
    109108            return Rep::adopt(vector);
    110109        }
    111 
    112         static UString createFromUTF8(const char*);
    113110
    114111        static UString from(int);
Note: See TracChangeset for help on using the changeset viewer.