1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include "qv4domerrors_p.h" |
5 | #include "qv4object_p.h" |
6 | |
7 | QT_BEGIN_NAMESPACE |
8 | |
9 | using namespace QV4; |
10 | |
11 | void qt_add_domexceptions(ExecutionEngine *e) |
12 | { |
13 | Scope scope(e); |
14 | ScopedObject domexception(scope, e->newObject()); |
15 | domexception->defineReadonlyProperty(QStringLiteral("INDEX_SIZE_ERR" ), value: Value::fromInt32(DOMEXCEPTION_INDEX_SIZE_ERR)); |
16 | domexception->defineReadonlyProperty(QStringLiteral("DOMSTRING_SIZE_ERR" ), value: Value::fromInt32(DOMEXCEPTION_DOMSTRING_SIZE_ERR)); |
17 | domexception->defineReadonlyProperty(QStringLiteral("HIERARCHY_REQUEST_ERR" ), value: Value::fromInt32(DOMEXCEPTION_HIERARCHY_REQUEST_ERR)); |
18 | domexception->defineReadonlyProperty(QStringLiteral("WRONG_DOCUMENT_ERR" ), value: Value::fromInt32(DOMEXCEPTION_WRONG_DOCUMENT_ERR)); |
19 | domexception->defineReadonlyProperty(QStringLiteral("INVALID_CHARACTER_ERR" ), value: Value::fromInt32(DOMEXCEPTION_INVALID_CHARACTER_ERR)); |
20 | domexception->defineReadonlyProperty(QStringLiteral("NO_DATA_ALLOWED_ERR" ), value: Value::fromInt32(DOMEXCEPTION_NO_DATA_ALLOWED_ERR)); |
21 | domexception->defineReadonlyProperty(QStringLiteral("NO_MODIFICATION_ALLOWED_ERR" ), value: Value::fromInt32(DOMEXCEPTION_NO_MODIFICATION_ALLOWED_ERR)); |
22 | domexception->defineReadonlyProperty(QStringLiteral("NOT_FOUND_ERR" ), value: Value::fromInt32(DOMEXCEPTION_NOT_FOUND_ERR)); |
23 | domexception->defineReadonlyProperty(QStringLiteral("NOT_SUPPORTED_ERR" ), value: Value::fromInt32(DOMEXCEPTION_NOT_SUPPORTED_ERR)); |
24 | domexception->defineReadonlyProperty(QStringLiteral("INUSE_ATTRIBUTE_ERR" ), value: Value::fromInt32(DOMEXCEPTION_INUSE_ATTRIBUTE_ERR)); |
25 | domexception->defineReadonlyProperty(QStringLiteral("INVALID_STATE_ERR" ), value: Value::fromInt32(DOMEXCEPTION_INVALID_STATE_ERR)); |
26 | domexception->defineReadonlyProperty(QStringLiteral("SYNTAX_ERR" ), value: Value::fromInt32(DOMEXCEPTION_SYNTAX_ERR)); |
27 | domexception->defineReadonlyProperty(QStringLiteral("INVALID_MODIFICATION_ERR" ), value: Value::fromInt32(DOMEXCEPTION_INVALID_MODIFICATION_ERR)); |
28 | domexception->defineReadonlyProperty(QStringLiteral("NAMESPACE_ERR" ), value: Value::fromInt32(DOMEXCEPTION_NAMESPACE_ERR)); |
29 | domexception->defineReadonlyProperty(QStringLiteral("INVALID_ACCESS_ERR" ), value: Value::fromInt32(DOMEXCEPTION_INVALID_ACCESS_ERR)); |
30 | domexception->defineReadonlyProperty(QStringLiteral("VALIDATION_ERR" ), value: Value::fromInt32(DOMEXCEPTION_VALIDATION_ERR)); |
31 | domexception->defineReadonlyProperty(QStringLiteral("TYPE_MISMATCH_ERR" ), value: Value::fromInt32(DOMEXCEPTION_TYPE_MISMATCH_ERR)); |
32 | e->globalObject->defineDefaultProperty(QStringLiteral("DOMException" ), value: domexception); |
33 | } |
34 | |
35 | QT_END_NAMESPACE |
36 | |