summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/ExceptionHelpers.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/ExceptionHelpers.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/ExceptionHelpers.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/ExceptionHelpers.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
index ce63ae9af..38c525268 100644
--- a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
+++ b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
@@ -37,7 +37,6 @@
#include "JSNotAnObject.h"
#include "Interpreter.h"
#include "Nodes.h"
-#include "UStringConcatenate.h"
namespace JSC {
@@ -48,7 +47,7 @@ const ClassInfo InterruptedExecutionError::s_info = { "InterruptedExecutionError
JSValue InterruptedExecutionError::defaultValue(const JSObject*, ExecState* exec, PreferredPrimitiveType hint)
{
if (hint == PreferString)
- return jsNontrivialString(exec, "JavaScript execution exceeded timeout.");
+ return jsNontrivialString(exec, String(ASCIILiteral("JavaScript execution exceeded timeout.")));
return JSValue(std::numeric_limits<double>::quiet_NaN());
}
@@ -75,7 +74,7 @@ const ClassInfo TerminatedExecutionError::s_info = { "TerminatedExecutionError",
JSValue TerminatedExecutionError::defaultValue(const JSObject*, ExecState* exec, PreferredPrimitiveType hint)
{
if (hint == PreferString)
- return jsNontrivialString(exec, "JavaScript execution terminated.");
+ return jsNontrivialString(exec, String(ASCIILiteral("JavaScript execution terminated.")));
return JSValue(std::numeric_limits<double>::quiet_NaN());
}
@@ -97,23 +96,23 @@ bool isTerminatedExecutionException(JSValue value)
JSObject* createStackOverflowError(ExecState* exec)
{
- return createRangeError(exec, "Maximum call stack size exceeded.");
+ return createRangeError(exec, ASCIILiteral("Maximum call stack size exceeded."));
}
JSObject* createStackOverflowError(JSGlobalObject* globalObject)
{
- return createRangeError(globalObject, "Maximum call stack size exceeded.");
+ return createRangeError(globalObject, ASCIILiteral("Maximum call stack size exceeded."));
}
JSObject* createUndefinedVariableError(ExecState* exec, const Identifier& ident)
{
- UString message(makeUString("Can't find variable: ", ident.ustring()));
+ String message(makeString("Can't find variable: ", ident.string()));
return createReferenceError(exec, message);
}
JSObject* createInvalidParamError(ExecState* exec, const char* op, JSValue value)
{
- UString errorMessage = makeUString("'", value.toString(exec)->value(exec), "' is not a valid argument for '", op, "'");
+ String errorMessage = makeString("'", value.toString(exec)->value(exec), "' is not a valid argument for '", op, "'");
JSObject* exception = createTypeError(exec, errorMessage);
ASSERT(exception->isErrorInstance());
static_cast<ErrorInstance*>(exception)->setAppendSourceToMessage();
@@ -122,7 +121,7 @@ JSObject* createInvalidParamError(ExecState* exec, const char* op, JSValue value
JSObject* createNotAConstructorError(ExecState* exec, JSValue value)
{
- UString errorMessage = makeUString("'", value.toString(exec)->value(exec), "' is not a constructor");
+ String errorMessage = makeString("'", value.toString(exec)->value(exec), "' is not a constructor");
JSObject* exception = createTypeError(exec, errorMessage);
ASSERT(exception->isErrorInstance());
static_cast<ErrorInstance*>(exception)->setAppendSourceToMessage();
@@ -131,7 +130,7 @@ JSObject* createNotAConstructorError(ExecState* exec, JSValue value)
JSObject* createNotAFunctionError(ExecState* exec, JSValue value)
{
- UString errorMessage = makeUString("'", value.toString(exec)->value(exec), "' is not a function");
+ String errorMessage = makeString("'", value.toString(exec)->value(exec), "' is not a function");
JSObject* exception = createTypeError(exec, errorMessage);
ASSERT(exception->isErrorInstance());
static_cast<ErrorInstance*>(exception)->setAppendSourceToMessage();
@@ -140,21 +139,21 @@ JSObject* createNotAFunctionError(ExecState* exec, JSValue value)
JSObject* createNotAnObjectError(ExecState* exec, JSValue value)
{
- UString errorMessage = makeUString("'", value.toString(exec)->value(exec), "' is not an object");
+ String errorMessage = makeString("'", value.toString(exec)->value(exec), "' is not an object");
JSObject* exception = createTypeError(exec, errorMessage);
ASSERT(exception->isErrorInstance());
static_cast<ErrorInstance*>(exception)->setAppendSourceToMessage();
return exception;
}
-JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const UString& propertyName)
+JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const String& propertyName)
{
- return createReferenceError(exec, makeUString("Strict mode forbids implicit creation of global property '", propertyName, "'"));
+ return createReferenceError(exec, makeString("Strict mode forbids implicit creation of global property '", propertyName, "'"));
}
JSObject* createOutOfMemoryError(JSGlobalObject* globalObject)
{
- return createError(globalObject, "Out of memory");
+ return createError(globalObject, ASCIILiteral("Out of memory"));
}
JSObject* throwOutOfMemoryError(ExecState* exec)