summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
commit284837daa07b29d6a63a748544a90b1f5842ac5c (patch)
treeecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
parent2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff)
downloadqtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index e8017b904..4588ec2d9 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -34,7 +34,6 @@
#include "LiteralParser.h"
#include "Nodes.h"
#include "Parser.h"
-#include "UStringBuilder.h"
#include <wtf/dtoa.h>
#include <stdio.h>
#include <stdlib.h>
@@ -42,6 +41,7 @@
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
#include <wtf/StringExtras.h>
+#include <wtf/text/StringBuilder.h>
#include <wtf/unicode/UTF8.h>
using namespace WTF;
@@ -53,7 +53,7 @@ static JSValue encode(ExecState* exec, const char* doNotEscape)
{
CString cstr = exec->argument(0).toString(exec)->value(exec).utf8(true);
if (!cstr.data())
- return throwError(exec, createURIError(exec, "String contained an illegal UTF-16 sequence."));
+ return throwError(exec, createURIError(exec, ASCIILiteral("String contained an illegal UTF-16 sequence.")));
JSStringBuilder builder;
const char* p = cstr.data();
@@ -114,7 +114,7 @@ static JSValue decode(ExecState* exec, const CharType* characters, int length, c
}
if (charLen == 0) {
if (strict)
- return throwError(exec, createURIError(exec, "URI error"));
+ return throwError(exec, createURIError(exec, ASCIILiteral("URI error")));
// The only case where we don't use "strict" mode is the "unescape" function.
// For that, it's good to support the wonky "%u" syntax for compatibility with WinIE.
if (k <= length - 6 && p[1] == 'u'
@@ -142,7 +142,7 @@ static JSValue decode(ExecState* exec, const CharType* characters, int length, c
static JSValue decode(ExecState* exec, const char* doNotUnescape, bool strict)
{
JSStringBuilder builder;
- UString str = exec->argument(0).toString(exec)->value(exec);
+ String str = exec->argument(0).toString(exec)->value(exec);
if (str.is8Bit())
return decode(exec, str.characters8(), str.length(), doNotUnescape, strict);
@@ -232,7 +232,7 @@ double parseIntOverflow(const UChar* s, int length, int radix)
// ES5.1 15.1.2.2
template <typename CharType>
ALWAYS_INLINE
-static double parseInt(const UString& s, const CharType* data, int radix)
+static double parseInt(const String& s, const CharType* data, int radix)
{
// 1. Let inputString be ToString(string).
// 2. Let S be a newly created substring of inputString consisting of the first character that is not a
@@ -313,7 +313,7 @@ static double parseInt(const UString& s, const CharType* data, int radix)
return sign * number;
}
-static double parseInt(const UString& s, int radix)
+static double parseInt(const String& s, int radix)
{
if (s.is8Bit())
return parseInt(s, s.characters8(), radix);
@@ -432,7 +432,7 @@ static double toDouble(const CharType* characters, unsigned size)
}
// See ecma-262 9.3.1
-double jsToNumber(const UString& s)
+double jsToNumber(const String& s)
{
unsigned size = s.length();
@@ -450,7 +450,7 @@ double jsToNumber(const UString& s)
return toDouble(s.characters16(), size);
}
-static double parseFloat(const UString& s)
+static double parseFloat(const String& s)
{
unsigned size = s.length();
@@ -499,13 +499,13 @@ EncodedJSValue JSC_HOST_CALL globalFuncEval(ExecState* exec)
JSObject* thisObject = exec->hostThisValue().toThisObject(exec);
JSObject* unwrappedObject = thisObject->unwrappedObject();
if (!unwrappedObject->isGlobalObject() || jsCast<JSGlobalObject*>(unwrappedObject)->evalFunction() != exec->callee())
- return throwVMError(exec, createEvalError(exec, "The \"this\" value passed to eval must be the global object from which eval originated"));
+ return throwVMError(exec, createEvalError(exec, ASCIILiteral("The \"this\" value passed to eval must be the global object from which eval originated")));
JSValue x = exec->argument(0);
if (!x.isString())
return JSValue::encode(x);
- UString s = x.toString(exec)->value(exec);
+ String s = x.toString(exec)->value(exec);
if (s.is8Bit()) {
LiteralParser<LChar> preparser(exec, s.characters8(), s.length(), NonStrictJSON);
@@ -518,11 +518,11 @@ EncodedJSValue JSC_HOST_CALL globalFuncEval(ExecState* exec)
}
EvalExecutable* eval = EvalExecutable::create(exec, makeSource(s), false);
- JSObject* error = eval->compile(exec, jsCast<JSGlobalObject*>(unwrappedObject)->globalScopeChain());
+ JSObject* error = eval->compile(exec, jsCast<JSGlobalObject*>(unwrappedObject));
if (error)
return throwVMError(exec, error);
- return JSValue::encode(exec->interpreter()->execute(eval, exec, thisObject, jsCast<JSGlobalObject*>(unwrappedObject)->globalScopeChain()));
+ return JSValue::encode(exec->interpreter()->execute(eval, exec, thisObject, jsCast<JSGlobalObject*>(unwrappedObject)));
}
EncodedJSValue JSC_HOST_CALL globalFuncParseInt(ExecState* exec)
@@ -548,7 +548,7 @@ EncodedJSValue JSC_HOST_CALL globalFuncParseInt(ExecState* exec)
}
// If ToString throws, we shouldn't call ToInt32.
- UString s = value.toString(exec)->value(exec);
+ String s = value.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -615,7 +615,7 @@ EncodedJSValue JSC_HOST_CALL globalFuncEscape(ExecState* exec)
"*+-./@_";
JSStringBuilder builder;
- UString str = exec->argument(0).toString(exec)->value(exec);
+ String str = exec->argument(0).toString(exec)->value(exec);
if (str.is8Bit()) {
const LChar* c = str.characters8();
for (unsigned k = 0; k < str.length(); k++, c++) {
@@ -653,8 +653,8 @@ EncodedJSValue JSC_HOST_CALL globalFuncEscape(ExecState* exec)
EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState* exec)
{
- UStringBuilder builder;
- UString str = exec->argument(0).toString(exec)->value(exec);
+ StringBuilder builder;
+ String str = exec->argument(0).toString(exec)->value(exec);
int k = 0;
int len = str.length();
@@ -699,7 +699,7 @@ EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState* exec)
}
}
- return JSValue::encode(jsString(exec, builder.toUString()));
+ return JSValue::encode(jsString(exec, builder.toString()));
}
EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeError(ExecState* exec)