6#include <QtCore/qnumeric.h>
7#include <QtCore/qmath.h>
8#include <QtCore/QDateTime>
9#include <QtCore/QStringList>
10#include <QtCore/QDebug>
12#include <private/qv4mm_p.h>
13#include <private/qv4codegen_p.h>
20# include "qplatformdefs.h"
28void Heap::ErrorObject::init()
33 Scope scope(internalClass->engine);
45void Heap::ErrorObject::init(
const Value &
message, ErrorType
t)
50 Scope scope(internalClass->engine);
56 e->d()->stackTrace =
new StackTrace(scope.engine->stackTrace());
57 if (!
e->d()->stackTrace->isEmpty()) {
72 Scope scope(internalClass->engine);
78 e->d()->stackTrace =
new StackTrace(scope.engine->stackTrace());
83 e->d()->stackTrace->prepend(
frame);
96 case Heap::ErrorObject::Error:
98 case Heap::ErrorObject::EvalError:
100 case Heap::ErrorObject::RangeError:
102 case Heap::ErrorObject::ReferenceError:
103 return "ReferenceError";
104 case Heap::ErrorObject::SyntaxError:
105 return "SyntaxError";
106 case Heap::ErrorObject::TypeError:
108 case Heap::ErrorObject::URIError:
120 if (!This->d()->stack) {
122 for (
int i = 0;
i < This->d()->stackTrace->size(); ++
i) {
139 Heap::ErrorObject::init(msg, SyntaxError);
144 Heap::ErrorObject::init(msg,
fileName, lineNumber, columnNumber, SyntaxError);
149 Heap::ErrorObject::init(
message, EvalError);
154 Heap::ErrorObject::init(
message, RangeError);
159 Heap::ErrorObject::init(
message, ReferenceError);
164 Heap::ErrorObject::init(msg,
fileName, lineNumber, columnNumber, ReferenceError);
169 Heap::ErrorObject::init(
message, TypeError);
174 Heap::ErrorObject::init(
message, URIError);
192 Heap::FunctionObject::init(scope,
name);
198 return ErrorObject::create<ErrorObject>(
f->engine(),
v, newTarget)->asReturnedValue();
203 return f->callAsConstructor(argv, argc);
214 return ErrorObject::create<EvalErrorObject>(
f->engine(),
v, newTarget)->asReturnedValue();
225 return ErrorObject::create<RangeErrorObject>(
f->engine(),
v, newTarget)->asReturnedValue();
230 Heap::FunctionObject::init(scope,
QStringLiteral(
"ReferenceError"));
236 return ErrorObject::create<ReferenceErrorObject>(
f->engine(),
v, newTarget)->asReturnedValue();
247 return ErrorObject::create<SyntaxErrorObject>(
f->engine(),
v, newTarget)->asReturnedValue();
258 return ErrorObject::create<TypeErrorObject>(
f->engine(),
v, newTarget)->asReturnedValue();
269 return ErrorObject::create<URIErrorObject>(
f->engine(),
v, newTarget)->asReturnedValue();
279 obj->setProperty(Index_Constructor, ctor->d());
280 obj->setProperty(Index_Message,
engine->id_empty()->d());
282 obj->defineDefaultProperty(
engine->id_toString(), method_toString, 0);
295 if (
name->isUndefined())
298 qname =
name->toQString();
304 qmessage =
message->toQString();
309 }
else if (qmessage.
isEmpty()) {
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
object setProperty("down", true)
\qmltype Particle \inqmlmodule QtQuick.Particles
QVector< StackFrame > StackTrace
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLuint GLsizei const GLchar * message
GLenum GLenum GLsizei void GLsizei void * column
QLatin1StringView QLatin1String
#define QStringLiteral(str)
#define DEFINE_OBJECT_VTABLE(classname)
\inmodule QtCore \reentrant
static ReturnedValue method_get_stack(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static const char * className(Heap::ErrorObject::ErrorType t)
void init(ExecutionEngine *engine, Object *ctor)
static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
Heap::String * newString(const QString &s=QString())
ReturnedValue throwTypeError()
ReturnedValue asReturnedValue() const
void init(QV4::ExecutionContext *scope)
void init(QV4::ExecutionContext *scope)
void init(const Value &message)
void init(QV4::ExecutionContext *scope)
void init(const Value &message)
void init(QV4::ExecutionContext *scope)
void init(const Value &message)
void init(QV4::ExecutionContext *scope)
void init(const Value &message)
void init(QV4::ExecutionContext *scope)
void init(const Value &message)
void init(QV4::ExecutionContext *scope)
void init(const Value &message)
QString className() const
bool set(StringOrSymbol *name, const Value &v, ThrowOnFailure shouldThrow)
void defineReadonlyConfigurableProperty(const QString &name, const Value &value)
void defineReadonlyProperty(const QString &name, const Value &value)
constexpr ReturnedValue asReturnedValue() const
static constexpr VTable::CallAsConstructor virtualCallAsConstructor
static constexpr VTable::Call virtualCall
static constexpr Value fromInt32(int i)
static constexpr Value undefinedValue()