Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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/qv4qmetaobjectwrapper_p.h>
17#include <QtQml/private/qv4regexpobject_p.h>
18#include <QtQml/private/qv4dateobject_p.h>
19#include <QtQml/private/qv4errorobject_p.h>
20#include <QtQml/private/qv4identifiertable_p.h>
21
22#include <QtCore/qregularexpression.h>
23#include <QtCore/qurl.h>
24#include <QtCore/qdatetime.h>
25
27
106{
107 if (!d)
108 return nullptr;
109
111 Q_ASSERT(v4);
112 return v4;
113}
114
121{
123
125 if (Q_UNLIKELY(v4Engine(m) != v4)) {
126 qWarning("QJSManagedValue(QJSValue, QJSEngine *) failed: "
127 "Value was created in different engine.");
129 return;
130 }
131
132 d = m;
133 return;
134 }
135
137
138 if (const QString *string = QJSValuePrivate::asQString(&value))
139 *d = v4->newString(*string);
140 else
142}
143
149{
150 switch (value.type()) {
153 return;
155 *d = QV4::Encode::null();
156 return;
158 *d = QV4::Encode(value.asBoolean());
159 return;
161 *d = QV4::Encode(value.asInteger());
162 return;
164 *d = QV4::Encode(value.asDouble());
165 return;
167 *d = engine->handle()->newString(value.asString());
168 return;
169 }
170
171 Q_UNREACHABLE();
172}
173
182
191
203
213
224{
225 if (this != &other) {
227 d = nullptr;
228 qSwap(d, other.d);
229 }
230 return *this;
231}
232
240{
241 if (!d)
242 return !other.d || other.d->isNullOrUndefined();
243 if (!other.d)
244 return d->isNullOrUndefined();
245
247}
248
256{
257 if (!d)
258 return !other.d || other.d->isUndefined();
259 if (!other.d)
260 return d->isUndefined();
261
263}
264
271{
272 if (!d)
273 return nullptr;
275 return v4->jsEngine();
276 return nullptr;
277}
278
285{
286 if (!d)
287 return QJSManagedValue();
288
291
292 if (auto object = d->as<QV4::Object>())
293 *result.d = object->getPrototypeOf();
294 else if (auto managed = d->as<QV4::Managed>())
295 *result.d = managed->internalClass()->prototype;
296 else if (d->isBoolean())
297 *result.d = v4->booleanPrototype();
298 else if (d->isNumber())
299 *result.d = v4->numberPrototype();
300
301 // If the prototype appears to be undefined, then it's actually null in JS terms.
302 if (result.d->isUndefined())
304
305 return result;
306}
307
315{
316 auto object = d ? d->as<QV4::Object>() : nullptr;
317 if (!object) {
318 qWarning("QJSManagedValue::setPrototype() failed: "
319 "Can only set a prototype on an object (excluding null).");
320 return;
321 }
322
323 // Object includes null ...
325 qWarning("QJSManagedValue::setPrototype() failed: "
326 "Can only set objects (including null) as prototypes.");
327 return;
328 }
329
330 if (Q_UNLIKELY(object->engine() != v4Engine(prototype.d))) {
331 qWarning("QJSManagedValue::setPrototype() failed: "
332 "Prototype was created in differen engine.");
333 return;
334 }
335
336 // ... Null becomes nullptr here. That is why it appears as undefined later.
337 if (!object->setPrototypeOf(prototype.d->as<QV4::Object>())) {
338 qWarning("QJSManagedValue::setPrototype() failed: "
339 "Prototype cycle detected.");
340 }
341}
342
347{
348 if (!d || d->isUndefined())
349 return Undefined;
350 if (d->isBoolean())
351 return Boolean;
352 if (d->isNumber())
353 return Number;
354 if (d->isString())
355 return String;
356 if (d->isSymbol())
357 return Symbol;
358 if (d->isFunctionObject())
359 return Function;
360 return Object;
361}
362
417{
418 return d && d->isNull();
419}
420
428{
429 return d && d->isInteger();
430}
431
437{
438 return d && d->as<QV4::RegExpObject>();
439}
440
446{
447 return d && d->as<QV4::ArrayObject>();
448}
449
455{
456 return d && d->as<QV4::UrlObject>();
457}
458
464{
465 return d && d->as<QV4::VariantObject>();
466}
467
473{
474 return d && d->as<QV4::QObjectWrapper>();
475}
476
482{
483 return d && d->as<QV4::QMetaObjectWrapper>();
484}
485
491{
492 return d && d->as<QV4::DateObject>();
493}
494
500{
501 return d && d->as<QV4::ErrorObject>();
502}
503
511{
512 return d && d->as<QV4::InternalClass>();
513}
514
526{
527 return d ? d->toQString() : QStringLiteral("undefined");
528}
529
541{
542 return d ? d->toNumber() : 0;
543}
544
551{
552 return d ? d->toBoolean() : false;
553}
554
573{
574 return d ? d->toInt32() : 0;
575}
576
589{
590 if (!d || d->isUndefined())
591 return QJSPrimitiveUndefined();
592 if (d->isNull())
593 return QJSPrimitiveNull();
594 if (d->isBoolean())
595 return d->booleanValue();
596 if (d->isInteger())
597 return d->integerValue();
598 if (d->isNumber())
599 return d->doubleValue();
600
601 bool ok;
602 const QString result = d->toQString(&ok);
604}
605
615
622{
623 if (!d || d->isUndefined())
624 return QVariant();
625 if (d->isNull())
626 return QVariant(QMetaType::fromType<std::nullptr_t>(), nullptr);
627 if (d->isBoolean())
628 return QVariant(d->booleanValue());
629 if (d->isInteger())
630 return QVariant(d->integerValue());
631 if (d->isNumber())
632 return QVariant(d->doubleValue());
633 if (d->isString())
634 return QVariant(d->toQString());
635 if (d->as<QV4::Managed>())
636 return QV4::ExecutionEngine::toVariant(*d, QMetaType{}, true);
637
638 Q_UNREACHABLE_RETURN(QVariant());
639}
640
646{
647 if (const auto *r = d ? d->as<QV4::RegExpObject>() : nullptr)
648 return r->toQRegularExpression();
649 return {};
650}
651
657{
658 if (const auto *u = d ? d->as<QV4::UrlObject>() : nullptr)
659 return u->toQUrl();
660 return {};
661}
662
668{
669 if (const auto *o = d ? d->as<QV4::QObjectWrapper>() : nullptr)
670 return o->object();
671 return {};
672}
673
679{
680 if (const auto *m = d ? d->as<QV4::QMetaObjectWrapper>() : nullptr)
681 return m->metaObject();
682 return {};
683}
684
690{
691 if (const auto *t = d ? d->as<QV4::DateObject>() : nullptr)
692 return t->toQDateTime();
693 return {};
694}
695
701{
702 if (!d || d->isNullOrUndefined())
703 return false;
704
705 if (d->isString() && name == QStringLiteral("length"))
706 return true;
707
708 if (QV4::Object *obj = d->as<QV4::Object>()) {
709 QV4::Scope scope(obj->engine());
711 return obj->hasProperty(key);
712 }
713
714 return prototype().hasProperty(name);
715}
716
722{
723 if (!d || d->isNullOrUndefined())
724 return false;
725
726 if (d->isString() && name == QStringLiteral("length"))
727 return true;
728
729 if (QV4::Object *obj = d->as<QV4::Object>()) {
730 QV4::Scope scope(obj->engine());
732 return obj->getOwnProperty(key) != QV4::Attr_Invalid;
733 }
734
735 return false;
736}
737
743{
744 if (!d)
745 return QJSValue();
746
747 if (d->isNullOrUndefined()) {
749 e->throwTypeError(QStringLiteral("Cannot read property '%1' of null").arg(name));
750 return QJSValue();
751 }
752
753 if (QV4::String *string = d->as<QV4::String>()) {
754 if (name == QStringLiteral("length"))
755 return QJSValue(string->d()->length());
756 }
757
758 if (QV4::Object *obj = d->as<QV4::Object>()) {
759 QV4::Scope scope(obj->engine());
762 }
763
764 return prototype().property(name);
765}
766
773{
774 if (!d)
775 return;
776
777 if (d->isNullOrUndefined()) {
778 v4Engine(d)->throwTypeError(
779 QStringLiteral("Value is null and could not be converted to an object"));
780 }
781
782 if (QV4::Object *obj = d->as<QV4::Object>()) {
783 QV4::Scope scope(obj->engine());
785 if (Q_UNLIKELY(v4 && v4 != scope.engine)) {
786 qWarning("QJSManagedValue::setProperty() failed: "
787 "Value was created in different engine.");
788 return;
789 }
792 }
793}
794
800{
801 if (!d)
802 return false;
803
804 if (QV4::Object *obj = d->as<QV4::Object>()) {
805 QV4::Scope scope(obj->engine());
807 return obj->deleteProperty(key);
808 }
809
810 return false;
811}
812
819{
820 if (!d || d->isNullOrUndefined())
821 return false;
822
823 if (QV4::String *string = d->as<QV4::String>())
824 return arrayIndex < quint32(string->d()->length());
825
826 if (QV4::Object *obj = d->as<QV4::Object>()) {
827 bool hasProperty = false;
828 if (arrayIndex == std::numeric_limits<quint32>::max())
829 obj->get(obj->engine()->id_uintMax(), &hasProperty);
830 else
831 obj->get(arrayIndex, &hasProperty);
832 return hasProperty;
833 }
834
835 return prototype().hasProperty(arrayIndex);
836}
837
844{
845 if (!d || d->isNullOrUndefined())
846 return false;
847
848 if (QV4::String *string = d->as<QV4::String>())
849 return arrayIndex < quint32(string->d()->length());
850
851 if (QV4::Object *obj = d->as<QV4::Object>()) {
852 if (arrayIndex == std::numeric_limits<quint32>::max()) {
853 return obj->getOwnProperty(obj->engine()->id_uintMax()->toPropertyKey())
855 } else {
856 return obj->getOwnProperty(QV4::PropertyKey::fromArrayIndex(arrayIndex))
858 }
859 }
860
861 return false;
862}
863
870{
871 if (!d || d->isNullOrUndefined())
872 return QJSValue();
873
874 if (QV4::String *string = d->as<QV4::String>()) {
875 const QString qString = string->toQString();
876 if (arrayIndex < quint32(qString.size()))
877 return qString.sliced(arrayIndex, 1);
878 return QJSValue();
879 }
880
881 if (QV4::Object *obj = d->as<QV4::Object>()) {
882 if (arrayIndex == std::numeric_limits<quint32>::max())
883 return QJSValuePrivate::fromReturnedValue(obj->get(obj->engine()->id_uintMax()));
884 else
885 return QJSValuePrivate::fromReturnedValue(obj->get(arrayIndex));
886 }
887
888 return prototype().property(arrayIndex);
889}
890
898{
899 if (!d)
900 return;
901
902 if (QV4::Object *obj = d->as<QV4::Object>()) {
904 if (Q_UNLIKELY(v4 && v4 != obj->engine())) {
905 qWarning("QJSManagedValue::setProperty() failed: "
906 "Value was created in different engine.");
907 return;
908 }
910 }
911}
912
918{
919 if (!d)
920 return false;
921
922 if (QV4::Object *obj = d->as<QV4::Object>())
923 return obj->deleteProperty(QV4::PropertyKey::fromArrayIndex(arrayIndex));
924
925 return false;
926}
927
929{
930 if (Q_UNLIKELY(!d)) {
931 qWarning("QJSManagedValue: Calling a default-constructed or moved-from managed value"
932 "should throw an exception, but there is no engine to receive it.");
933 return nullptr;
934 }
935
937 return f;
938
939 v4Engine(d)->throwTypeError(QStringLiteral("Value is not a function"));
940 return nullptr;
941}
942
953{
955 if (!f)
956 return QJSValue();
957
958 QV4::ExecutionEngine *engine = f->engine();
959
960 QV4::Scope scope(engine);
961 QV4::JSCallArguments jsCallData(scope, arguments.size());
962 *jsCallData.thisObject = engine->globalObject;
963 int i = 0;
964 for (const QJSValue &arg : arguments) {
966 qWarning("QJSManagedValue::call() failed: Argument was created in different engine.");
967 return QJSValue();
968 }
970 }
971
972 return QJSValuePrivate::fromReturnedValue(f->call(jsCallData));
973}
974
985 const QJSValueList &arguments) const
986{
988 if (!f)
989 return QJSValue();
990
991 QV4::ExecutionEngine *engine = f->engine();
992
994 qWarning("QJSManagedValue::callWithInstance() failed: "
995 "Instance was created in different engine.");
996 return QJSValue();
997 }
998
999 QV4::Scope scope(engine);
1000 QV4::JSCallArguments jsCallData(scope, arguments.size());
1001 *jsCallData.thisObject = QJSValuePrivate::convertToReturnedValue(engine, instance);
1002 int i = 0;
1003 for (const QJSValue &arg : arguments) {
1005 qWarning("QJSManagedValue::callWithInstance() failed: "
1006 "Argument was created in different engine.");
1007 return QJSValue();
1008 }
1009 jsCallData.args[i++] = QJSValuePrivate::convertToReturnedValue(engine, arg);
1010 }
1011
1012 return QJSValuePrivate::fromReturnedValue(f->call(jsCallData));
1013}
1014
1025{
1027 if (!f)
1028 return QJSValue();
1029
1030 QV4::ExecutionEngine *engine = f->engine();
1031
1032 QV4::Scope scope(engine);
1033 QV4::JSCallArguments jsCallData(scope, arguments.size());
1034 int i = 0;
1035 for (const QJSValue &arg : arguments) {
1037 qWarning("QJSManagedValue::callAsConstructor() failed: "
1038 "Argument was created in different engine.");
1039 return QJSValue();
1040 }
1041 jsCallData.args[i++] = QJSValuePrivate::convertToReturnedValue(engine, arg);
1042 }
1043
1044 return QJSValuePrivate::fromReturnedValue(f->callAsConstructor(jsCallData));
1045}
1046
1058{
1059 if (!d)
1060 return QJSManagedValue();
1061
1063 if (QV4::Managed *m = d->as<QV4::Managed>())
1064 *result.d = m->internalClass();
1065
1066 return result;
1067}
1068
1081{
1082 if (!d)
1083 return {};
1084
1086 const auto heapClass = c->d();
1087 const int size = heapClass->size;
1089 result.reserve(size);
1090 QV4::Scope scope(c->engine());
1091 for (int i = 0; i < size; ++i) {
1092 QV4::ScopedValue key(scope, heapClass->keyAt(i));
1093 result.append(key->toQString());
1094 }
1095 return result;
1096 }
1097
1098 return {};
1099}
1100
1114{
1115 if (!d)
1116 return {};
1117
1119 QV4::ExecutionEngine *engine = c->engine();
1121 *result.d = c->engine()->newObject(c->d());
1122 QV4::Object *o = result.d->as<QV4::Object>();
1123
1124 for (uint i = 0, end = qMin(qsizetype(c->d()->size), values.size()); i < end; ++i) {
1125 const QJSValue &arg = values[i];
1127 qWarning("QJSManagedValue::instantiate() failed: "
1128 "Argument was created in different engine.");
1129 return QJSManagedValue();
1130 }
1132 }
1133
1134 return result;
1135 }
1136
1137 return {};
1138}
1139
1141 d(engine->memoryManager->m_persistentValues->allocate())
1142{
1143}
1144
\inmodule QtCore\reentrant
Definition qdatetime.h:283
The QJSEngine class provides an environment for evaluating JavaScript code.
Definition qjsengine.h:26
QV4::ExecutionEngine * handle() const
Definition qjsengine.h:298
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:197
static bool checkEngine(QV4::ExecutionEngine *e, const QJSValue &jsval)
Definition qjsvalue_p.h:331
static QV4::ExecutionEngine * engine(const QJSValue *jsval)
Definition qjsvalue_p.h:321
static QV4::Value * takeManagedValue(QJSValue *jsval)
Definition qjsvalue_p.h:215
static QV4::ReturnedValue asReturnedValue(const QJSValue *jsval)
Definition qjsvalue_p.h:257
static const QString * asQString(const QJSValue *jsval)
Definition qjsvalue_p.h:248
static QV4::ReturnedValue convertToReturnedValue(QV4::ExecutionEngine *e, const QJSValue &jsval)
Definition qjsvalue_p.h:306
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
Definition qlist.h:75
qsizetype size() const noexcept
Definition qlist.h:397
\inmodule QtCore
Definition qmetatype.h:341
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore \reentrant
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString sliced(qsizetype pos) const &
Definition qstring.h:394
\inmodule QtCore
Definition qurl.h:94
PersistentValueStorage * m_persistentValues
Definition qv4mm_p.h:408
\inmodule QtCore
Definition qvariant.h:65
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:166
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)
QT_BEGIN_NAMESPACE constexpr void qSwap(T &value1, T &value2) noexcept(std::is_nothrow_swappable_v< T >)
Definition qswap.h:20
unsigned int quint32
Definition qtypes.h:50
ptrdiff_t qsizetype
Definition qtypes.h:165
unsigned int uint
Definition qtypes.h:34
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
QV4::ReturnedValue fromVariant(const QVariant &)
Object * numberPrototype() const
Heap::String * newString(char16_t c)
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:353
bool toBoolean() const
Definition qv4value_p.h:97
double toNumber() const
Definition qv4value_p.h:323
const T * as() const
Definition qv4value_p.h:132
QString toQString() const
Definition qv4value.cpp:158
bool isSymbol() const
Definition qv4value_p.h:296