| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4errorobject_p.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||
| 2 | ** | - | ||||||
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - | ||||||
| 4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||
| 5 | ** | - | ||||||
| 6 | ** This file is part of the QtQml module of the Qt Toolkit. | - | ||||||
| 7 | ** | - | ||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||
| 9 | ** Commercial License Usage | - | ||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||
| 16 | ** | - | ||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||
| 19 | ** General Public License version 3 as published by the Free Software | - | ||||||
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||
| 21 | ** packaging of this file. Please review the following information to | - | ||||||
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||
| 24 | ** | - | ||||||
| 25 | ** GNU General Public License Usage | - | ||||||
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||
| 31 | ** included in the packaging of this file. Please review the following | - | ||||||
| 32 | ** information to ensure the GNU General Public License requirements will | - | ||||||
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||
| 35 | ** | - | ||||||
| 36 | ** $QT_END_LICENSE$ | - | ||||||
| 37 | ** | - | ||||||
| 38 | ****************************************************************************/ | - | ||||||
| 39 | #ifndef QV4ERROROBJECT_H | - | ||||||
| 40 | #define QV4ERROROBJECT_H | - | ||||||
| 41 | - | |||||||
| 42 | // | - | ||||||
| 43 | // W A R N I N G | - | ||||||
| 44 | // ------------- | - | ||||||
| 45 | // | - | ||||||
| 46 | // This file is not part of the Qt API. It exists purely as an | - | ||||||
| 47 | // implementation detail. This header file may change from version to | - | ||||||
| 48 | // version without notice, or even be removed. | - | ||||||
| 49 | // | - | ||||||
| 50 | // We mean it. | - | ||||||
| 51 | // | - | ||||||
| 52 | - | |||||||
| 53 | #include "qv4object_p.h" | - | ||||||
| 54 | #include "qv4functionobject_p.h" | - | ||||||
| 55 | #include "qv4string_p.h" | - | ||||||
| 56 | - | |||||||
| 57 | QT_BEGIN_NAMESPACE | - | ||||||
| 58 | - | |||||||
| 59 | namespace QV4 { | - | ||||||
| 60 | - | |||||||
| 61 | struct SyntaxErrorObject; | - | ||||||
| 62 | - | |||||||
| 63 | namespace Heap { | - | ||||||
| 64 | - | |||||||
| 65 | - | |||||||
| 66 | #define ErrorObjectMembers(class, Member) \ | - | ||||||
| 67 | Member(class, Pointer, String *, stack) | - | ||||||
| 68 | - | |||||||
| 69 | DECLARE_HEAP_OBJECT(ErrorObject, Object) { | - | ||||||
| 70 | DECLARE_MARKOBJECTS(ErrorObject); never executed: end of blocknever executed: o->stack.heapObject()->mark(stack);
| 0 | ||||||
| 71 | enum ErrorType { | - | ||||||
| 72 | Error, | - | ||||||
| 73 | EvalError, | - | ||||||
| 74 | RangeError, | - | ||||||
| 75 | ReferenceError, | - | ||||||
| 76 | SyntaxError, | - | ||||||
| 77 | TypeError, | - | ||||||
| 78 | URIError | - | ||||||
| 79 | }; | - | ||||||
| 80 | StackTrace *stackTrace; | - | ||||||
| 81 | ErrorType errorType; | - | ||||||
| 82 | - | |||||||
| 83 | void init(); | - | ||||||
| 84 | void init(const Value &message, ErrorType t = Error); | - | ||||||
| 85 | void init(const Value &message, const QString &fileName, int line, int column, ErrorType t = Error); | - | ||||||
| 86 | void destroy() { | - | ||||||
| 87 | delete stackTrace; | - | ||||||
| 88 | Object::destroy(); | - | ||||||
| 89 | } never executed: end of block | 0 | ||||||
| 90 | }; | - | ||||||
| 91 | - | |||||||
| 92 | struct EvalErrorObject : ErrorObject { | - | ||||||
| 93 | void init(const Value &message); | - | ||||||
| 94 | }; | - | ||||||
| 95 | - | |||||||
| 96 | struct RangeErrorObject : ErrorObject { | - | ||||||
| 97 | void init(const Value &message); | - | ||||||
| 98 | }; | - | ||||||
| 99 | - | |||||||
| 100 | struct ReferenceErrorObject : ErrorObject { | - | ||||||
| 101 | void init(const Value &message); | - | ||||||
| 102 | void init(const Value &msg, const QString &fileName, int lineNumber, int columnNumber); | - | ||||||
| 103 | }; | - | ||||||
| 104 | - | |||||||
| 105 | struct SyntaxErrorObject : ErrorObject { | - | ||||||
| 106 | void init(const Value &message); | - | ||||||
| 107 | void init(const Value &msg, const QString &fileName, int lineNumber, int columnNumber); | - | ||||||
| 108 | }; | - | ||||||
| 109 | - | |||||||
| 110 | struct TypeErrorObject : ErrorObject { | - | ||||||
| 111 | void init(const Value &message); | - | ||||||
| 112 | }; | - | ||||||
| 113 | - | |||||||
| 114 | struct URIErrorObject : ErrorObject { | - | ||||||
| 115 | void init(const Value &message); | - | ||||||
| 116 | }; | - | ||||||
| 117 | - | |||||||
| 118 | struct ErrorCtor : Heap::FunctionObject { | - | ||||||
| 119 | void init(QV4::ExecutionContext *scope); | - | ||||||
| 120 | void init(QV4::ExecutionContext *scope, const QString &name); | - | ||||||
| 121 | }; | - | ||||||
| 122 | - | |||||||
| 123 | struct EvalErrorCtor : ErrorCtor { | - | ||||||
| 124 | void init(QV4::ExecutionContext *scope); | - | ||||||
| 125 | }; | - | ||||||
| 126 | - | |||||||
| 127 | struct RangeErrorCtor : ErrorCtor { | - | ||||||
| 128 | void init(QV4::ExecutionContext *scope); | - | ||||||
| 129 | }; | - | ||||||
| 130 | - | |||||||
| 131 | struct ReferenceErrorCtor : ErrorCtor { | - | ||||||
| 132 | void init(QV4::ExecutionContext *scope); | - | ||||||
| 133 | }; | - | ||||||
| 134 | - | |||||||
| 135 | struct SyntaxErrorCtor : ErrorCtor { | - | ||||||
| 136 | void init(QV4::ExecutionContext *scope); | - | ||||||
| 137 | }; | - | ||||||
| 138 | - | |||||||
| 139 | struct TypeErrorCtor : ErrorCtor { | - | ||||||
| 140 | void init(QV4::ExecutionContext *scope); | - | ||||||
| 141 | }; | - | ||||||
| 142 | - | |||||||
| 143 | struct URIErrorCtor : ErrorCtor { | - | ||||||
| 144 | void init(QV4::ExecutionContext *scope); | - | ||||||
| 145 | }; | - | ||||||
| 146 | - | |||||||
| 147 | } | - | ||||||
| 148 | - | |||||||
| 149 | struct ErrorObject: Object { | - | ||||||
| 150 | enum { | - | ||||||
| 151 | IsErrorObject = true | - | ||||||
| 152 | }; | - | ||||||
| 153 | - | |||||||
| 154 | enum { | - | ||||||
| 155 | Index_Stack = 0, // Accessor Property | - | ||||||
| 156 | Index_FileName = 2, | - | ||||||
| 157 | Index_LineNumber = 3, | - | ||||||
| 158 | Index_Message = 4 | - | ||||||
| 159 | }; | - | ||||||
| 160 | - | |||||||
| 161 | V4_OBJECT2(ErrorObject, Object) never executed: end of blocknever executed: end of blockexecuted 10287774 times by 153 tests: return &static_vtbl;Executed by:
executed 4354175 times by 30 tests: return static_cast<QV4::Heap::ErrorObject *>(m());Executed by:
executed 4371825 times by 30 tests: return dptr;Executed by:
| 0-10287774 | ||||||
| 162 | Q_MANAGED_TYPE(ErrorObject) | - | ||||||
| 163 | V4_INTERNALCLASS(ErrorObject) never executed: return e->internalClasses(QV4::EngineBase::Class_ErrorObject); | 0 | ||||||
| 164 | V4_PROTOTYPE(errorPrototype) executed 1357 times by 16 tests: return e->errorPrototype();Executed by:
| 1357 | ||||||
| 165 | V4_NEEDS_DESTROY never executed: end of block | 0 | ||||||
| 166 | - | |||||||
| 167 | template <typename T> | - | ||||||
| 168 | static Heap::Object *create(ExecutionEngine *e, const Value &message); | - | ||||||
| 169 | template <typename T> | - | ||||||
| 170 | static Heap::Object *create(ExecutionEngine *e, const QString &message); | - | ||||||
| 171 | template <typename T> | - | ||||||
| 172 | static Heap::Object *create(ExecutionEngine *e, const QString &message, const QString &filename, int line, int column); | - | ||||||
| 173 | - | |||||||
| 174 | SyntaxErrorObject *asSyntaxError(); | - | ||||||
| 175 | - | |||||||
| 176 | static const char *className(Heap::ErrorObject::ErrorType t); | - | ||||||
| 177 | - | |||||||
| 178 | static ReturnedValue method_get_stack(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 179 | }; | - | ||||||
| 180 | - | |||||||
| 181 | template<> | - | ||||||
| 182 | inline const ErrorObject *Value::as() const { | - | ||||||
| 183 | return isManaged() && m()->internalClass->vtable->isErrorObject ? reinterpret_cast<const ErrorObject *>(this) : nullptr; executed 4293163 times by 31 tests: return isManaged() && m()->internalClass->vtable->isErrorObject ? reinterpret_cast<const ErrorObject *>(this) : nullptr;Executed by:
| 4293163 | ||||||
| 184 | } | - | ||||||
| 185 | - | |||||||
| 186 | struct EvalErrorObject: ErrorObject { | - | ||||||
| 187 | typedef Heap::EvalErrorObject Data; | - | ||||||
| 188 | V4_PROTOTYPE(evalErrorPrototype) never executed: return e->evalErrorPrototype(); | 0 | ||||||
| 189 | const Data *d() const { return static_cast<const Data *>(ErrorObject::d()); } never executed: return static_cast<const Data *>(ErrorObject::d()); | 0 | ||||||
| 190 | Data *d() { return static_cast<Data *>(ErrorObject::d()); } never executed: return static_cast<Data *>(ErrorObject::d()); | 0 | ||||||
| 191 | }; | - | ||||||
| 192 | - | |||||||
| 193 | struct RangeErrorObject: ErrorObject { | - | ||||||
| 194 | typedef Heap::RangeErrorObject Data; | - | ||||||
| 195 | V4_PROTOTYPE(rangeErrorPrototype) executed 1340 times by 3 tests: return e->rangeErrorPrototype();Executed by:
| 1340 | ||||||
| 196 | const Data *d() const { return static_cast<const Data *>(ErrorObject::d()); } never executed: return static_cast<const Data *>(ErrorObject::d()); | 0 | ||||||
| 197 | Data *d() { return static_cast<Data *>(ErrorObject::d()); } never executed: return static_cast<Data *>(ErrorObject::d()); | 0 | ||||||
| 198 | }; | - | ||||||
| 199 | - | |||||||
| 200 | struct ReferenceErrorObject: ErrorObject { | - | ||||||
| 201 | typedef Heap::ReferenceErrorObject Data; | - | ||||||
| 202 | V4_PROTOTYPE(referenceErrorPrototype) executed 7695 times by 16 tests: return e->referenceErrorPrototype();Executed by:
| 7695 | ||||||
| 203 | const Data *d() const { return static_cast<const Data *>(ErrorObject::d()); } never executed: return static_cast<const Data *>(ErrorObject::d()); | 0 | ||||||
| 204 | Data *d() { return static_cast<Data *>(ErrorObject::d()); } never executed: return static_cast<Data *>(ErrorObject::d()); | 0 | ||||||
| 205 | }; | - | ||||||
| 206 | - | |||||||
| 207 | struct SyntaxErrorObject: ErrorObject { | - | ||||||
| 208 | typedef Heap::SyntaxErrorObject Data; | - | ||||||
| 209 | V4_PROTOTYPE(syntaxErrorPrototype) executed 9872 times by 7 tests: return e->syntaxErrorPrototype();Executed by:
| 9872 | ||||||
| 210 | const Data *d() const { return static_cast<const Data *>(ErrorObject::d()); } never executed: return static_cast<const Data *>(ErrorObject::d()); | 0 | ||||||
| 211 | Data *d() { return static_cast<Data *>(ErrorObject::d()); } never executed: return static_cast<Data *>(ErrorObject::d()); | 0 | ||||||
| 212 | }; | - | ||||||
| 213 | - | |||||||
| 214 | struct TypeErrorObject: ErrorObject { | - | ||||||
| 215 | typedef Heap::TypeErrorObject Data; | - | ||||||
| 216 | V4_PROTOTYPE(typeErrorPrototype) executed 31080 times by 16 tests: return e->typeErrorPrototype();Executed by:
| 31080 | ||||||
| 217 | const Data *d() const { return static_cast<const Data *>(ErrorObject::d()); } never executed: return static_cast<const Data *>(ErrorObject::d()); | 0 | ||||||
| 218 | Data *d() { return static_cast<Data *>(ErrorObject::d()); } never executed: return static_cast<Data *>(ErrorObject::d()); | 0 | ||||||
| 219 | }; | - | ||||||
| 220 | - | |||||||
| 221 | struct URIErrorObject: ErrorObject { | - | ||||||
| 222 | typedef Heap::URIErrorObject Data; | - | ||||||
| 223 | V4_PROTOTYPE(uRIErrorPrototype) executed 4215370 times by 2 tests: return e->uRIErrorPrototype();Executed by:
| 4215370 | ||||||
| 224 | const Data *d() const { return static_cast<const Data *>(ErrorObject::d()); } never executed: return static_cast<const Data *>(ErrorObject::d()); | 0 | ||||||
| 225 | Data *d() { return static_cast<Data *>(ErrorObject::d()); } never executed: return static_cast<Data *>(ErrorObject::d()); | 0 | ||||||
| 226 | }; | - | ||||||
| 227 | - | |||||||
| 228 | struct ErrorCtor: FunctionObject | - | ||||||
| 229 | { | - | ||||||
| 230 | V4_OBJECT2(ErrorCtor, FunctionObject) never executed: end of blocknever executed: end of blockexecuted 296447 times by 153 tests: return &static_vtbl;Executed by:
executed 197969 times by 153 tests: return static_cast<QV4::Heap::ErrorCtor *>(m());Executed by:
executed 99095 times by 153 tests: return dptr;Executed by:
| 0-296447 | ||||||
| 231 | - | |||||||
| 232 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
| 233 | static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 234 | }; | - | ||||||
| 235 | - | |||||||
| 236 | struct EvalErrorCtor: ErrorCtor | - | ||||||
| 237 | { | - | ||||||
| 238 | V4_OBJECT2(EvalErrorCtor, ErrorCtor) never executed: end of blocknever executed: end of blockexecuted 296737 times by 153 tests: return &static_vtbl;Executed by:
executed 197966 times by 153 tests: return static_cast<QV4::Heap::EvalErrorCtor *>(m());Executed by:
executed 98948 times by 153 tests: return dptr;Executed by:
| 0-296737 | ||||||
| 239 | - | |||||||
| 240 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
| 241 | }; | - | ||||||
| 242 | - | |||||||
| 243 | struct RangeErrorCtor: ErrorCtor | - | ||||||
| 244 | { | - | ||||||
| 245 | V4_OBJECT2(RangeErrorCtor, ErrorCtor) never executed: end of blocknever executed: end of blockexecuted 296996 times by 153 tests: return &static_vtbl;Executed by:
executed 198035 times by 153 tests: return static_cast<QV4::Heap::RangeErrorCtor *>(m());Executed by:
executed 99064 times by 153 tests: return dptr;Executed by:
| 0-296996 | ||||||
| 246 | - | |||||||
| 247 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
| 248 | }; | - | ||||||
| 249 | - | |||||||
| 250 | struct ReferenceErrorCtor: ErrorCtor | - | ||||||
| 251 | { | - | ||||||
| 252 | V4_OBJECT2(ReferenceErrorCtor, ErrorCtor) never executed: end of blocknever executed: end of blockexecuted 296960 times by 153 tests: return &static_vtbl;Executed by:
executed 197941 times by 153 tests: return static_cast<QV4::Heap::ReferenceErrorCtor *>(m());Executed by:
executed 99056 times by 153 tests: return dptr;Executed by:
| 0-296960 | ||||||
| 253 | - | |||||||
| 254 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
| 255 | }; | - | ||||||
| 256 | - | |||||||
| 257 | struct SyntaxErrorCtor: ErrorCtor | - | ||||||
| 258 | { | - | ||||||
| 259 | V4_OBJECT2(SyntaxErrorCtor, ErrorCtor) never executed: end of blocknever executed: end of blockexecuted 296666 times by 153 tests: return &static_vtbl;Executed by:
executed 197716 times by 153 tests: return static_cast<QV4::Heap::SyntaxErrorCtor *>(m());Executed by:
executed 99034 times by 153 tests: return dptr;Executed by:
| 0-296666 | ||||||
| 260 | - | |||||||
| 261 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
| 262 | }; | - | ||||||
| 263 | - | |||||||
| 264 | struct TypeErrorCtor: ErrorCtor | - | ||||||
| 265 | { | - | ||||||
| 266 | V4_OBJECT2(TypeErrorCtor, ErrorCtor) never executed: end of blocknever executed: end of blockexecuted 297047 times by 153 tests: return &static_vtbl;Executed by:
executed 197985 times by 153 tests: return static_cast<QV4::Heap::TypeErrorCtor *>(m());Executed by:
executed 99052 times by 153 tests: return dptr;Executed by:
| 0-297047 | ||||||
| 267 | - | |||||||
| 268 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
| 269 | }; | - | ||||||
| 270 | - | |||||||
| 271 | struct URIErrorCtor: ErrorCtor | - | ||||||
| 272 | { | - | ||||||
| 273 | V4_OBJECT2(URIErrorCtor, ErrorCtor) never executed: end of blocknever executed: end of blockexecuted 296969 times by 153 tests: return &static_vtbl;Executed by:
executed 197965 times by 153 tests: return static_cast<QV4::Heap::URIErrorCtor *>(m());Executed by:
executed 99064 times by 153 tests: return dptr;Executed by:
| 0-296969 | ||||||
| 274 | - | |||||||
| 275 | static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); | - | ||||||
| 276 | }; | - | ||||||
| 277 | - | |||||||
| 278 | - | |||||||
| 279 | struct ErrorPrototype : ErrorObject | - | ||||||
| 280 | { | - | ||||||
| 281 | enum { | - | ||||||
| 282 | Index_Constructor = 0, | - | ||||||
| 283 | Index_Message = 1, | - | ||||||
| 284 | Index_Name = 2 | - | ||||||
| 285 | }; | - | ||||||
| 286 | void init(ExecutionEngine *engine, Object *ctor) { init(engine, ctor, this, Heap::ErrorObject::Error); } executed 98725 times by 153 tests: end of blockExecuted by:
| 98725 | ||||||
| 287 | - | |||||||
| 288 | static void init(ExecutionEngine *engine, Object *ctor, Object *obj, Heap::ErrorObject::ErrorType t); | - | ||||||
| 289 | static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); | - | ||||||
| 290 | }; | - | ||||||
| 291 | - | |||||||
| 292 | struct EvalErrorPrototype : ErrorObject | - | ||||||
| 293 | { | - | ||||||
| 294 | void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::EvalError); } executed 99066 times by 153 tests: end of blockExecuted by:
| 99066 | ||||||
| 295 | }; | - | ||||||
| 296 | - | |||||||
| 297 | struct RangeErrorPrototype : ErrorObject | - | ||||||
| 298 | { | - | ||||||
| 299 | void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::RangeError); } executed 99151 times by 153 tests: end of blockExecuted by:
| 99151 | ||||||
| 300 | }; | - | ||||||
| 301 | - | |||||||
| 302 | struct ReferenceErrorPrototype : ErrorObject | - | ||||||
| 303 | { | - | ||||||
| 304 | void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::ReferenceError); } executed 99148 times by 153 tests: end of blockExecuted by:
| 99148 | ||||||
| 305 | }; | - | ||||||
| 306 | - | |||||||
| 307 | struct SyntaxErrorPrototype : ErrorObject | - | ||||||
| 308 | { | - | ||||||
| 309 | void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::SyntaxError); } executed 99139 times by 153 tests: end of blockExecuted by:
| 99139 | ||||||
| 310 | }; | - | ||||||
| 311 | - | |||||||
| 312 | struct TypeErrorPrototype : ErrorObject | - | ||||||
| 313 | { | - | ||||||
| 314 | void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::TypeError); } executed 99036 times by 153 tests: end of blockExecuted by:
| 99036 | ||||||
| 315 | }; | - | ||||||
| 316 | - | |||||||
| 317 | struct URIErrorPrototype : ErrorObject | - | ||||||
| 318 | { | - | ||||||
| 319 | void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::URIError); } executed 99140 times by 153 tests: end of blockExecuted by:
| 99140 | ||||||
| 320 | }; | - | ||||||
| 321 | - | |||||||
| 322 | - | |||||||
| 323 | inline SyntaxErrorObject *ErrorObject::asSyntaxError() | - | ||||||
| 324 | { | - | ||||||
| 325 | return d()->errorType == QV4::Heap::ErrorObject::SyntaxError ? static_cast<SyntaxErrorObject *>(this) : nullptr; never executed: return d()->errorType == QV4::Heap::ErrorObject::SyntaxError ? static_cast<SyntaxErrorObject *>(this) : nullptr; | 0 | ||||||
| 326 | } | - | ||||||
| 327 | - | |||||||
| 328 | - | |||||||
| 329 | template <typename T> | - | ||||||
| 330 | Heap::Object *ErrorObject::create(ExecutionEngine *e, const Value &message) { | - | ||||||
| 331 | EngineBase::InternalClassType klass = message.isUndefined() ? EngineBase::Class_ErrorObject : EngineBase::Class_ErrorObjectWithMessage;
| 373-4209181 | ||||||
| 332 | Scope scope(e); | - | ||||||
| 333 | Scoped<InternalClass> ic(scope, e->internalClasses(klass)->changePrototype(T::defaultPrototype(e)->d())); | - | ||||||
| 334 | return e->memoryManager->allocObject<T>(ic->d(), message); executed 4247335 times by 16 tests: return e->memoryManager->allocObject<T>(ic->d(), message);Executed by:
| 4247335 | ||||||
| 335 | } | - | ||||||
| 336 | template <typename T> | - | ||||||
| 337 | Heap::Object *ErrorObject::create(ExecutionEngine *e, const QString &message) { | - | ||||||
| 338 | Scope scope(e); | - | ||||||
| 339 | ScopedValue v(scope, message.isEmpty() ? Encode::undefined() : e->newString(message)->asReturnedValue()); | - | ||||||
| 340 | EngineBase::InternalClassType klass = v->isUndefined() ? EngineBase::Class_ErrorObject : EngineBase::Class_ErrorObjectWithMessage;
| 0-43981 | ||||||
| 341 | Scoped<InternalClass> ic(scope, e->internalClasses(klass)->changePrototype(T::defaultPrototype(e)->d())); | - | ||||||
| 342 | return e->memoryManager->allocObject<T>(ic->d(), v); executed 44022 times by 24 tests: return e->memoryManager->allocObject<T>(ic->d(), v);Executed by:
| 44022 | ||||||
| 343 | } | - | ||||||
| 344 | template <typename T> | - | ||||||
| 345 | Heap::Object *ErrorObject::create(ExecutionEngine *e, const QString &message, const QString &filename, int line, int column) { | - | ||||||
| 346 | Scope scope(e); | - | ||||||
| 347 | ScopedValue v(scope, message.isEmpty() ? Encode::undefined() : e->newString(message)->asReturnedValue()); | - | ||||||
| 348 | EngineBase::InternalClassType klass = v->isUndefined() ? EngineBase::Class_ErrorObject : EngineBase::Class_ErrorObjectWithMessage;
| 0-6037 | ||||||
| 349 | Scoped<InternalClass> ic(scope, e->internalClasses(klass)->changePrototype(T::defaultPrototype(e)->d())); | - | ||||||
| 350 | return e->memoryManager->allocObject<T>(ic->d(), v, filename, line, column); executed 6039 times by 7 tests: return e->memoryManager->allocObject<T>(ic->d(), v, filename, line, column);Executed by:
| 6039 | ||||||
| 351 | } | - | ||||||
| 352 | - | |||||||
| 353 | - | |||||||
| 354 | } | - | ||||||
| 355 | - | |||||||
| 356 | QT_END_NAMESPACE | - | ||||||
| 357 | - | |||||||
| 358 | #endif // QV4ECMAOBJECTS_P_H | - | ||||||
| Source code | Switch to Preprocessed file |