summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/StringPrototype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/runtime/StringPrototype.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/StringPrototype.cpp142
1 files changed, 71 insertions, 71 deletions
diff --git a/Source/JavaScriptCore/runtime/StringPrototype.cpp b/Source/JavaScriptCore/runtime/StringPrototype.cpp
index 001e5e8b0..73633a60b 100644
--- a/Source/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/StringPrototype.cpp
@@ -162,7 +162,7 @@ bool StringPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec
// Helper for producing a JSString for 'string', where 'string' was been produced by
// calling ToString on 'originalValue'. In cases where 'originalValue' already was a
// string primitive we can just use this, otherwise we need to allocate a new JSString.
-static inline JSString* jsStringWithReuse(ExecState* exec, JSValue originalValue, const UString& string)
+static inline JSString* jsStringWithReuse(ExecState* exec, JSValue originalValue, const String& string)
{
if (originalValue.isString()) {
ASSERT(asString(originalValue)->value(exec) == string);
@@ -172,7 +172,7 @@ static inline JSString* jsStringWithReuse(ExecState* exec, JSValue originalValue
}
template <typename CharType>
-static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacement, const UString& source, const int* ovector, RegExp* reg, size_t i)
+static NEVER_INLINE String substituteBackreferencesSlow(const String& replacement, const String& source, const int* ovector, RegExp* reg, size_t i)
{
Vector<CharType> substitutedReplacement;
int offset = 0;
@@ -184,7 +184,7 @@ static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacem
if (ref == '$') {
// "$$" -> "$"
++i;
- substitutedReplacement.append(replacement.getCharacters<CharType>() + offset, i - offset);
+ substitutedReplacement.append(replacement.getCharactersWithUpconvert<CharType>() + offset, i - offset);
offset = i + 1;
continue;
}
@@ -224,21 +224,21 @@ static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacem
continue;
if (i - offset)
- substitutedReplacement.append(replacement.getCharacters<CharType>() + offset, i - offset);
+ substitutedReplacement.append(replacement.getCharactersWithUpconvert<CharType>() + offset, i - offset);
i += 1 + advance;
offset = i + 1;
if (backrefStart >= 0)
- substitutedReplacement.append(source.getCharacters<CharType>() + backrefStart, backrefLength);
+ substitutedReplacement.append(source.getCharactersWithUpconvert<CharType>() + backrefStart, backrefLength);
} while ((i = replacement.find('$', i + 1)) != notFound);
if (replacement.length() - offset)
- substitutedReplacement.append(replacement.getCharacters<CharType>() + offset, replacement.length() - offset);
+ substitutedReplacement.append(replacement.getCharactersWithUpconvert<CharType>() + offset, replacement.length() - offset);
substitutedReplacement.shrinkToFit();
- return UString::adopt(substitutedReplacement);
+ return String::adopt(substitutedReplacement);
}
-static inline UString substituteBackreferences(const UString& replacement, const UString& source, const int* ovector, RegExp* reg)
+static inline String substituteBackreferences(const String& replacement, const String& source, const int* ovector, RegExp* reg)
{
size_t i = replacement.find('$');
if (UNLIKELY(i != notFound)) {
@@ -249,7 +249,7 @@ static inline UString substituteBackreferences(const UString& replacement, const
return replacement;
}
-static inline int localeCompare(const UString& a, const UString& b)
+static inline int localeCompare(const String& a, const String& b)
{
return Collator::userDefault()->collate(reinterpret_cast<const ::UChar*>(a.characters()), a.length(), reinterpret_cast<const ::UChar*>(b.characters()), b.length());
}
@@ -270,7 +270,7 @@ public:
int length;
};
-static ALWAYS_INLINE JSValue jsSpliceSubstrings(ExecState* exec, JSString* sourceVal, const UString& source, const StringRange* substringRanges, int rangeCount)
+static ALWAYS_INLINE JSValue jsSpliceSubstrings(ExecState* exec, JSString* sourceVal, const String& source, const StringRange* substringRanges, int rangeCount)
{
if (rangeCount == 1) {
int sourceSize = source.length();
@@ -278,7 +278,7 @@ static ALWAYS_INLINE JSValue jsSpliceSubstrings(ExecState* exec, JSString* sourc
int length = substringRanges[0].length;
if (position <= 0 && length >= sourceSize)
return sourceVal;
- // We could call UString::substr, but this would result in redundant checks
+ // We could call String::substringSharingImpl(), but this would result in redundant checks.
return jsString(exec, StringImpl::create(source.impl(), max(0, position), min(sourceSize, length)));
}
@@ -287,7 +287,7 @@ static ALWAYS_INLINE JSValue jsSpliceSubstrings(ExecState* exec, JSString* sourc
totalLength += substringRanges[i].length;
if (!totalLength)
- return jsString(exec, "");
+ return jsEmptyString(exec);
if (source.is8Bit()) {
LChar* buffer;
@@ -325,7 +325,7 @@ static ALWAYS_INLINE JSValue jsSpliceSubstrings(ExecState* exec, JSString* sourc
return jsString(exec, impl.release());
}
-static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, JSString* sourceVal, const UString& source, const StringRange* substringRanges, int rangeCount, const UString* separators, int separatorCount)
+static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, JSString* sourceVal, const String& source, const StringRange* substringRanges, int rangeCount, const String* separators, int separatorCount)
{
if (rangeCount == 1 && separatorCount == 0) {
int sourceSize = source.length();
@@ -333,7 +333,7 @@ static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, J
int length = substringRanges[0].length;
if (position <= 0 && length >= sourceSize)
return sourceVal;
- // We could call UString::substr, but this would result in redundant checks
+ // We could call String::substringSharingImpl(), but this would result in redundant checks.
return jsString(exec, StringImpl::create(source.impl(), max(0, position), min(sourceSize, length)));
}
@@ -348,7 +348,7 @@ static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, J
}
if (!totalLength)
- return jsString(exec, "");
+ return jsEmptyString(exec);
if (source.is8Bit() && allSeperators8Bit) {
LChar* buffer;
@@ -403,7 +403,7 @@ static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, J
return jsString(exec, impl.release());
}
-static NEVER_INLINE EncodedJSValue removeUsingRegExpSearch(ExecState* exec, JSString* string, const UString& source, RegExp* regExp)
+static NEVER_INLINE EncodedJSValue removeUsingRegExpSearch(ExecState* exec, JSString* string, const String& source, RegExp* regExp)
{
size_t lastIndex = 0;
unsigned startPosition = 0;
@@ -444,13 +444,13 @@ static NEVER_INLINE EncodedJSValue removeUsingRegExpSearch(ExecState* exec, JSSt
static NEVER_INLINE EncodedJSValue replaceUsingRegExpSearch(ExecState* exec, JSString* string, JSValue searchValue)
{
JSValue replaceValue = exec->argument(1);
- UString replacementString;
+ String replacementString;
CallData callData;
CallType callType = getCallData(replaceValue, callData);
if (callType == CallTypeNone)
replacementString = replaceValue.toString(exec)->value(exec);
- const UString& source = string->value(exec);
+ const String& source = string->value(exec);
unsigned sourceLen = source.length();
if (exec->hadException())
return JSValue::encode(JSValue());
@@ -474,7 +474,7 @@ static NEVER_INLINE EncodedJSValue replaceUsingRegExpSearch(ExecState* exec, JSS
unsigned startPosition = 0;
Vector<StringRange, 16> sourceRanges;
- Vector<UString, 16> replacements;
+ Vector<String, 16> replacements;
// This is either a loop (if global is set) or a one-way (if not).
if (global && callType == CallTypeJS) {
@@ -601,7 +601,7 @@ static NEVER_INLINE EncodedJSValue replaceUsingRegExpSearch(ExecState* exec, JSS
if (replLen)
replacements.append(substituteBackreferences(replacementString, source, ovector, regExp));
else
- replacements.append(UString());
+ replacements.append(String());
}
}
@@ -628,8 +628,8 @@ static NEVER_INLINE EncodedJSValue replaceUsingRegExpSearch(ExecState* exec, JSS
static inline EncodedJSValue replaceUsingStringSearch(ExecState* exec, JSString* jsString, JSValue searchValue)
{
- const UString& string = jsString->value(exec);
- UString searchString = searchValue.toUString(exec);
+ const String& string = jsString->value(exec);
+ String searchString = searchValue.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -651,19 +651,19 @@ static inline EncodedJSValue replaceUsingStringSearch(ExecState* exec, JSString*
return JSValue::encode(jsUndefined());
}
- UString replaceString = replaceValue.toUString(exec);
+ String replaceString = replaceValue.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
StringImpl* stringImpl = string.impl();
- UString leftPart(StringImpl::create(stringImpl, 0, matchStart));
+ String leftPart(StringImpl::create(stringImpl, 0, matchStart));
size_t matchEnd = matchStart + searchString.impl()->length();
int ovector[2] = { matchStart, matchEnd};
- UString middlePart = substituteBackreferences(replaceString, string, ovector, 0);
+ String middlePart = substituteBackreferences(replaceString, string, ovector, 0);
size_t leftLength = stringImpl->length() - matchEnd;
- UString rightPart(StringImpl::create(stringImpl, matchEnd, leftLength));
+ String rightPart(StringImpl::create(stringImpl, matchEnd, leftLength));
return JSValue::encode(JSC::jsString(exec, leftPart, middlePart, rightPart));
}
@@ -699,7 +699,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncCharAt(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
unsigned len = s.length();
JSValue a0 = exec->argument(0);
if (a0.isUInt32()) {
@@ -719,7 +719,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncCharCodeAt(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
unsigned len = s.length();
JSValue a0 = exec->argument(0);
if (a0.isUInt32()) {
@@ -753,11 +753,11 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncIndexOf(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
- UString u2 = a0.toString(exec)->value(exec);
+ String u2 = a0.toString(exec)->value(exec);
size_t result;
if (a1.isUndefined())
@@ -788,13 +788,13 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLastIndexOf(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
int len = s.length();
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
- UString u2 = a0.toString(exec)->value(exec);
+ String u2 = a0.toString(exec)->value(exec);
double dpos = a1.toIntegerPreserveNaN(exec);
if (dpos < 0)
dpos = 0;
@@ -813,7 +813,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncMatch(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
JSString* string = thisValue.toString(exec);
- UString s = string->value(exec);
+ String s = string->value(exec);
JSGlobalData* globalData = &exec->globalData();
JSValue a0 = exec->argument(0);
@@ -836,7 +836,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncMatch(ExecState* exec)
* replaced with the result of the expression new RegExp(regexp).
* Per ECMA 15.10.4.1, if a0 is undefined substitute the empty string.
*/
- regExp = RegExp::create(exec->globalData(), a0.isUndefined() ? UString("") : a0.toString(exec)->value(exec), NoFlags);
+ regExp = RegExp::create(exec->globalData(), a0.isUndefined() ? String("") : a0.toString(exec)->value(exec), NoFlags);
if (!regExp->isValid())
return throwVMError(exec, createSyntaxError(exec, regExp->errorMessage()));
}
@@ -872,7 +872,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSearch(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
JSString* string = thisValue.toString(exec);
- UString s = string->value(exec);
+ String s = string->value(exec);
JSGlobalData* globalData = &exec->globalData();
JSValue a0 = exec->argument(0);
@@ -887,7 +887,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSearch(ExecState* exec)
* replaced with the result of the expression new RegExp(regexp).
* Per ECMA 15.10.4.1, if a0 is undefined substitute the empty string.
*/
- reg = RegExp::create(exec->globalData(), a0.isUndefined() ? UString("") : a0.toString(exec)->value(exec), NoFlags);
+ reg = RegExp::create(exec->globalData(), a0.isUndefined() ? String("") : a0.toString(exec)->value(exec), NoFlags);
if (!reg->isValid())
return throwVMError(exec, createSyntaxError(exec, reg->errorMessage()));
}
@@ -901,7 +901,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSlice(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
int len = s.length();
JSValue a0 = exec->argument(0);
@@ -925,7 +925,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSlice(ExecState* exec)
// Return true in case of early return (resultLength got to limitLength).
template<typename CharacterType>
-static ALWAYS_INLINE bool splitStringByOneCharacterImpl(ExecState* exec, JSArray* result, const UString& input, StringImpl* string, UChar separatorCharacter, size_t& position, unsigned& resultLength, unsigned limitLength)
+static ALWAYS_INLINE bool splitStringByOneCharacterImpl(ExecState* exec, JSArray* result, const String& input, StringImpl* string, UChar separatorCharacter, size_t& position, unsigned& resultLength, unsigned limitLength)
{
// 12. Let q = p.
size_t matchPosition;
@@ -939,7 +939,7 @@ static ALWAYS_INLINE bool splitStringByOneCharacterImpl(ExecState* exec, JSArray
// through q (exclusive).
// 2. Call the [[DefineOwnProperty]] internal method of A with arguments ToString(lengthA),
// Property Descriptor {[[Value]]: T, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
- result->putDirectIndex(exec, resultLength, jsSubstring(exec, input, position, matchPosition - position), false);
+ result->putDirectIndex(exec, resultLength, jsSubstring(exec, input, position, matchPosition - position));
// 3. Increment lengthA by 1.
// 4. If lengthA == lim, return A.
if (++resultLength == limitLength)
@@ -962,7 +962,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
// 2. Let S be the result of calling ToString, giving it the this value as its argument.
// 6. Let s be the number of characters in S.
- UString input = thisValue.toString(exec)->value(exec);
+ String input = thisValue.toString(exec)->value(exec);
// 3. Let A be a new array created as if by the expression new Array()
// where Array is the standard built-in constructor with that name.
@@ -993,7 +993,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
if (separatorValue.isUndefined()) {
// a. Call the [[DefineOwnProperty]] internal method of A with arguments "0",
// Property Descriptor {[[Value]]: S, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
- result->putDirectIndex(exec, 0, jsStringWithReuse(exec, thisValue, input), false);
+ result->putDirectIndex(exec, 0, jsStringWithReuse(exec, thisValue, input));
// b. Return A.
return JSValue::encode(result);
}
@@ -1006,7 +1006,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
// Property Descriptor {[[Value]]: S, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
// d. Return A.
if (!reg->match(*globalData, input, 0))
- result->putDirectIndex(exec, 0, jsStringWithReuse(exec, thisValue, input), false);
+ result->putDirectIndex(exec, 0, jsStringWithReuse(exec, thisValue, input));
return JSValue::encode(result);
}
@@ -1037,7 +1037,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
// through q (exclusive).
// 2. Call the [[DefineOwnProperty]] internal method of A with arguments ToString(lengthA),
// Property Descriptor {[[Value]]: T, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
- result->putDirectIndex(exec, resultLength, jsSubstring(exec, input, position, matchPosition - position), false);
+ result->putDirectIndex(exec, resultLength, jsSubstring(exec, input, position, matchPosition - position));
// 3. Increment lengthA by 1.
// 4. If lengthA == lim, return A.
if (++resultLength == limit)
@@ -1056,7 +1056,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
// ToString(lengthA), Property Descriptor {[[Value]]: cap[i], [[Writable]]:
// true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
int sub = ovector[i * 2];
- result->putDirectIndex(exec, resultLength, sub < 0 ? jsUndefined() : jsSubstring(exec, input, sub, ovector[i * 2 + 1] - sub), false);
+ result->putDirectIndex(exec, resultLength, sub < 0 ? jsUndefined() : jsSubstring(exec, input, sub, ovector[i * 2 + 1] - sub));
// c Increment lengthA by 1.
// d If lengthA == lim, return A.
if (++resultLength == limit)
@@ -1064,7 +1064,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
}
}
} else {
- UString separator = separatorValue.toString(exec)->value(exec);
+ String separator = separatorValue.toString(exec)->value(exec);
// 9. If lim == 0, return A.
if (!limit)
@@ -1075,7 +1075,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
if (separatorValue.isUndefined()) {
// a. Call the [[DefineOwnProperty]] internal method of A with arguments "0",
// Property Descriptor {[[Value]]: S, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
- result->putDirectIndex(exec, 0, jsStringWithReuse(exec, thisValue, input), false);
+ result->putDirectIndex(exec, 0, jsStringWithReuse(exec, thisValue, input));
// b. Return A.
return JSValue::encode(result);
}
@@ -1088,7 +1088,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
// Property Descriptor {[[Value]]: S, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
// d. Return A.
if (!separator.isEmpty())
- result->putDirectIndex(exec, 0, jsStringWithReuse(exec, thisValue, input), false);
+ result->putDirectIndex(exec, 0, jsStringWithReuse(exec, thisValue, input));
return JSValue::encode(result);
}
@@ -1099,7 +1099,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
ASSERT(limit);
do {
- result->putDirectIndex(exec, position, jsSingleCharacterSubstring(exec, input, position), false);
+ result->putDirectIndex(exec, position, jsSingleCharacterSubstring(exec, input, position));
} while (++position < limit);
return JSValue::encode(result);
@@ -1139,7 +1139,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
// through q (exclusive).
// 2. Call the [[DefineOwnProperty]] internal method of A with arguments ToString(lengthA),
// Property Descriptor {[[Value]]: T, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
- result->putDirectIndex(exec, resultLength, jsSubstring(exec, input, position, matchPosition - position), false);
+ result->putDirectIndex(exec, resultLength, jsSubstring(exec, input, position, matchPosition - position));
// 3. Increment lengthA by 1.
// 4. If lengthA == lim, return A.
if (++resultLength == limit)
@@ -1156,7 +1156,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
// through s (exclusive).
// 15. Call the [[DefineOwnProperty]] internal method of A with arguments ToString(lengthA), Property Descriptor
// {[[Value]]: T, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
- result->putDirectIndex(exec, resultLength++, jsSubstring(exec, input, position, input.length() - position), false);
+ result->putDirectIndex(exec, resultLength++, jsSubstring(exec, input, position, input.length() - position));
// 16. Return A.
return JSValue::encode(result);
@@ -1167,7 +1167,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSubstr(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
unsigned len;
JSString* jsString = 0;
- UString uString;
+ String uString;
if (thisValue.isString()) {
jsString = jsCast<JSString*>(thisValue.asCell());
len = jsString->length();
@@ -1247,7 +1247,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncToLowerCase(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
JSString* sVal = thisValue.toString(exec);
- const UString& s = sVal->value(exec);
+ const String& s = sVal->value(exec);
int sSize = s.length();
if (!sSize)
@@ -1257,7 +1257,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncToLowerCase(ExecState* exec)
RefPtr<StringImpl> lower = ourImpl->lower();
if (ourImpl == lower)
return JSValue::encode(sVal);
- return JSValue::encode(jsString(exec, UString(lower.release())));
+ return JSValue::encode(jsString(exec, String(lower.release())));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncToUpperCase(ExecState* exec)
@@ -1266,7 +1266,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncToUpperCase(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
JSString* sVal = thisValue.toString(exec);
- const UString& s = sVal->value(exec);
+ const String& s = sVal->value(exec);
int sSize = s.length();
if (!sSize)
@@ -1276,7 +1276,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncToUpperCase(ExecState* exec)
RefPtr<StringImpl> upper = sImpl->upper();
if (sImpl == upper)
return JSValue::encode(sVal);
- return JSValue::encode(jsString(exec, UString(upper.release())));
+ return JSValue::encode(jsString(exec, String(upper.release())));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncLocaleCompare(ExecState* exec)
@@ -1287,7 +1287,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLocaleCompare(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
return JSValue::encode(jsNumber(localeCompare(s, a0.toString(exec)->value(exec))));
@@ -1298,7 +1298,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncBig(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<big>", s, "</big>"));
}
@@ -1307,7 +1307,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSmall(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<small>", s, "</small>"));
}
@@ -1316,7 +1316,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncBlink(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<blink>", s, "</blink>"));
}
@@ -1325,7 +1325,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncBold(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<b>", s, "</b>"));
}
@@ -1334,7 +1334,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncFixed(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<tt>", s, "</tt>"));
}
@@ -1343,7 +1343,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncItalics(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<i>", s, "</i>"));
}
@@ -1352,7 +1352,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncStrike(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<strike>", s, "</strike>"));
}
@@ -1361,7 +1361,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSub(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<sub>", s, "</sub>"));
}
@@ -1370,7 +1370,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSup(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<sup>", s, "</sup>"));
}
@@ -1379,7 +1379,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncFontcolor(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
return JSValue::encode(jsMakeNontrivialString(exec, "<font color=\"", a0.toString(exec)->value(exec), "\">", s, "</font>"));
}
@@ -1389,7 +1389,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncFontsize(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
uint32_t smallInteger;
@@ -1434,7 +1434,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncAnchor(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
return JSValue::encode(jsMakeNontrivialString(exec, "<a name=\"", a0.toString(exec)->value(exec), "\">", s, "</a>"));
}
@@ -1444,9 +1444,9 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLink(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
- UString linkText = a0.toString(exec)->value(exec);
+ String linkText = a0.toString(exec)->value(exec);
unsigned linkTextSize = linkText.length();
unsigned stringSize = s.length();
@@ -1489,7 +1489,7 @@ static inline JSValue trimString(ExecState* exec, JSValue thisValue, int trimKin
{
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwTypeError(exec);
- UString str = thisValue.toString(exec)->value(exec);
+ String str = thisValue.toString(exec)->value(exec);
unsigned left = 0;
if (trimKind & TrimLeft) {
while (left < str.length() && isTrimWhitespace(str[left]))