| 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 | |
| 40 | #include "qv4managed_p.h" |
| 41 | #include <private/qv4mm_p.h> |
| 42 | #include "qv4errorobject_p.h" |
| 43 | |
| 44 | using namespace QV4; |
| 45 | |
| 46 | DEFINE_MANAGED_VTABLE(Managed); |
| 47 | |
| 48 | DEFINE_MANAGED_VTABLE(InternalClass); |
| 49 | |
| 50 | |
| 51 | QString Managed::className() const |
| 52 | { |
| 53 | const char *s = nullptr; |
| 54 | switch (Type(vtable()->type)) { |
| 55 | case Type_Invalid: |
| 56 | return QString(); |
| 57 | case Type_String: |
| 58 | s = "String"; |
| 59 | break; |
| 60 | case Type_Symbol: |
| 61 | s = "Symbol"; |
| 62 | break; |
| 63 | case Type_Object: |
| 64 | s = "Object"; |
| 65 | break; |
| 66 | case Type_ArrayObject: |
| 67 | s = "Array"; |
| 68 | break; |
| 69 | case Type_FunctionObject: |
| 70 | s = "Function"; |
| 71 | break; |
| 72 | case Type_GeneratorObject: |
| 73 | s = "Generator"; |
| 74 | break; |
| 75 | case Type_BooleanObject: |
| 76 | s = "Boolean"; |
| 77 | break; |
| 78 | case Type_NumberObject: |
| 79 | s = "Number"; |
| 80 | break; |
| 81 | case Type_StringObject: |
| 82 | s = "String"; |
| 83 | break; |
| 84 | case Type_SymbolObject: |
| 85 | s = "Symbol"; |
| 86 | break; |
| 87 | case Type_DateObject: |
| 88 | s = "Date"; |
| 89 | break; |
| 90 | case Type_RegExpObject: |
| 91 | s = "RegExp"; |
| 92 | break; |
| 93 | case Type_ErrorObject: |
| 94 | s = "Error"; |
| 95 | break; |
| 96 | case Type_ArgumentsObject: |
| 97 | s = "Arguments"; |
| 98 | break; |
| 99 | case Type_JsonObject: |
| 100 | s = "JSON"; |
| 101 | break; |
| 102 | case Type_ProxyObject: |
| 103 | s = "ProxyObject"; |
| 104 | break; |
| 105 | case Type_MathObject: |
| 106 | s = "Math"; |
| 107 | break; |
| 108 | |
| 109 | case Type_ExecutionContext: |
| 110 | s = "__ExecutionContext"; |
| 111 | break; |
| 112 | case Type_MapIteratorObject: |
| 113 | s = "Map Iterator"; |
| 114 | break; |
| 115 | case Type_SetIteratorObject: |
| 116 | s = "Set Iterator"; |
| 117 | break; |
| 118 | case Type_ArrayIteratorObject: |
| 119 | s = "Array Iterator"; |
| 120 | break; |
| 121 | case Type_StringIteratorObject: |
| 122 | s = "String Iterator"; |
| 123 | break; |
| 124 | case Type_ForInIterator: |
| 125 | s = "__ForIn Iterator"; |
| 126 | break; |
| 127 | case Type_InternalClass: |
| 128 | s = "__InternalClass"; |
| 129 | break; |
| 130 | case Type_RegExp: |
| 131 | s = "__RegExp"; |
| 132 | break; |
| 133 | |
| 134 | case Type_QmlSequence: |
| 135 | s = "QmlSequence"; |
| 136 | break; |
| 137 | } |
| 138 | return QString::fromLatin1(str: s); |
| 139 | } |
| 140 | |
| 141 | bool Managed::virtualIsEqualTo(Managed *, Managed *) |
| 142 | { |
| 143 | return false; |
| 144 | } |
| 145 | |
| 146 | |
| 147 | OwnPropertyKeyIterator::~OwnPropertyKeyIterator() |
| 148 | { |
| 149 | } |
| 150 |
