Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qjsmanagedvalue.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 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 <QtQml/qjsmanagedvalue.h>
5#include <QtQml/qjsengine.h>
6#include <QtQml/private/qv4persistent_p.h>
7#include <QtQml/private/qv4engine_p.h>
8#include <QtQml/private/qv4mm_p.h>
9#include <QtQml/private/qjsvalue_p.h>
10#include <QtQml/private/qv4runtime_p.h>
11#include <QtQml/private/qv4functionobject_p.h>
12#include <QtQml/private/qv4jscall_p.h>
13#include <QtQml/private/qv4urlobject_p.h>
14#include <QtQml/private/qv4variantobject_p.h>
15#include <QtQml/private/qv4qobjectwrapper_p.h>
16#include <QtQml/private/qv4regexpobject_p.h>
17#include <QtQml/private/qv4dateobject_p.h>
18#include <QtQml/private/qv4errorobject_p.h>
19#include <QtQml/private/qv4identifiertable_p.h>
20
21#include <QtCore/qregularexpression.h>
22#include <QtCore/qurl.h>
23#include <QtCore/qdatetime.h>
24
26
105{
106 if (!d)
107 return nullptr;
108
110 Q_ASSERT(v4);
111 return v4;
112}
113
120{
122
124 if (Q_UNLIKELY(v4Engine(m) != v4)) {
125 qWarning("QJSManagedValue(QJSValue, QJSEngine *) failed: "
126 "Value was created in different engine.");
128 return;
129 }
130
131 d = m;
132 return;
133 }
134
136
137 if (const QString *string = QJSValuePrivate::asQString(&value))
138 *d = v4->newString(*string);
139 else
141}
142
148{
149 switch (value.type()) {
152 return;
154 *d = QV4::Encode::null();
155 return;
157 *d = QV4::Encode(value.asBoolean());
158 return;
160 *d = QV4::Encode(value.asInteger());
161 return;
163 *d = QV4::Encode(value.asDouble());
164 return;
166 *d = engine->handle()->newString(value.asString());
167 return;
168 }
169
170 Q_UNREACHABLE();
171}
172
178{
180}
181
187{
188 *d = engine->handle()->newString(string);
189}
190
199{
201}
202
209{
210 qSwap(d, other.d);
211}
212
223{
224 if (this != &other) {
226 d = nullptr;
227 qSwap(d, other.d);
228 }
229 return *this;
230}
231
239{
240 if (!d)
241 return !other.d || other.d->isNullOrUndefined();
242 if (!other.d)
243 return d->isNullOrUndefined();
244
246}
247
255{
256 if (!d)
257 return !other.d || other.d->isUndefined();
258 if (!other.d)
259 return d->isUndefined();
260
262}
263
270{
271 if (!d)
272 return nullptr;
274 return v4->jsEngine();
275 return nullptr;
276}
277
284{
285 if (!d)
286 return QJSManagedValue();
287
290
291 if (auto object = d->as<QV4::Object>())
292 *result.d = object->getPrototypeOf();
293 else if (auto managed = d->as<QV4::Managed>())
294 *result.d = managed->internalClass()->prototype;
295 else if (d->isBoolean())
296 *result.d = v4->booleanPrototype();
297 else if (d->isNumber())
298 *result.d = v4->numberPrototype();
299
300 // If the prototype appears to be undefined, then it's actually null in JS terms.
301 if (result.d->isUndefined())
303
304 return result;
305}
306
314{
315 auto object = d ? d->as<QV4::Object>() : nullptr;
316 if (!object) {
317 qWarning("QJSManagedValue::setPrototype() failed: "
318 "Can only set a prototype on an object (excluding null).");
319 return;
320 }
321
322 // Object includes null ...
324 qWarning("QJSManagedValue::setPrototype() failed: "
325 "Can only set objects (including null) as prototypes.");
326 return;
327 }
328
329 if (Q_UNLIKELY(object->engine() != v4Engine(prototype.d))) {
330 qWarning("QJSManagedValue::setPrototype() failed: "
331 "Prototype was created in differen engine.");
332 return;
333 }
334
335 // ... Null becomes nullptr here. That is why it appears as undefined later.
336 if (!object->setPrototypeOf(prototype.d->as<QV4::Object>())) {
337 qWarning("QJSManagedValue::setPrototype() failed: "
338 "Prototype cycle detected.");
339 }
340}
341
346{
347 if (!d || d->isUndefined())
348 return Undefined;
349 if (d->isBoolean())
350 return Boolean;
351 if (d->isNumber())
352 return Number;
353 if (d->isString())
354 return String;
355 if (d->isSymbol())
356 return Symbol;
357 if (d->isFunctionObject())
358 return Function;
359 return Object;
360}
361
416{
417 return d && d->isNull();
418}
419
427{
428 return d && d->isInteger();
429}
430
436{
437 return d && d->as<QV4::RegExpObject>();
438}
439
445{
446 return d && d->as<QV4::ArrayObject>();
447}
448
454{
455 return d && d->as<QV4::UrlObject>();
456}
457
463{
464 return d && d->as<QV4::VariantObject>();
465}
466
472{
473 return d && d->as<QV4::QObjectWrapper>();
474}
475
481{
482 return d && d->as<QV4::QMetaObjectWrapper>();
483}
484
490{
491 return d && d->as<QV4::DateObject>();
492}
493
499{
500 return d && d->as<QV4::ErrorObject>();
501}
502
510{
511 return d && d->as<QV4::InternalClass>();
512}
513
525{
526 return d ? d->toQString() : QStringLiteral("undefined");
527}
528
540{
541 return d ? d->toNumber() : 0;
542}
543
550{
551 return d ? d->toBoolean() : false;
552}
553
572{
573 return d ? d->toInt32() : 0;
574}
575
588{
589 if (!d || d->isUndefined())
590 return QJSPrimitiveUndefined();
591 if (d->isNull())
592 return QJSPrimitiveNull();
593 if (d->isBoolean())
594 return d->booleanValue();
595 if (d->isInteger())
596 return d->integerValue();
597 if (d->isNumber())
598 return d->doubleValue();
599
600 bool ok;
601 const QString result = d->toQString(&ok);
603}
604
611{
613}
614
621{
622 if (!d || d->isUndefined())
623 return QVariant();
624 if (d->isNull())
625 return QVariant(QMetaType::fromType<std::nullptr_t>(), nullptr);
626 if (d->isBoolean())
627 return QVariant(d->booleanValue());
628 if (d->isInteger())
629 return QVariant(d->integerValue());
630 if (d->isNumber())
631 return QVariant(d->doubleValue());
632 if (d->isString())
633 return QVariant(d->toQString());
634 if (d->as<QV4::Managed>())
635 return QV4::ExecutionEngine::toVariant(*d, QMetaType{}, true);
636
637 Q_UNREACHABLE_RETURN(QVariant());
638}
639
645{
646 if (const auto *r = d ? d->as<QV4::RegExpObject>() : nullptr)
647 return r->toQRegularExpression();
648 return {};
649}
650
656{
657 if (const auto *u = d ? d->as<QV4::UrlObject>() : nullptr)
658 return u->toQUrl();
659 return {};
660}
661
667{
668 if (const auto *o = d ? d->as<QV4::QObjectWrapper>() : nullptr)
669 return o->object();
670 return {};
671}
672
678{
679 if (const auto *m = d ? d->as<QV4::QMetaObjectWrapper>() : nullptr)
680 return m->metaObject();
681 return {};
682}
683
689{
690 if (const auto *t = d ? d->as<QV4::DateObject>() : nullptr)
691 return t->toQDateTime();
692 return {};
693}
694
700{
701 if (!d || d->isNullOrUndefined())
702 return false;
703
704 if (d->isString() && name == QStringLiteral("length"))
705 return true;
706
707 if (QV4::Object *obj = d->as<QV4::Object>()) {
708 QV4::Scope scope(obj->engine());
710 return obj->hasProperty(key);
711 }
712
713 return prototype().hasProperty(name);
714}
715
721{
722 if (!d || d->isNullOrUndefined())
723 return false;
724
725 if (d->isString() && name == QStringLiteral("length"))
726 return true;
727
728 if (QV4::Object *obj = d->as<QV4::Object>()) {
729 QV4::Scope scope(obj->engine());
731 return obj->getOwnProperty(key) != QV4::Attr_Invalid;
732 }
733
734 return false;
735}
736
742{
743 if (!d)
744 return QJSValue();
745
746 if (d->isNullOrUndefined()) {
748 e->throwTypeError(QStringLiteral("Cannot read property '%1' of null").arg(name));
749 return QJSValue();
750 }
751
752 if (QV4::String *string = d->as<QV4::String>()) {
753 if (name == QStringLiteral("length"))
754 return QJSValue(string->d()->length());
755 }
756
757 if (QV4::Object *obj = d->as<QV4::Object>()) {
758 QV4::Scope scope(obj->engine());
761 }
762
763 return prototype().property(name);
764}
765
772{
773 if (!d)
774 return;
775
776 if (d->isNullOrUndefined()) {
778 QStringLiteral("Value is null and could not be converted to an object"));
779 }
780
781 if (QV4::Object *obj = d->as<QV4::Object>()) {
782 QV4::Scope scope(obj->engine());
784 if (Q_UNLIKELY(v4 && v4 != scope.engine)) {
785 qWarning("QJSManagedValue::setProperty() failed: "
786 "Value was created in different engine.");
787 return;
788 }
791 }
792}
793
799{
800 if (!d)
801 return false;
802
803 if (QV4::Object *obj = d->as<QV4::Object>()) {
804 QV4::Scope scope(obj->engine());
806 return obj->deleteProperty(key);
807 }
808
809 return false;
810}
811
818{
819 if (!d || d->isNullOrUndefined())
820 return false;
821
822 if (QV4::String *string = d->as<QV4::String>())
823 return arrayIndex < quint32(string->d()->length());
824
825 if (QV4::Object *obj = d->as<QV4::Object>()) {
826 bool hasProperty = false;
827 if (arrayIndex == std::numeric_limits<quint32>::max())
828 obj->get(obj->engine()->id_uintMax(), &hasProperty);
829 else
830 obj->get(arrayIndex, &hasProperty);
831 return hasProperty;
832 }
833
834 return prototype().hasProperty(arrayIndex);
835}
836
843{
844 if (!d || d->isNullOrUndefined())
845 return false;
846
847 if (QV4::String *string = d->as<QV4::String>())
848 return arrayIndex < quint32(string->d()->length());
849
850 if (QV4::Object *obj = d->as<QV4::Object>()) {
851 if (arrayIndex == std::numeric_limits<quint32>::max()) {
852 return obj->getOwnProperty(obj->engine()->id_uintMax()->toPropertyKey())
854 } else {
855 return obj->getOwnProperty(QV4::PropertyKey::fromArrayIndex(arrayIndex))
857 }
858 }
859
860 return false;
861}
862
869{
870 if (!d || d->isNullOrUndefined())
871 return QJSValue();
872
873 if (QV4::String *string = d->as<QV4::String>()) {
874 const QString qString = string->toQString();
875 if (arrayIndex < quint32(qString.size()))
876 return qString.sliced(arrayIndex, 1);
877 return QJSValue();
878 }
879
880 if (QV4::Object *obj = d->as<QV4::Object>()) {
881 if (arrayIndex == std::numeric_limits<quint32>::max())
882 return QJSValuePrivate::fromReturnedValue(obj->get(obj->engine()->id_uintMax()));
883 else
884 return QJSValuePrivate::fromReturnedValue(obj->get(arrayIndex));
885 }
886
887 return prototype().property(arrayIndex);
888}
889
897{
898 if (!d)
899 return;
900
901 if (QV4::Object *obj = d->as<QV4::Object>()) {
903 if (Q_UNLIKELY(v4 && v4 != obj->engine())) {
904 qWarning("QJSManagedValue::setProperty() failed: "
905 "Value was created in different engine.");
906 return;
907 }
909 }
910}
911
917{
918 if (!d)
919 return false;
920
921 if (QV4::Object *obj = d->as<QV4::Object>())
922 return obj->deleteProperty(QV4::PropertyKey::fromArrayIndex(arrayIndex));
923
924 return false;
925}
926
928{
929 if (Q_UNLIKELY(!d)) {
930 qWarning("QJSManagedValue: Calling a default-constructed or moved-from managed value"
931 "should throw an exception, but there is no engine to receive it.");
932 return nullptr;
933 }
934
935 if (const QV4::FunctionObject *f = d->as<QV4::FunctionObject>())
936 return f;
937
938 v4Engine(d)->throwTypeError(QStringLiteral("Value is not a function"));
939 return nullptr;
940}
941
952{
954 if (!f)
955 return QJSValue();
956
957 QV4::ExecutionEngine *engine = f->engine();
958
959 QV4::Scope scope(engine);
960 QV4::JSCallArguments jsCallData(scope, arguments.size());
961 *jsCallData.thisObject = engine->globalObject;
962 int i = 0;
963 for (const QJSValue &arg : arguments) {
965 qWarning("QJSManagedValue::call() failed: Argument was created in different engine.");
966 return QJSValue();
967 }
969 }
970
971 return QJSValuePrivate::fromReturnedValue(f->call(jsCallData));
972}
973
984 const QJSValueList &arguments) const
985{
987 if (!f)
988 return QJSValue();
989
990 QV4::ExecutionEngine *engine = f->engine();
991
993 qWarning("QJSManagedValue::callWithInstance() failed: "
994 "Instance was created in different engine.");
995 return QJSValue();
996 }
997
998 QV4::Scope scope(engine);
999 QV4::JSCallArguments jsCallData(scope, arguments.size());
1001 int i = 0;
1002 for (const QJSValue &arg : arguments) {
1004 qWarning("QJSManagedValue::callWithInstance() failed: "
1005 "Argument was created in different engine.");
1006 return QJSValue();
1007 }
1009 }
1010
1011 return QJSValuePrivate::fromReturnedValue(f->call(jsCallData));
1012}
1013
1024{
1026 if (!f)
1027 return QJSValue();
1028
1029 QV4::ExecutionEngine *engine = f->engine();
1030
1031 QV4::Scope scope(engine);
1032 QV4::JSCallArguments jsCallData(scope, arguments.size());
1033 int i = 0;
1034 for (const QJSValue &arg : arguments) {
1036 qWarning("QJSManagedValue::callAsConstructor() failed: "
1037 "Argument was created in different engine.");
1038 return QJSValue();
1039 }
1041 }
1042
1043 return QJSValuePrivate::fromReturnedValue(f->callAsConstructor(jsCallData));
1044}
1045
1057{
1058 if (!d)
1059 return QJSManagedValue();
1060
1062 if (QV4::Managed *m = d->as<QV4::Managed>())
1063 *result.d = m->internalClass();
1064
1065 return result;
1066}
1067
1080{
1081 if (!d)
1082 return {};
1083
1085 const auto heapClass = c->d();
1086 const int size = heapClass->size;
1088 result.reserve(size);
1089 for (int i = 0; i < size; ++i)
1090 result.append(heapClass->keyAt(i));
1091 return result;
1092 }
1093
1094 return {};
1095}
1096
1110{
1111 if (!d)
1112 return {};
1113
1115 QV4::ExecutionEngine *engine = c->engine();
1117 *result.d = c->engine()->newObject(c->d());
1118 QV4::Object *o = result.d->as<QV4::Object>();
1119
1120 for (uint i = 0, end = qMin(qsizetype(c->d()->size), values.size()); i < end; ++i) {
1121 const QJSValue &arg = values[i];
1123 qWarning("QJSManagedValue::instantiate() failed: "
1124 "Argument was created in different engine.");
1125 return QJSManagedValue();
1126 }
1128 }
1129
1130 return result;
1131 }
1132
1133 return {};
1134}
1135
1137 d(engine->memoryManager->m_persistentValues->allocate())
1138{
1139}
1140
\inmodule QtCore\reentrant
Definition qdatetime.h:257
The QJSEngine class provides an environment for evaluating JavaScript code.
Definition qjsengine.h:26
QV4::ExecutionEngine * handle() const
Definition qjsengine.h:292
QJSValue globalObject() const
Returns this engine's Global Object.
\inmodule QtQml
QJSEngine * engine() const
Returns the QJSEngine this QJSManagedValue belongs to.
QJSManagedValue()=default
Creates a QJSManagedValue that represents the JavaScript undefined value.
QJSValue toJSValue() const
Copies this QJSManagedValue into a new QJSValue.
QJSManagedValue jsMetaType() const
const QMetaObject * toQMetaObject() const
If this QJSManagedValue holds a QMetaObject pointer, returns it.
QStringList jsMetaMembers() const
bool isArray() const
Returns true if this value represents a JavaScript Array object, or false otherwise.
bool isError() const
Returns true if this value represents a JavaScript Error object, or false otherwise.
bool strictlyEquals(const QJSManagedValue &other) const
Invokes the JavaScript '===' operator on this QJSManagedValue and other, and returns the result.
bool hasProperty(const QString &name) const
Returns true if this QJSManagedValue has a property name, otherwise returns false.
QJSValue call(const QJSValueList &arguments={}) const
If this QJSManagedValue represents a JavaScript FunctionObject, calls it with the given arguments,...
QObject * toQObject() const
If this QJSManagedValue holds a QObject pointer, returns it.
bool isRegularExpression() const
Returns true if this value represents a JavaScript regular expression object, or false otherwise.
QJSValue property(const QString &name) const
Returns the property name of this QJSManagedValue.
QJSManagedValue jsMetaInstantiate(const QJSValueList &values={}) const
QVariant toVariant() const
Copies this QJSManagedValue into a new QVariant.
double toNumber() const
Converts the manged value to a number.
QJSManagedValue & operator=(QJSManagedValue &&other)
Move-assigns a QJSManagedValue from other.
QJSValue callAsConstructor(const QJSValueList &arguments={}) const
If this QJSManagedValue represents a JavaScript FunctionObject, calls it as constructor with the give...
bool isVariant() const
Returns true if this value represents a QVariant managed on the JavaScript heap, or false otherwise.
friend class QJSValue
QRegularExpression toRegularExpression() const
If this QJSManagedValue holds a JavaScript regular expression object, returns an equivalent QRegularE...
QJSManagedValue prototype() const
Returns the prototype for this QJSManagedValue.
bool isDate() const
Returns true if this value represents a JavaScript Date object, or false otherwise.
bool equals(const QJSManagedValue &other) const
Invokes the JavaScript '==' operator on this QJSManagedValue and other, and returns the result.
~QJSManagedValue()
Destroys the QJSManagedValue.
QJSPrimitiveValue toPrimitive() const
Converts the manged value to a QJSPrimitiveValue.
bool deleteProperty(const QString &name)
Deletes the property name from this QJSManagedValue.
Type type() const
Returns the JavaScript type of this QJSManagedValue.
bool isQMetaObject() const
Returns true if this value represents a QMetaObject pointer managed on the JavaScript heap,...
QDateTime toDateTime() const
If this QJSManagedValue holds a JavaScript Date object, returns an equivalent QDateTime.
int toInteger() const
Converts the manged value to an integer.
Type
This enum represents the JavaScript native types, as specified by \l{ECMA-262}.
QString toString() const
Converts the manged value to a string.
QUrl toUrl() const
If this QJSManagedValue holds a JavaScript Url object, returns an equivalent QUrl.
bool isQObject() const
Returns true if this value represents a QObject pointer managed on the JavaScript heap,...
bool hasOwnProperty(const QString &name) const
Returns true if this QJSManagedValue has a property name, otherwise returns false.
void setPrototype(const QJSManagedValue &prototype)
Sets the prototype of this QJSManagedValue to prototype.
bool isUrl() const
Returns true if this value represents a JavaScript Url object, or false otherwise.
bool isInteger() const
Returns true if this QJSManagedValue holds an integer value, or false otherwise.
bool isNull() const
Returns true if this QJSManagedValue holds the JavaScript null value, or false otherwise.
void setProperty(const QString &name, const QJSValue &value)
Sets the property name to value on this QJSManagedValue.
bool toBoolean() const
Converts the manged value to a boolean.
QJSValue callWithInstance(const QJSValue &instance, const QJSValueList &arguments={}) const
If this QJSManagedValue represents a JavaScript FunctionObject, calls it on instance with the given a...
bool isJsMetaType() const
The QJSPrimitiveValue class operates on primitive types in JavaScript semantics.
static QJSValue fromReturnedValue(QV4::ReturnedValue d)
Definition qjsvalue_p.h:189
static bool checkEngine(QV4::ExecutionEngine *e, const QJSValue &jsval)
Definition qjsvalue_p.h:323
static QV4::ExecutionEngine * engine(const QJSValue *jsval)
Definition qjsvalue_p.h:313
static QV4::Value * takeManagedValue(QJSValue *jsval)
Definition qjsvalue_p.h:207
static QV4::ReturnedValue asReturnedValue(const QJSValue *jsval)
Definition qjsvalue_p.h:249
static const QString * asQString(const QJSValue *jsval)
Definition qjsvalue_p.h:240
static QV4::ReturnedValue convertToReturnedValue(QV4::ExecutionEngine *e, const QJSValue &jsval)
Definition qjsvalue_p.h:298
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
\inmodule QtCore
Definition qmetatype.h:320
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore \reentrant
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
qsizetype size() const
Returns the number of characters in this string.
Definition qstring.h:182
QString sliced(qsizetype pos) const
Definition qstring.h:341
\inmodule QtCore
Definition qurl.h:94
PersistentValueStorage * m_persistentValues
Definition qv4mm_p.h:297
\inmodule QtCore
Definition qvariant.h:64
qSwap(pi, e)
double e
QList< QVariant > arguments
QJSManagedValue managed(std::move(val), &engine)
Combined button and popup list for selecting options.
@ Attr_Invalid
#define Q_UNLIKELY(x)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static const QV4::FunctionObject * functionObjectForCall(QV4::Value *d)
static QV4::ExecutionEngine * v4Engine(QV4::Value *d)
#define qWarning
Definition qlogging.h:162
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
GLenum GLsizei GLsizei GLint * values
[15]
GLuint64 GLenum void * handle
const GLfloat * m
GLuint64 key
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLboolean r
[2]
GLuint GLuint end
GLuint object
[3]
GLfloat GLfloat f
GLuint name
GLhandleARB obj
[2]
const GLubyte * c
GLdouble GLdouble t
Definition qopenglext.h:243
GLuint64EXT * result
[6]
GLsizei const GLchar *const * string
[0]
Definition qopenglext.h:694
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
SSL_CTX int(*) void arg)
#define QStringLiteral(str)
unsigned int quint32
Definition qtypes.h:45
ptrdiff_t qsizetype
Definition qtypes.h:70
unsigned int uint
Definition qtypes.h:29
QVariant variant
[1]
QSharedPointer< T > other(t)
[5]
QJSEngine engine
[0]
An empty marker type to signify the JavaScript null value. \inmodule QtQml.
An empty marker type to signify the JavaScript Undefined type and its single value....
\inmodule QtCore
static constexpr ReturnedValue undefined()
static constexpr ReturnedValue null()
IdentifierTable * identifierTable
MemoryManager * memoryManager
Heap::String * newString(const QString &s=QString())
QV4::ReturnedValue fromVariant(const QVariant &)
Object * numberPrototype() const
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols=true)
Object * booleanPrototype() const
ReturnedValue throwTypeError()
PropertyKey asPropertyKey(const Heap::String *str)
static ExecutionEngine * getEngine(const Value *v)
static void free(Value *v)
static PropertyKey fromArrayIndex(uint idx)
static Bool strictEqual(const Value &x, const Value &y)
static Bool call(const Value &, const Value &)
ExecutionEngine * engine
bool isNumber() const
bool isInteger() const
constexpr ReturnedValue asReturnedValue() const
QV4_NEARLY_ALWAYS_INLINE double doubleValue() const
bool isNullOrUndefined() const
int integerValue() const
bool isBoolean() const
bool isUndefined() const
bool booleanValue() const
bool isFunctionObject() const
Definition qv4value_p.h:309
bool isString() const
Definition qv4value_p.h:284
int toInt32() const
Definition qv4value_p.h:350
bool toBoolean() const
Definition qv4value_p.h:97
double toNumber() const
Definition qv4value_p.h:320
const T * as() const
Definition qv4value_p.h:132
QString toQString() const
Definition qv4value.cpp:158
bool isSymbol() const
Definition qv4value_p.h:296