5#include <private/qv4compileddata_p.h>
6#include <private/qv4codegen_p.h>
7#include <private/qqmljsdiagnosticmessage_p.h>
9#include <QtCore/QTextStream>
13#include <QLoggingCategory>
14#if QT_CONFIG(regularexpression)
15#include <QRegularExpression>
17#include <QtCore/QTimeZone>
18#include <QtCore/qiterable.h>
43#include <private/qv4mm_p.h>
70#include <private/qjsvalue_p.h>
71#include <private/qqmltypewrapper_p.h>
72#include <private/qqmlvaluetypewrapper_p.h>
73#include <private/qqmlvaluetype_p.h>
74#include <private/qqmllistwrapper_p.h>
75#include <private/qqmllist_p.h>
76#include <private/qqmltypeloader_p.h>
77#include <private/qqmlbuiltinfunctions_p.h>
78#if QT_CONFIG(qml_locale)
79#include <private/qqmllocale_p.h>
81#if QT_CONFIG(qml_xml_http_request)
82#include <private/qv4domerrors_p.h>
83#include <private/qqmlxmlhttprequest_p.h>
85#include <private/qv4sqlerrors_p.h>
90#include <private/qqmlengine_p.h>
93#include <valgrind/memcheck.h>
110int ExecutionEngine::s_maxCallDepth = -1;
111int ExecutionEngine::s_jitCallCountThreshold = 3;
112int ExecutionEngine::s_maxJSStackSize = 4 * 1024 * 1024;
113int ExecutionEngine::s_maxGCStackSize = 2 * 1024 * 1024;
117 return b->engine()->throwTypeError();
121template <
typename ReturnType>
136void createNewIteratorIfNonExisting(
void **iterator) {
137 if (*iterator ==
nullptr)
149 iface.sizeFn = [](
const void *) {
return qsizetype(0); };
150 iface.valueAtIndexFn = [](
const void *,
qsizetype,
void *) {};
154 iface.advanceIteratorFn = [](
void *,
qsizetype) {};
155 iface.compareIteratorFn = [](
const void *,
const void *) {
158 iface.destroyIteratorFn = [](
const void *) {};
159 iface.copyIteratorFn = [](
void *,
const void *) {};
160 iface.diffIteratorFn = [](
const void *,
const void *) {
return qsizetype(0); };
168 iface.valueMetaType = QtPrivate::qMetaTypeInterfaceForType<QVariant>();
169 iface.iteratorCapabilities = RandomAccessCapability | BiDirectionalCapability | ForwardCapability;
170 iface.addRemoveCapabilities = CanAddAtEnd;
171 iface.sizeFn = [](
const void *
p) ->
qsizetype {
181 iface.valueAtIndexFn = [](
const void *iterable,
qsizetype index,
void *dataPtr) ->
void {
186 void *iterator =
nullptr;
187 createNewIteratorIfNonExisting(&iterator);
189 jsArrayIterator->
index = 0;
190 jsArrayIterator->data =
reinterpret_cast<QJSValue const*
>(iterable);
191 if (
pos == QMetaSequenceInterface::AtEnd) {
199 void *iterator =
nullptr;
200 createNewIteratorIfNonExisting(&iterator);
202 jsArrayIterator->
index = 0;
203 jsArrayIterator->data =
reinterpret_cast<QJSValue const*
>(iterable);
204 if (
pos == QMetaSequenceInterface::AtEnd) {
211 iface.advanceIteratorFn = [](
void *iterator,
qsizetype advanceBy) {
214 iface.advanceConstIteratorFn = [](
void *iterator,
qsizetype advanceBy) {
217 iface.valueAtIteratorFn = [](
const void *iterator,
void *dataPtr) ->
void {
218 const auto *arrayIterator =
static_cast<const JSArrayIterator *
>(iterator);
219 const QJSValue *jsArray = arrayIterator->data;
221 *
data = jsArray->property(arrayIterator->index).toVariant();
223 iface.valueAtConstIteratorFn = [](
const void *iterator,
void *dataPtr) ->
void {
224 const auto *arrayIterator =
static_cast<const JSArrayIterator *
>(iterator);
225 const QJSValue *jsArray = arrayIterator->data;
227 *
data = jsArray->property(arrayIterator->index).toVariant();
229 iface.destroyIteratorFn = [](
const void *iterator) {
232 iface.destroyConstIteratorFn = [](
const void *iterator) {
235 iface.compareIteratorFn = [](
const void *
p,
const void *
other) {
238 return this_->
index == that_->index && this_->data == that_->data;
240 iface.compareConstIteratorFn = [](
const void *
p,
const void *
other) {
243 return this_->
index == that_->index && this_->data == that_->data;
245 iface.copyIteratorFn = [](
void *iterator,
const void *otherIterator) {
246 auto *otherIter = (
static_cast<JSArrayIterator const *
>(otherIterator));
250 iface.copyConstIteratorFn = [](
void *iterator,
const void *otherIterator) {
251 auto *otherIter = (
static_cast<JSArrayIterator const *
>(otherIterator));
255 iface.diffIteratorFn = [](
const void *iterator,
const void *otherIterator) ->
qsizetype {
258 return self->index -
other->index;
260 iface.diffConstIteratorFn = [](
const void *iterator,
const void *otherIterator) ->
qsizetype {
263 return self->index -
other->index;
266 auto *jsvalue =
static_cast<QJSValue *
>(iterable);
272 int len =
a->getLength();
283 if (!
value.isArray()) {
292void ExecutionEngine::initializeStaticMembers()
297 if (
ok && envMaxJSStackSize > 0)
298 s_maxJSStackSize = envMaxJSStackSize;
301 if (
ok && envMaxGCStackSize > 0)
302 s_maxGCStackSize = envMaxGCStackSize;
305 s_maxCallDepth = std::numeric_limits<qint32>::max();
309 if (!
ok || s_maxCallDepth <= 0)
316 s_jitCallCountThreshold = 3;
318 s_jitCallCountThreshold = std::numeric_limits<int>::max();
320 qMetaTypeId<QJSValue>();
321 qMetaTypeId<QList<int> >();
323 if (!QMetaType::hasRegisteredConverterFunction<QJSValue, QVariantMap>())
324 QMetaType::registerConverter<QJSValue, QVariantMap>(convertJSValueToVariantType<QVariantMap>);
325 if (!QMetaType::hasRegisteredConverterFunction<QJSValue, QVariantList>())
326 QMetaType::registerConverter<QJSValue, QVariantList>(convertJSValueToVariantType<QVariantList>);
327 if (!QMetaType::hasRegisteredConverterFunction<QJSValue, QStringList>())
328 QMetaType::registerConverter<QJSValue, QStringList>(convertJSValueToVariantType<QStringList>);
329 if (!QMetaType::hasRegisteredConverterFunction<QJSValue, QSequentialIterable>())
336 , bumperPointerAllocator(new
WTF::BumpPointerAllocator)
338 , gcStack(new
WTF::PageAllocation)
340 , publicEngine(jsEngine)
343 , m_multiplyWrappedQObjects(
nullptr)
345 , m_canAllocateExecutableMemory(OSAllocator::canAllocateExecutableMemory())
348 , m_xmlHttpRequestData(
nullptr)
353 initializeStaticMembers();
362 if (s_maxCallDepth < 0) {
371 const size_t guardPages = 2 * WTF::pageSize();
379 *
jsStack = WTF::PageAllocation::allocate(
380 s_maxJSStackSize + 256*1024 + guardPages, WTF::OSAllocator::JSVMStackPages,
383#ifdef V4_USE_VALGRIND
384 VALGRIND_MAKE_MEM_UNDEFINED(
jsStackBase, m_maxJSStackSize + 256*1024);
389 *
gcStack = WTF::PageAllocation::allocate(
390 s_maxGCStackSize + guardPages, WTF::OSAllocator::JSVMStackPages,
419 Scoped<InternalClass> ic(scope);
505 Scoped<InternalClass> argsClass(scope);
530#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
534 auto *
index = &_index;
537 auto addProtoHasInstance = [&] {
542 Q_ASSERT(
index->index == Heap::FunctionObject::Index_Prototype);
547 Q_ASSERT(
index->index == Heap::FunctionObject::Index_HasInstance);
549 addProtoHasInstance();
552 addProtoHasInstance();
559 ic = ic->changeVTable(MemberFunction::staticVTable());
561 ic = ic->changeVTable(GeneratorFunction::staticVTable());
563 ic = ic->changeVTable(MemberGeneratorFunction::staticVTable());
567 ic = ic->changeVTable(ScriptFunction::staticVTable());
569 ic = ic->changeVTable(ConstructorFunction::staticVTable());
573 Q_ASSERT(
index->index == Heap::FunctionObject::Index_ProtoConstructor);
627 ic =
newInternalClass(SequencePrototype::staticVTable(), SequencePrototype::defaultPrototype(
this));
820 numberObject->defineDefaultProperty(piString, parseIntFn);
821 numberObject->defineDefaultProperty(pfString, parseFloatFn);
837 t->setInternalClass(
t->internalClass()->cryopreserved());
848 m_delayedCallQueue.
init(
this);
854 for (
auto val : nativeModules) {
857 nativeModules.clear();
864 for (
const auto &cu : std::as_const(m_compilationUnits)) {
867 cu->engine =
nullptr;
869 m_compilationUnits.clear();
880#if QT_CONFIG(qml_xml_http_request)
882 m_xmlHttpRequestData =
nullptr;
886#if QT_CONFIG(qml_debug)
904 r->d_unchecked()->init(Heap::ExecutionContext::Type_GlobalContext);
922 return ic->changePrototype(prototype ? prototype->d() :
nullptr);
975 object->arrayReserve(
count);
976 object->setArrayLengthUnchecked(
count);
990 d->
type = Heap::ArrayData::Simple;
997 a->d()->arrayData.set(
this,
d);
998 a->setArrayLengthUnchecked(
length);
1066#if QT_CONFIG(regularexpression)
1082 urlObject->setUrl(
url);
1083 return urlObject->d();
1093 return ErrorObject::create<ErrorObject>(
this,
value,
errorCtor());
1098 return ErrorObject::create<ErrorObject>(
this,
message);
1103 return ErrorObject::create<SyntaxErrorObject>(
this,
message);
1114 return ErrorObject::create<ReferenceErrorObject>(
this,
message);
1125 return ErrorObject::create<TypeErrorObject>(
this,
message);
1130 return ErrorObject::create<RangeErrorObject>(
this,
message);
1140 if (!m_reactionHandler) {
1151 if (!m_reactionHandler) {
1157 executor->d()->capabilities.set(
this, capability->d());
1167 return m_reactionHandler.
data();
1172 return ErrorObject::create<URIErrorObject>(
this,
message);
1177 return ErrorObject::create<EvalErrorObject>(
this,
message);
1220 return ctx->qml()->scopeObject;
1229 return ctx->qml()->context;
1237 while (
f && frameLimit) {
1239 frame.source =
f->source();
1240 frame.function =
f->function();
1241 frame.line =
f->lineNumber();
1244 if (
f->isJSTypesFrame()) {
1252 f =
f->parentFrame();
1271 const QVector<StackFrame> stackTrace =
context->engine()->stackTrace(20);
1272 for (
int i = 0;
i < stackTrace.size(); ++
i) {
1275 const QUrl url(stackTrace.at(
i).source);
1277 str <<
"frame={level=\"" <<
i <<
"\",func=\"" << stackTrace.at(
i).function
1279 <<
"\",line=\"" <<
qAbs(stackTrace.at(
i).line) <<
"\",language=\"js\"}";
1300 if (!
src.isRelative())
1306 if (
f->v4Function) {
1307 base =
f->v4Function->finalUrl();
1310 f =
f->parentFrame();
1331 for (
const auto &compilationUnit : std::as_const(m_compilationUnits))
1332 compilationUnit->markObjects(markStack);
1354 debug->aboutToThrow();
1471 if (!
trace.isEmpty()) {
1505 return v->d()->data();
1507 if (metaType == QMetaType::fromType<bool>())
1510 if (metaType == QMetaType::fromType<double>())
1513 if (metaType == QMetaType::fromType<float>())
1516 if (metaType == QMetaType::fromType<QJsonValue>())
1519 if (metaType == QMetaType::fromType<QJSValue>())
1525 if (metaType == QMetaType::fromType<QJsonObject>()
1529 return QVariant::fromValue<QObject *>(
wrapper->object());
1533 return w->toVariant();
1535 return v->toVariant();
1537 return l->toVariant();
1547 QList<QObject *>
list;
1551 qobjectWrapper =
a->get(ii);
1552 if (!!qobjectWrapper) {
1553 list << qobjectWrapper->object();
1559 return QVariant::fromValue<QList<QObject*> >(
list);
1560 }
else if (metaType == QMetaType::fromType<QJsonArray>()) {
1569 retn =
QVariant(metaType,
nullptr);
1571 if (retnAsIterable.metaContainer().canAddValue()) {
1572 QMetaType valueMetaType = retnAsIterable.metaContainer().valueMetaType();
1573 auto const length =
a->getLength();
1576 arrayValue =
a->get(
i);
1578 arrayValue, valueMetaType);
1580 retnAsIterable.metaContainer().addValue(retn.data(), asVariant.
constData());
1590 if (asVariant.
convert(valueMetaType)) {
1591 retnAsIterable.metaContainer().addValue(retn.data(), asVariant.
constData());
1597 if (valueMetaType == QMetaType::fromType<QVariant>()) {
1598 retnAsIterable.metaContainer().addValue(retn.data(), &asVariant);
1600 auto originalType = asVariant.
metaType();
1601 bool couldConvert = asVariant.
convert(valueMetaType);
1602 if (!couldConvert && originalType.isValid()) {
1607 "at position %1 from %2 to %3")
1612 retnAsIterable.metaContainer().addValue(retn.data(), asVariant.
constData());
1620 if (
value.isUndefined())
1624 if (
value.isBoolean())
1625 return value.booleanValue();
1626 if (
value.isInteger())
1627 return value.integerValue();
1628 if (
value.isNumber())
1629 return value.asDouble();
1633 if (metaType == QMetaType::fromType<QChar>() &&
str.
size() == 1)
1641 if (metaType == QMetaType::fromType<QDate>())
1644 if (metaType == QMetaType::fromType<QTime>())
1645 return d->toQDateTime().time();
1647 if (metaType == QMetaType::fromType<QString>())
1648 return d->toString();
1650 return d->toQDateTime();
1655 return d->asByteArray();
1659 :
symbol->descriptiveString();
1667#if QT_CONFIG(regularexpression)
1669 return re->toQRegularExpression();
1694 return ::toVariant(
value, typeHint, behavior,
nullptr);
1706 name =
it.nextPropertyNameAsString(
val);
1713 conversionBehvior, visitedObjects));
1724 if (!visitedObjects) {
1725 visitedObjects = &recursionGuardSet;
1726 }
else if (visitedObjects->contains(
o->d())) {
1734 visitedObjects->insert(
o->d());
1745 for (
int ii = 0; ii <
length; ++ii) {
1752 }
else if (
o->getPrototypeOf() ==
o->engine()->objectPrototype()->d()
1766 visitedObjects->remove(
o->d());
1784 this, metaType, metaSequence,
ptr,
1791 const int type = metaType.
id();
1795 case QMetaType::Void:
1797 case QMetaType::Nullptr:
1798 case QMetaType::VoidStar:
1800 case QMetaType::Bool:
1802 case QMetaType::Int:
1804 case QMetaType::UInt:
1806 case QMetaType::Long:
1807 return QV4::Encode((
double)*
reinterpret_cast<const long *
>(
ptr));
1808 case QMetaType::ULong:
1810 case QMetaType::LongLong:
1812 case QMetaType::ULongLong:
1814 case QMetaType::Double:
1816 case QMetaType::QString:
1818 case QMetaType::QByteArray:
1820 case QMetaType::Float:
1822 case QMetaType::Short:
1824 case QMetaType::UShort:
1825 return QV4::Encode((
int)*
reinterpret_cast<const unsigned short*
>(
ptr));
1826 case QMetaType::Char:
1828 case QMetaType::UChar:
1829 return QV4::Encode((
int)*
reinterpret_cast<const unsigned char*
>(
ptr));
1830 case QMetaType::SChar:
1831 return QV4::Encode((
int)*
reinterpret_cast<const signed char*
>(
ptr));
1832 case QMetaType::QChar:
1834 case QMetaType::Char16:
1836 case QMetaType::QDateTime:
1840 case QMetaType::QDate:
1842 *
reinterpret_cast<const QDate *
>(
ptr),
1844 case QMetaType::QTime:
1846 *
reinterpret_cast<const QTime *
>(
ptr),
1848#if QT_CONFIG(regularexpression)
1849 case QMetaType::QRegularExpression:
1852 case QMetaType::QObjectStar:
1854 case QMetaType::QStringList:
1855 return createSequence(QMetaSequence::fromContainer<QStringList>());
1856 case QMetaType::QVariantList:
1857 return createSequence(QMetaSequence::fromContainer<QVariantList>());
1858 case QMetaType::QVariantMap:
1860 case QMetaType::QJsonValue:
1862 case QMetaType::QJsonObject:
1864 case QMetaType::QJsonArray:
1866 case QMetaType::QPixmap:
1867 case QMetaType::QImage:
1879 if (metaType == QMetaType::fromType<QQmlListReference>()) {
1889 const auto *
p =
static_cast<const QQmlListProperty<QObject> *
>(
ptr);
1894 }
else if (metaType == QMetaType::fromType<QJSValue>()) {
1900 const QList<QObject *> &
list = *(
const QList<QObject *>*)
ptr;
1904 for (
int ii = 0; ii <
list.
size(); ++ii)
1906 a->setArrayLengthUnchecked(
list.
size());
1907 return a.asReturnedValue();
1913 }
else if (metaType == QMetaType::fromType<QJSPrimitiveValue>()) {
1915 switch (primitive->
type()) {
1917 return Encode(primitive->asBoolean());
1919 return Encode(primitive->asInteger());
1927 return Encode(primitive->asDouble());
1934 this,
ptr, vtmo, metaType,
1959 return a.asReturnedValue();
1981 visitedObjects.
insert(
o->d());
1996 for (QVariantMap::const_iterator
it = vmap.
constBegin(), cend = vmap.constEnd();
it != cend; ++
it) {
1998 key =
s->propertyKey();
2000 if (
key->isArrayIndex())
2001 o->arraySet(
key->asArrayIndex(),
v);
2003 o->insertMember(
s,
v);
2005 return o.asReturnedValue();
2014 if (
type == QMetaType::fromType<QVariant>()) {
2018 }
else if (
type == QMetaType::fromType<QUrl>()) {
2028 return s_maxJSStackSize;
2033 return s_maxGCStackSize;
2044 if (len64 < 0ll || len64 >
qint64(std::numeric_limits<int>::max())) {
2073 QQml::makeRefPointer<QV4::CompiledData::CompilationUnit>(
2074 cachedUnit->qmlData, cachedUnit->aotCompiledFunctions,
url.
fileName(),
2096 QList<QQmlJS::DiagnosticMessage> diagnostics;
2098 sourceCode, sourceTimeStamp, &diagnostics);
2104 qWarning() <<
url <<
':' <<
m.loc.startLine <<
':' <<
m.loc.startColumn
2105 <<
": warning: " <<
m.message;
2115 return m_compilationUnits.value(
url);
2119 QQmlRefPointer<CompiledData::CompilationUnit> &&unit)
2121 const QUrl url = unit->finalUrl();
2122 auto [
begin,
end] = std::as_const(m_compilationUnits).equal_range(
url);
2125 if ((*it)->baseCompilationUnit() == unit)
2129 auto executableUnit = m_compilationUnits.insert(
2130 url, ExecutableCompilationUnit::create(std::move(unit),
this));
2132 Q_ASSERT(!(*executableUnit)->runtimeStrings);
2133 return *executableUnit;
2138 auto executableUnit = ExecutableCompilationUnit::create(std::move(unit),
this);
2143 executableUnit->markObjects(ms);
2145 return *m_compilationUnits.insert(std::move(
url), std::move(executableUnit));
2150 for (
auto it = m_compilationUnits.begin();
it != m_compilationUnits.end();) {
2151 if ((*it)->count() == 1)
2152 it = m_compilationUnits.erase(
it);
2161 const auto nativeModule = nativeModules.find(
url);
2162 if (nativeModule != nativeModules.end())
2163 return Module {
nullptr, *nativeModule };
2165 const QUrl resolved = referrer
2168 auto existingModule = m_compilationUnits.find(resolved);
2169 if (existingModule == m_compilationUnits.end())
2170 return Module {
nullptr,
nullptr };
2171 return Module { *existingModule,
nullptr };
2176 const auto nativeModule = nativeModules.constFind(
url);
2177 if (nativeModule != nativeModules.cend())
2178 return Module {
nullptr, *nativeModule };
2180 const QUrl resolved = referrer
2183 auto existingModule = m_compilationUnits.constFind(resolved);
2184 if (existingModule != m_compilationUnits.cend())
2185 return Module { *existingModule,
nullptr };
2188 Q_ASSERT(!newModule || m_compilationUnits.contains(resolved, newModule));
2190 return Module { newModule,
nullptr };
2195 const auto existingModule = nativeModules.constFind(
url);
2196 if (existingModule != nativeModules.cend())
2200 *val =
module.asReturnedValue();
2201 nativeModules.insert(
url, val);
2215 return DiskCache::Enabled;
2217 ExecutionEngine::DiskCacheOptions
result = DiskCache::Disabled;
2218 const QList<QByteArray> options =
QByteArray(
v).split(
',');
2220 if (
option ==
"aot-bytecode")
2221 result |= DiskCache::AotByteCode;
2222 else if (
option ==
"aot-native")
2223 result |= DiskCache::AotNative;
2224 else if (
option ==
"aot")
2225 result |= DiskCache::Aot;
2226 else if (
option ==
"qmlc-read")
2227 result |= DiskCache::QmlcRead;
2228 else if (
option ==
"qmlc-write")
2229 result |= DiskCache::QmlcWrite;
2230 else if (
option ==
"qmlc")
2231 result |= DiskCache::Qmlc;
2233 qWarning() <<
"Ignoring unknown option to QML_DISK_CACHE:" <<
option;
2241 if (forceDiskCache())
2243 if (disableDiskCache() ||
debugger())
2256 void *dummyArgs[] = {
nullptr };
2257 QMetaType dummyTypes[] = { QMetaType::fromType<void>() };
2258 function->call(self, dummyArgs, dummyTypes, argc,
context);
2273 return function->call(jsSelf, argv, argc,
context);
2288#if QT_CONFIG(qml_locale)
2294#if QT_CONFIG(qml_xml_http_request)
2305 m_illegalNames.
insert(
id.toQString());
2322 scope, qtObjectWrapper->getPrototypeOf());
2324 qtNamespaceWrapper->setPrototypeOf(qtObjectProtoWrapper);
2325 qtObjectWrapper->setPrototypeOf(qtNamespaceWrapper);
2332 return m_illegalNames;
2351 bool instanceOfObject =
false;
2355 instanceOfObject =
true;
2358 p =
p->getPrototypeOf();
2360 if (!instanceOfObject)
2364 object->setInternalClass(frozen);
2368 if (!frozen->
nameMap.at(
i).isStringOrSymbol())
2370 o = *
object->propertyData(
i);
2390 std::vector<Heap::Object *> stack {
object->d() };
2399 const auto writableBegin = std::begin(writableMembers);
2400 const auto writableEnd = std::end(writableMembers);
2402 while (!stack.empty()) {
2403 object = stack.back();
2409 Scoped<InternalClass> locked(scope,
object->internalClass()->locked());
2414 const SharedInternalClassData<PropertyKey> nameMap = locked->d()->nameMap;
2418 if (!
key.isStringOrSymbol())
2421 stack.push_back(member->d());
2422 if (std::find(writableBegin, writableEnd,
key) == writableEnd) {
2426 locked = locked->changeMember(
key, attributes);
2431 object->setInternalClass(locked->d());
2439 m_startedTimers[timerName] = m_time.
elapsed();
2444 if (!m_startedTimers.
contains(timerName)) {
2445 *wasRunning =
false;
2449 qint64 startedAt = m_startedTimers.
take(timerName);
2450 return m_time.
elapsed() - startedAt;
2464 if (m_extensionData.size() <=
index)
2465 m_extensionData.resize(
index + 1);
2467 if (m_extensionData.at(
index))
2468 delete m_extensionData.at(
index);
2473template<
typename Source>
2477 if (!
QMetaType::view(metaType,
data, QMetaType::fromType<QSequentialIterable>(), &iterable))
2480 const QMetaType elementMetaType = iterable.valueMetaType();
2484 element =
QVariant(elementMetaType);
2496 switch (metaType.
id()) {
2497 case QMetaType::Bool:
2498 *
reinterpret_cast<bool*
>(
data) =
value.toBoolean();
2500 case QMetaType::Int:
2501 *
reinterpret_cast<int*
>(
data) =
value.toInt32();
2503 case QMetaType::UInt:
2506 case QMetaType::Long:
2507 *
reinterpret_cast<long*
>(
data) =
long(
value.toInteger());
2509 case QMetaType::ULong:
2512 case QMetaType::LongLong:
2515 case QMetaType::ULongLong:
2518 case QMetaType::Double:
2519 *
reinterpret_cast<double*
>(
data) =
value.toNumber();
2521 case QMetaType::QString:
2522 if (
value.isUndefined())
2524 else if (
value.isNull())
2529 case QMetaType::QByteArray:
2549 case QMetaType::Float:
2550 *
reinterpret_cast<float*
>(
data) =
value.toNumber();
2552 case QMetaType::Short:
2553 *
reinterpret_cast<short*
>(
data) =
short(
value.toInt32());
2555 case QMetaType::UShort:
2556 *
reinterpret_cast<unsigned short*
>(
data) =
value.toUInt16();
2558 case QMetaType::Char:
2559 *
reinterpret_cast<char*
>(
data) =
char(
value.toInt32());
2561 case QMetaType::UChar:
2562 *
reinterpret_cast<unsigned char*
>(
data) = (
unsigned char)(
value.toInt32());
2564 case QMetaType::SChar:
2565 *
reinterpret_cast<signed char*
>(
data) = (
signed char)(
value.toInt32());
2567 case QMetaType::QChar:
2575 case QMetaType::QDateTime:
2580 case QMetaType::QDate:
2585 case QMetaType::QTime:
2587 *
reinterpret_cast<QTime *
>(
data) =
d->toQDateTime().time();
2590 case QMetaType::QUrl:
2595 *
reinterpret_cast<QUrl *
>(
data) =
d->toQUrl();
2606#if QT_CONFIG(regularexpression)
2607 case QMetaType::QRegularExpression:
2613 case QMetaType::QObjectStar: {
2614 if (
value.isNull()) {
2624 case QMetaType::QStringList: {
2632 case QMetaType::QVariantList: {
2642 case QMetaType::QVariantMap: {
2654 }
else if (
value.isNull()) {
2656 }
else if (
value.isUndefined()) {
2658 }
else if (
value.isBoolean()) {
2660 }
else if (
value.isInteger()) {
2662 }
else if (
value.isDouble()) {
2666 case QMetaType::QJsonValue:
2669 case QMetaType::QJsonObject: {
2673 case QMetaType::QJsonArray: {
2686 *
reinterpret_cast<int *
>(
data) =
value.toInt32();
2691 if (metaType == QMetaType::fromType<QQmlListReference>()) {
2696 const auto wrapperPrivate =
wrapper->d();
2697 if (wrapperPrivate->propertyType() == metaType) {
2698 *
reinterpret_cast<QQmlListProperty<QObject> *
>(
data) = *wrapperPrivate->
property();
2704 const QMetaType valueType = vtw->type();
2705 if (valueType == metaType)
2706 return vtw->toGadget(
data);
2708 Heap::QQmlValueTypeWrapper *
d = vtw->d();
2709 if (
d->isReference())
2712 if (
void *gadgetPtr =
d->gadgetPtr()) {
2733 if (variantObject) {
2751 *
reinterpret_cast<const void **
>(
data) =
var.
data();
2758 bool canCast =
false;
2761 canCast = (metaType ==
v.metaType());
2767 canCast =
metaObject->cast(qobject) !=
nullptr;
2769 canCast = qobject->qt_metacast(pointedToTypeName);
2775 *
reinterpret_cast<const void **
>(
data)
2776 = *
reinterpret_cast<void *
const *
>(
var.
data());
2778 *
reinterpret_cast<const void **
>(
data) =
var.
data();
2789 }
else if (
value.isNull() && isPointer) {
2790 *
reinterpret_cast<void* *
>(
data) =
nullptr;
2792 }
else if (metaType == QMetaType::fromType<QJSValue>()) {
2795 }
else if (metaType == QMetaType::fromType<QJSPrimitiveValue>()) {
2798 }
else if (!isPointer) {
2805 if (
result.metaType() == metaType) {
2830 if (
QObject *instance = targetMetaObject->cast(qobject)) {
2840 const int start = targetTypeName.startsWith(
"const ") ? 6 : 0;
2842 if (
void *instance = qobject->qt_metacast(
className)) {
2852 if (!
value.isObject())
2861 if (
type == QMetaType::QObjectStar)
2870 return typeWrapper->object();
2886 return ®istrationData()->mutex;
2891 return registrationData()->extensionCount++;
2894#if QT_CONFIG(qml_network)
2897 return engine->qmlEngine()->networkAccessManager();
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
qint64 elapsed() const noexcept
Returns the number of milliseconds since this QElapsedTimer was last started.
void start() noexcept
\typealias QElapsedTimer::Duration Synonym for std::chrono::nanoseconds.
bool isValid() const noexcept
Returns false if the timer has never been started or invalidated by a call to invalidate().
QDateTime lastModified() const
Returns the date and time when the file was last modified.
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it.
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
T value(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
The QJSEngine class provides an environment for evaluating JavaScript code.
static void setObjectOwnership(QObject *, ObjectOwnership)
Sets the ownership of object.
The QJSPrimitiveValue class operates on primitive types in JavaScript semantics.
constexpr Type type() const
Returns the type of the QJSPrimitiveValue.
static QJSValue fromReturnedValue(QV4::ReturnedValue d)
static QV4::ExecutionEngine * engine(const QJSValue *jsval)
static QV4::ReturnedValue convertToReturnedValue(QV4::ExecutionEngine *e, const QJSValue &jsval)
static void setValue(QJSValue *jsval, const QV4::Value &v)
The QJSValue class acts as a container for Qt/JavaScript data types.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
QString arg(Args &&...args) const
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
The QNetworkAccessManager class allows the application to send network requests and receive replies.
static void registerExtension(QV4::ExecutionEngine *engine)
void init(QV4::ExecutionEngine *)
static QQmlEnginePrivate * get(QQmlEngine *e)
The QQmlEngine class provides an environment for instantiating QML components.
The QQmlError class encapsulates a QML error.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to \l{QFile}.
QQmlListProperty< QObject > property
The QQmlListReference class allows the manipulation of QQmlListProperty properties.
static void registerExtension(QV4::ExecutionEngine *engine)
static QUrl normalize(const QUrl &unNormalizedUrl)
bool isSequentialContainer() const
QMetaSequence listMetaSequence() const
static bool populateValueType(QMetaType targetMetaType, void *target, const QV4::Value &source)
static QVariant createValueType(const QJSValue &, QMetaType)
\inmodule QtCore \reentrant
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
The QSequentialIterable class is an iterable interface for a container in a QVariant.
const_iterator constBegin() const noexcept
iterator insert(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
qsizetype size() const noexcept
Returns the number of characters in this string.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static void yieldCurrentThread()
\inmodule QtCore \reentrant
QString fileName(ComponentFormattingOptions options=FullyDecoded) const
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
static QQmlRefPointer< QV4::CompiledData::CompilationUnit > compileModule(bool debugMode, const QString &url, const QString &sourceCode, const QDateTime &sourceTimeStamp, QList< QQmlJS::DiagnosticMessage > *diagnostics)
ManagedType::Data * allocManaged(std::size_t size, Heap::InternalClass *ic)
ObjectType::Data * allocate(Args &&... args)
PersistentValueStorage * m_persistentValues
ManagedType::Data * allocWithStringData(std::size_t unmanagedSize, Arg1 &&arg1)
ManagedType::Data * allocIC()
ObjectType::Data * allocObject(Heap::InternalClass *ic, Args &&... args)
void * data()
Returns a pointer to the contained object as a generic void* that can be written to.
bool convert(QMetaType type)
Casts the variant to the requested type, targetType.
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
QMetaType metaType() const
const void * constData() const
QMap< QString, QString > map
[6]
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Q_QML_EXPORT void registerStringLocaleCompare(QV4::ExecutionEngine *engine)
Combined button and popup list for selecting options.
Scoped< FunctionObject > ScopedFunctionObject
Scoped< String > ScopedString
StackProperties stackProperties()
@ Attr_ReadOnly_ButConfigurable
static const void * symbol()
#define Q_BASIC_ATOMIC_INITIALIZER(a)
Q_CORE_EXPORT char * qstrdup(const char *)
QMap< QString, QVariant > QVariantMap
DBusConnection const char DBusError * error
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
static AnchorData * createSequence(Graph< AnchorVertex, AnchorData > *graph, AnchorVertex *before, const QList< AnchorVertex * > &vertices, AnchorVertex *after)
QList< QVariant > QVariantList
static ControlElement< T > * ptr(QWidget *widget)
constexpr T qAbs(const T &t)
GLenum GLsizei GLsizei GLint * values
[15]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLenum GLenum * types
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLsizei const GLchar * message
GLenum GLenum GLsizei void GLsizei void * column
GLsizei const GLchar *const * string
[0]
static QString jsStack(QV4::ExecutionEngine *engine)
#define DEFINE_BOOL_CONFIG_OPTION(name, var)
T qmlGetConfigOption(const char *var)
void * qt_add_qmlxmlhttprequest(ExecutionEngine *v4)
void qt_rem_qmlxmlhttprequest(ExecutionEngine *, void *d)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static QList< QVariant > toList(char **buf, int count)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
#define QT_CONFIG(feature)
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
void qt_add_domexceptions(ExecutionEngine *e)
static char * v4StackTrace(const ExecutionContext *context)
static QObject * qtObjectFromJS(const QV4::Value &value)
static QVariant objectToVariant(const QV4::Object *o, V4ObjectSet *visitedObjects=nullptr, JSToQVariantConversionBehavior behavior=JSToQVariantConversionBehavior::Safish)
Q_QML_EXPORT char * qt_v4StackTraceForEngine(void *executionEngine)
static QV4::ReturnedValue variantMapToJS(QV4::ExecutionEngine *v4, const QVariantMap &vmap)
static void freeze_recursive(QV4::ExecutionEngine *v4, QV4::Object *object)
static QSequentialIterable jsvalueToSequence(const QJSValue &value)
ReturnType convertJSValueToVariantType(const QJSValue &value)
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, JSToQVariantConversionBehavior conversionBehavior, V4ObjectSet *visitedObjects)
JSToQVariantConversionBehavior
static QtMetaContainerPrivate::QMetaSequenceInterface emptySequenceInterface()
static QVariantMap objectToVariantMap(const QV4::Object *o, V4ObjectSet *visitedObjects, JSToQVariantConversionBehavior conversionBehvior)
static ExecutionEngine::DiskCacheOptions transFormDiskCache(const char *v)
static QtMetaContainerPrivate::QMetaSequenceInterface sequenceInterface()
Q_QML_EXPORT char * qt_v4StackTrace(void *executionContext)
static bool convertToNativeQObject(const QV4::Value &value, QMetaType targetType, void **result)
static QBasicAtomicInt engineSerial
QSet< QV4::Heap::Object * > V4ObjectSet
static QV4::ReturnedValue variantToJS(QV4::ExecutionEngine *v4, const QVariant &value)
bool convertToIterable(QMetaType metaType, void *data, Source *sequence)
ReturnedValue throwTypeError(const FunctionObject *b, const QV4::Value *, const QV4::Value *, int)
static int toInt(const QChar &qc, int R)
void qt_add_sqlexceptions(QV4::ExecutionEngine *engine)
const char className[16]
[1]
if(qFloatDistance(a, b)<(1<< 7))
[0]
QUrl url("example.com")
[constructor-url-reference]
obj metaObject() -> className()
QV4EngineRegistrationData()
static ReturnedValue method_get_species(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static QDate dateTimeToDate(const QDateTime &dateTime)
static constexpr ReturnedValue undefined()
static constexpr ReturnedValue null()
const void * cppStackLimit
IdentifierTable * identifierTable
@ Class_QmlContextWrapper
@ Class_MemberGeneratorFunction
@ Class_ErrorObjectWithMessage
@ Class_GeneratorFunction
@ Class_ConstructorFunction
@ Class_ProxyFunctionObject
@ Class_StrictArgumentsObject
Heap::InternalClass * internalClasses(InternalClassType icType)
Heap::InternalClass * classes[NClasses]
MemoryManager * memoryManager
const void * cppStackBase
CppStackFrame * currentStackFrame
static ReturnedValue method_get_stack(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
Heap::QmlContext * qmlContext() const
FunctionObject * promiseCtor() const
Heap::Object * newSetIteratorObject(Object *o)
static bool metaTypeFromJS(const Value &value, QMetaType type, void *data)
WTF::PageAllocation * gcStack
Object * typeErrorPrototype() const
ExecutionContext * rootContext() const
Symbol * symbol_iterator() const
ReturnedValue throwUnimplemented(const QString &message)
QQmlRefPointer< QQmlContextData > callingQmlContext() const
StackTrace exceptionStackTrace
WTF::PageAllocation * jsStack
QQmlRefPointer< ExecutableCompilationUnit > insertCompilationUnit(QQmlRefPointer< QV4::CompiledData::CompilationUnit > &&unit)
Object * iteratorPrototype() const
FunctionObject * objectCtor() const
FunctionObject * urlSearchParamsCtor() const
FunctionObject * regExpCtor() const
QV4::Debugging::Debugger * debugger() const
String * id_arguments() const
FunctionObject * booleanCtor() const
QQmlError catchExceptionAsQmlError()
String * id_callee() const
static QVariant toVariantLossy(const QV4::Value &value)
Heap::DateObject * newDateObject(double dateTime)
Object * urlPrototype() const
Heap::PromiseObject * newPromiseObject()
Object * dataViewPrototype() const
ReturnedValue throwRangeError(const Value &value)
Object * stringPrototype() const
FunctionObject * dateCtor() const
String * id_length() const
void setProfiler(Profiling::Profiler *)
Heap::Object * newURIErrorObject(const QString &message)
Object * arrayPrototype() const
String * id_constructor() const
FunctionObject * evalErrorCtor() const
Heap::Object * newNumberObject(double value)
Object * weakSetPrototype() const
ReturnedValue throwError(const Value &value)
ReturnedValue throwReferenceError(const Value &value)
Object * stringIteratorPrototype() const
void markObjects(MarkStack *markStack)
FunctionObject * typedArrayCtors
QV4::ReturnedValue fromVariant(const QVariant &)
void setQmlEngine(QQmlEngine *engine)
@ IntrinsicTypedArrayProto
@ IntrinsicTypedArray_Ctor
Object * variantPrototype() const
static QVariantMap variantMapFromJS(const QV4::Object *o)
Heap::Object * newSyntaxErrorObject(const QString &message, const QString &fileName, int line, int column)
Object * weakMapPrototype() const
Heap::Object * newSymbolObject(const Symbol *symbol)
String * id_toString() const
Heap::Object * newEvalErrorObject(const QString &message)
Object * mapIteratorPrototype() const
Heap::UrlSearchParamsObject * newUrlSearchParamsObject()
String * id_prototype() const
Object * numberPrototype() const
String * id_lastIndex() const
Heap::Object * newObject()
QV4::ReturnedValue global()
static int registerExtension()
int consoleCountHelper(const QString &file, quint16 line, quint16 column)
FunctionObject * urlCtor() const
QML_NEARLY_ALWAYS_INLINE Value * jsAlloca(int nValues)
String * id_caller() const
Heap::Object * newMapIteratorObject(Object *o)
FunctionObject * typeErrorCtor() const
QQmlRefPointer< ExecutableCompilationUnit > compilationUnitForUrl(const QUrl &url) const
String * id_toLocaleString() const
FunctionObject * referenceErrorCtor() const
Object * rangeErrorPrototype() const
ExecutableAllocator * executableAllocator
int safeForAllocLength(qint64 len64)
Object * setPrototype() const
Heap::UrlObject * newUrlObject()
QQmlRefPointer< ExecutableCompilationUnit > compileModule(const QUrl &url)
FunctionObject * arrayBufferCtor() const
Object * forInIteratorPrototype() const
Module moduleForUrl(const QUrl &_url, const ExecutableCompilationUnit *referrer=nullptr) const
Heap::String * newString(char16_t c)
Heap::String * newIdentifier(const QString &text)
void initQmlGlobalObject()
String * id_index() const
const QSet< QString > & illegalNames() const
Heap::Object * newBooleanObject(bool b)
static QMutex * registrationMutex()
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols=true)
Object * uRIErrorPrototype() const
Object * datePrototype() const
EvalFunction * evalFunction() const
FunctionObject * functionCtor() const
FunctionObject * syntaxErrorCtor() const
Promise::ReactionHandler * getPromiseReactionHandler()
ExecutionEngine(QJSEngine *jsEngine=nullptr)
WTF::BumpPointerAllocator * bumperPointerAllocator
String * id_input() const
ExecutableAllocator * regExpAllocator
Object * intrinsicTypedArrayPrototype() const
Object * objectPrototype() const
Symbol * symbol_hasInstance() const
FunctionObject * errorCtor() const
StackTrace stackTrace(int frameLimit=-1) const
ReturnedValue throwURIError(const Value &msg)
FunctionObject * symbolCtor() const
QV4::ReturnedValue metaTypeToJS(QMetaType type, const void *data)
QUrl resolvedUrl(const QString &file)
void setExtensionData(int, Deletable *)
Object * syntaxErrorPrototype() const
RegExpCache * regExpCache
Object * sharedArrayBufferPrototype() const
static QJSPrimitiveValue createPrimitive(const Value &v)
FunctionObject * mapCtor() const
Object * booleanPrototype() const
Object * setIteratorPrototype() const
Heap::Object * newReferenceErrorObject(const QString &message)
void setDebugger(Debugging::Debugger *)
@ Symbol_isConcatSpreadable
Object * symbolPrototype() const
Heap::InternalClass * newClass(Heap::InternalClass *other)
void freezeObject(const QV4::Value &value)
void startTimer(const QString &timerName)
Object * functionPrototype() const
FunctionObject * uRIErrorCtor() const
FunctionObject * generatorFunctionCtor() const
Object * urlSearchParamsPrototype() const
Heap::Object * newForInIteratorObject(Object *o)
Heap::Object * newRangeErrorObject(const QString &message)
FunctionObject * arrayCtor() const
Object * promisePrototype() const
FunctionObject * setCtor() const
qint64 stopTimer(const QString &timerName, bool *wasRunning)
Heap::ArrayObject * newArrayObject(int count=0)
Object * arrayIteratorPrototype() const
FunctionObject * thrower() const
Object * sequencePrototype() const
Heap::Object * newTypeErrorObject(const QString &message)
Object * arrayBufferPrototype() const
FunctionObject * intrinsicTypedArrayCtor() const
Heap::Object * newVariantObject(const QMetaType type, const void *data)
Heap::Object * newStringObject(const String *string)
FunctionObject * rangeErrorCtor() const
FunctionObject * dataViewCtor() const
Object * typedArrayPrototype
QV4::Value * registerNativeModule(const QUrl &url, const QV4::Value &module)
QV4::ReturnedValue fromData(QMetaType type, const void *ptr, Heap::Object *parent=nullptr, int property=-1, uint flags=0)
ReturnedValue throwSyntaxError(const QString &message)
QObject * qmlScopeObject() const
Object * propertyListPrototype() const
DiskCacheOptions diskCacheOptions() const
Object * evalErrorPrototype() const
String * id_valueOf() const
Heap::Object * newArrayIteratorObject(Object *o)
int maxJSStackSize() const
void trimCompilationUnits()
int maxGCStackSize() const
QQmlRefPointer< ExecutableCompilationUnit > executableCompilationUnit(QQmlRefPointer< QV4::CompiledData::CompilationUnit > &&unit)
Object * regExpPrototype() const
ReturnedValue catchException(StackTrace *trace=nullptr)
Heap::ArrayBuffer * newArrayBuffer(const QByteArray &array)
FunctionObject * weakSetCtor() const
FunctionObject * weakMapCtor() const
FunctionObject * stringCtor() const
Heap::RegExpObject * newRegExpObject(const QString &pattern, int flags)
ReturnedValue throwTypeError()
MultiplyWrappedQObjectMap * m_multiplyWrappedQObjects
FunctionObject * numberCtor() const
FunctionObject * sharedArrayBufferCtor() const
Heap::Object * newErrorObject(const Value &value)
Object * mapPrototype() const
Module loadModule(const QUrl &_url, const ExecutableCompilationUnit *referrer=nullptr)
Object * errorPrototype() const
Heap::InternalClass * newInternalClass(const VTable *vtable, Object *prototype)
QV4::Profiling::Profiler * profiler() const
ExecutionContext * currentContext() const
void callInContext(QV4::Function *function, QObject *self, QV4::ExecutionContext *ctxt, int argc, void **args, QMetaType *types)
Object * generatorPrototype() const
Object * referenceErrorPrototype() const
void lockObject(const QV4::Value &value)
static Heap::FunctionObject * createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, VTable::Call code, int argumentCount)
ReturnedValue name() const
ReturnedValue callAsConstructor(const Value *argv, int argc, const Value *newTarget=nullptr) const
static void init(Object *globalObject, QJSEngine::Extensions extensions)
static ReturnedValue method_unescape(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_parseInt(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_parseFloat(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_isNaN(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
isNaN [15.1.2.4]
static ReturnedValue method_isFinite(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
isFinite [15.1.2.5]
static ReturnedValue method_encodeURIComponent(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
encodeURIComponent [15.1.3.4]
static ReturnedValue method_decodeURI(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
decodeURI [15.1.3.1]
static ReturnedValue method_decodeURIComponent(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
decodeURIComponent [15.1.3.2]
static ReturnedValue method_encodeURI(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
encodeURI [15.1.3.3]
static ReturnedValue method_escape(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
ReturnedValue asReturnedValue() const
Pointer< InternalClass *, 0 > internalClass
void init(ExecutionEngine *engine)
static void addMember(QV4::Object *object, PropertyKey id, PropertyAttributes data, InternalClassEntry *entry)
SharedInternalClassData< PropertyKey > nameMap
Q_REQUIRED_RESULT InternalClass * changePrototype(Heap::Object *proto)
Q_REQUIRED_RESULT InternalClass * changeVTable(const VTable *vt)
void markObjects(MarkStack *markStack)
static ReturnedValue fromJsonValue(ExecutionEngine *engine, const QJsonValue &value)
static ReturnedValue fromJsonObject(ExecutionEngine *engine, const QJsonObject &object)
static QJsonArray toJsonArray(const QV4::Object *o)
static ReturnedValue fromJsonArray(ExecutionEngine *engine, const QJsonArray &array)
static QJsonObject toJsonObject(const QV4::Object *o)
static QJsonValue toJsonValue(const QV4::Value &value)
Heap::InternalClass * internalClass() const
ExecutionEngine * engine() const
void defineDefaultProperty(StringOrSymbol *name, const Value &value, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
const Value * propertyData(uint index) const
const VTable * vtable() const
void defineReadonlyProperty(const QString &name, const Value &value)
Heap::Object * getPrototypeOf() const
void insertMember(StringOrSymbol *s, const Value &v, PropertyAttributes attributes=Attr_Data)
static void free(Value *v)
void setConfigurable(bool b)
static void initializeBindings(ExecutionEngine *engine)
static ReturnedValue wrap(ExecutionEngine *engine, QObject *object)
static ReturnedValue wrapConst(ExecutionEngine *engine, QObject *object)
static ReturnedValue create(ExecutionEngine *engine, const void *data, const QMetaObject *metaObject, QMetaType type, Heap::Object *object, int property, Heap::ReferenceObject::Flags flags)
static V4_NEEDS_DESTROY ReturnedValue create(ExecutionEngine *engine, QObject *object, int propId, QMetaType propType)
static Heap::RegExp * create(ExecutionEngine *engine, const QString &pattern, uint flags=CompiledData::RegExp::RegExp_NoFlags)
static ReturnedValue newSequence(QV4::ExecutionEngine *engine, QMetaType type, QMetaSequence metaSequence, const void *data, Heap::Object *object, int propertyIndex, Heap::ReferenceObject::Flags flags)
static QVariant toVariant(const Sequence *object)
static ReturnedValue fromData(QV4::ExecutionEngine *engine, QMetaType type, QMetaSequence metaSequence, const void *data)
constexpr ReturnedValue asReturnedValue() const
PropertyKey propertyKey() const
static V4_NEEDS_DESTROY Heap::Symbol * create(ExecutionEngine *e, const QString &s)
static constexpr Value fromInt32(int i)
QML_NEARLY_ALWAYS_INLINE String * stringValue() const
static constexpr Value undefinedValue()
static Value fromDouble(double d)
QString toQStringNoThrow() const
static constexpr Value emptyValue()
static void markCustom(Engine *engine, F &&markFunction)
uchar data[MaxInternalSize]