copy_string(aReadable.BeginReading(), aReadable.EndReading(), buffer); do_ReplaceFromReadable(cutStart, cutLength, basic_nsLiteralString<CharT>(buffer, length)); delete buffer;
PRUint32 length = aReadable.Length(); CharT* buffer = new CharT[length]; if ( buffer ) { copy_string(aReadable.BeginReading(), aReadable.EndReading(), buffer); do_ReplaceFromReadable(cutStart, cutLength, basic_nsLiteralString<CharT>(buffer, length)); delete buffer; }
basic_nsAWritableString<CharT>::ReplaceFromPromise( PRUint32 cutStart, PRUint32 cutLength, const nsPromiseReadable<CharT>& aReadable )  {    PRUint32 length = aReadable.Length();    CharT* buffer = new CharT[length];    if ( buffer )      {        copy_string(aReadable.BeginReading(), aReadable.EndReading(), buffer);        do_ReplaceFromReadable(cutStart, cutLength, basic_nsLiteralString<CharT>(buffer, length));        delete buffer;      }  }