X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..2656c66b5b30d5597e842a751c7f19ad6c2fe31a:/runtime/JSStringJoiner.cpp diff --git a/runtime/JSStringJoiner.cpp b/runtime/JSStringJoiner.cpp index 7e20d21..f9870c3 100644 --- a/runtime/JSStringJoiner.cpp +++ b/runtime/JSStringJoiner.cpp @@ -29,7 +29,7 @@ #include "ExceptionHelpers.h" #include "JSScope.h" #include "JSString.h" -#include "Operations.h" +#include "JSCInlines.h" #include namespace JSC { @@ -80,7 +80,7 @@ static inline PassRefPtr joinStrings(const Vector& strings, CharacterType* data; RefPtr outputStringImpl = StringImpl::tryCreateUninitialized(outputLength, data); if (!outputStringImpl) - return PassRefPtr(); + return nullptr; const String firstString = strings.first(); appendStringToData(data, firstString); @@ -90,7 +90,7 @@ static inline PassRefPtr joinStrings(const Vector& strings, appendStringToData(data, strings[i]); } - ASSERT(data == (outputStringImpl->getCharacters() + outputStringImpl->length())); + ASSERT(data == (outputStringImpl->characters() + outputStringImpl->length())); return outputStringImpl.release(); } @@ -102,13 +102,13 @@ JSValue JSStringJoiner::join(ExecState* exec) if (!m_strings.size()) return jsEmptyString(exec); - Checked separatorLength = m_separator.length(); + Checked separatorLength = m_separator.length(); // FIXME: add special cases of joinStrings() for (separatorLength == 0) and (separatorLength == 1). ASSERT(m_strings.size() > 0); - Checked totalSeparactorsLength = separatorLength * (m_strings.size() - 1); - Checked outputStringSize = totalSeparactorsLength + m_accumulatedStringsLength; + Checked totalSeparactorsLength = separatorLength * (m_strings.size() - 1); + Checked outputStringSize = totalSeparactorsLength + m_accumulatedStringsLength; - size_t finalSize; + unsigned finalSize; if (outputStringSize.safeGet(finalSize) == CheckedState::DidOverflow) return throwOutOfMemoryError(exec);