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));
821 numberObject->defineDefaultProperty(piString, parseIntFn);
822 numberObject->defineDefaultProperty(pfString, parseFloatFn);
838 t->setInternalClass(
t->internalClass()->cryopreserved());
849 m_delayedCallQueue.
init(
this);
855 for (
auto val : nativeModules) {
858 nativeModules.clear();
865 for (
const auto &cu : std::as_const(m_compilationUnits)) {
868 cu->engine =
nullptr;
870 m_compilationUnits.clear();
881#if QT_CONFIG(qml_xml_http_request)
883 m_xmlHttpRequestData =
nullptr;
887#if QT_CONFIG(qml_debug)
905 r->d_unchecked()->init(Heap::ExecutionContext::Type_GlobalContext);
923 return ic->changePrototype(prototype ? prototype->d() :
nullptr);
976 object->arrayReserve(
count);
977 object->setArrayLengthUnchecked(
count);
991 d->
type = Heap::ArrayData::Simple;
998 a->d()->arrayData.set(
this,
d);
999 a->setArrayLengthUnchecked(
length);
1067#if QT_CONFIG(regularexpression)
1083 urlObject->setUrl(
url);
1084 return urlObject->d();
1094 return ErrorObject::create<ErrorObject>(
this,
value,
errorCtor());
1099 return ErrorObject::create<ErrorObject>(
this,
message);
1104 return ErrorObject::create<SyntaxErrorObject>(
this,
message);
1115 return ErrorObject::create<ReferenceErrorObject>(
this,
message);
1126 return ErrorObject::create<TypeErrorObject>(
this,
message);
1131 return ErrorObject::create<RangeErrorObject>(
this,
message);
1141 if (!m_reactionHandler) {
1152 if (!m_reactionHandler) {
1158 executor->d()->capabilities.set(
this, capability->d());
1168 return m_reactionHandler.
data();
1173 return ErrorObject::create<URIErrorObject>(
this,
message);
1178 return ErrorObject::create<EvalErrorObject>(
this,
message);
1221 return ctx->qml()->scopeObject;
1230 return ctx->qml()->context;
1238 while (
f && frameLimit) {
1240 frame.source =
f->source();
1241 frame.function =
f->function();
1242 frame.line =
f->lineNumber();
1245 if (
f->isJSTypesFrame()) {
1253 f =
f->parentFrame();
1271 if (context && context->engine()) {
1272 const QVector<StackFrame> stackTrace = context->engine()->stackTrace(20);
1273 for (
int i = 0;
i < stackTrace.size(); ++
i) {
1276 const QUrl url(stackTrace.at(
i).source);
1278 str <<
"frame={level=\"" <<
i <<
"\",func=\"" << stackTrace.at(
i).function
1280 <<
"\",line=\"" <<
qAbs(stackTrace.at(
i).line) <<
"\",language=\"js\"}";
1301 if (!
src.isRelative())
1307 if (
f->v4Function) {
1308 base =
f->v4Function->finalUrl();
1311 f =
f->parentFrame();
1332 for (
const auto &compilationUnit : std::as_const(m_compilationUnits))
1333 compilationUnit->markObjects(markStack);
1355 debug->aboutToThrow();
1472 if (!
trace.isEmpty()) {
1506 return v->d()->data();
1508 if (metaType == QMetaType::fromType<bool>())
1511 if (metaType == QMetaType::fromType<double>())
1514 if (metaType == QMetaType::fromType<float>())
1517 if (metaType == QMetaType::fromType<QJsonValue>())
1520 if (metaType == QMetaType::fromType<QJSValue>())
1526 if (metaType == QMetaType::fromType<QJsonObject>()
1530 return QVariant::fromValue<QObject *>(
wrapper->object());
1534 return w->toVariant();
1536 return v->toVariant();
1538 return l->toVariant();
1548 QList<QObject *>
list;
1552 qobjectWrapper =
a->get(ii);
1553 if (!!qobjectWrapper) {
1554 list << qobjectWrapper->object();
1560 return QVariant::fromValue<QList<QObject*> >(
list);
1561 }
else if (metaType == QMetaType::fromType<QJsonArray>()) {
1570 retn =
QVariant(metaType,
nullptr);
1572 if (retnAsIterable.metaContainer().canAddValue()) {
1573 QMetaType valueMetaType = retnAsIterable.metaContainer().valueMetaType();
1574 auto const length =
a->getLength();
1577 arrayValue =
a->get(
i);
1579 arrayValue, valueMetaType);
1581 retnAsIterable.metaContainer().addValue(retn.data(), asVariant.
constData());
1591 if (asVariant.
convert(valueMetaType)) {
1592 retnAsIterable.metaContainer().addValue(retn.data(), asVariant.
constData());
1598 if (valueMetaType == QMetaType::fromType<QVariant>()) {
1599 retnAsIterable.metaContainer().addValue(retn.data(), &asVariant);
1601 auto originalType = asVariant.
metaType();
1602 bool couldConvert = asVariant.
convert(valueMetaType);
1603 if (!couldConvert && originalType.isValid()) {
1608 "at position %1 from %2 to %3")
1613 retnAsIterable.metaContainer().addValue(retn.data(), asVariant.
constData());
1621 if (
value.isUndefined())
1625 if (
value.isBoolean())
1626 return value.booleanValue();
1627 if (
value.isInteger())
1628 return value.integerValue();
1629 if (
value.isNumber())
1630 return value.asDouble();
1634 if (metaType == QMetaType::fromType<QChar>() &&
str.
size() == 1)
1642 if (metaType == QMetaType::fromType<QDate>())
1645 if (metaType == QMetaType::fromType<QTime>())
1646 return d->toQDateTime().time();
1648 if (metaType == QMetaType::fromType<QString>())
1649 return d->toString();
1651 return d->toQDateTime();
1656 return d->asByteArray();
1660 :
symbol->descriptiveString();
1668#if QT_CONFIG(regularexpression)
1670 return re->toQRegularExpression();
1695 return ::toVariant(
value, typeHint, behavior,
nullptr);
1707 name =
it.nextPropertyNameAsString(
val);
1714 conversionBehvior, visitedObjects));
1725 if (!visitedObjects) {
1726 visitedObjects = &recursionGuardSet;
1727 }
else if (visitedObjects->contains(
o->d())) {
1735 visitedObjects->insert(
o->d());
1746 for (
int ii = 0; ii <
length; ++ii) {
1753 }
else if (
o->getPrototypeOf() ==
o->engine()->objectPrototype()->d()
1767 visitedObjects->remove(
o->d());
1785 this, metaType, metaSequence,
ptr,
1792 const int type = metaType.
id();
1796 case QMetaType::Void:
1798 case QMetaType::Nullptr:
1799 case QMetaType::VoidStar:
1801 case QMetaType::Bool:
1803 case QMetaType::Int:
1805 case QMetaType::UInt:
1807 case QMetaType::Long:
1808 return QV4::Encode((
double)*
reinterpret_cast<const long *
>(
ptr));
1809 case QMetaType::ULong:
1811 case QMetaType::LongLong:
1813 case QMetaType::ULongLong:
1815 case QMetaType::Double:
1817 case QMetaType::QString:
1819 case QMetaType::QByteArray:
1821 case QMetaType::Float:
1823 case QMetaType::Short:
1825 case QMetaType::UShort:
1826 return QV4::Encode((
int)*
reinterpret_cast<const unsigned short*
>(
ptr));
1827 case QMetaType::Char:
1829 case QMetaType::UChar:
1830 return QV4::Encode((
int)*
reinterpret_cast<const unsigned char*
>(
ptr));
1831 case QMetaType::SChar:
1832 return QV4::Encode((
int)*
reinterpret_cast<const signed char*
>(
ptr));
1833 case QMetaType::QChar:
1835 case QMetaType::Char16:
1837 case QMetaType::QDateTime:
1841 case QMetaType::QDate:
1843 *
reinterpret_cast<const QDate *
>(
ptr),
1845 case QMetaType::QTime:
1847 *
reinterpret_cast<const QTime *
>(
ptr),
1849#if QT_CONFIG(regularexpression)
1850 case QMetaType::QRegularExpression:
1853 case QMetaType::QObjectStar:
1855 case QMetaType::QStringList:
1856 return createSequence(QMetaSequence::fromContainer<QStringList>());
1857 case QMetaType::QVariantList:
1858 return createSequence(QMetaSequence::fromContainer<QVariantList>());
1859 case QMetaType::QVariantMap:
1861 case QMetaType::QJsonValue:
1863 case QMetaType::QJsonObject:
1865 case QMetaType::QJsonArray:
1867 case QMetaType::QPixmap:
1868 case QMetaType::QImage:
1880 if (metaType == QMetaType::fromType<QQmlListReference>()) {
1890 const auto *
p =
static_cast<const QQmlListProperty<QObject> *
>(
ptr);
1895 }
else if (metaType == QMetaType::fromType<QJSValue>()) {
1901 const QList<QObject *> &
list = *(
const QList<QObject *>*)
ptr;
1905 for (
int ii = 0; ii <
list.
size(); ++ii)
1907 a->setArrayLengthUnchecked(
list.
size());
1908 return a.asReturnedValue();
1914 }
else if (metaType == QMetaType::fromType<QJSPrimitiveValue>()) {
1916 switch (primitive->
type()) {
1918 return Encode(primitive->asBoolean());
1920 return Encode(primitive->asInteger());
1928 return Encode(primitive->asDouble());
1935 this,
ptr, vtmo, metaType,
1960 return a.asReturnedValue();
1982 visitedObjects.
insert(
o->d());
1997 for (QVariantMap::const_iterator
it = vmap.
constBegin(), cend = vmap.constEnd();
it != cend; ++
it) {
1999 key =
s->propertyKey();
2001 if (
key->isArrayIndex())
2002 o->arraySet(
key->asArrayIndex(),
v);
2004 o->insertMember(
s,
v);
2006 return o.asReturnedValue();
2015 if (
type == QMetaType::fromType<QVariant>()) {
2019 }
else if (
type == QMetaType::fromType<QUrl>()) {
2029 return s_maxJSStackSize;
2034 return s_maxGCStackSize;
2045 if (len64 < 0ll || len64 >
qint64(std::numeric_limits<int>::max())) {
2074 QQml::makeRefPointer<QV4::CompiledData::CompilationUnit>(
2075 cachedUnit->qmlData, cachedUnit->aotCompiledFunctions,
url.
fileName(),
2097 QList<QQmlJS::DiagnosticMessage> diagnostics;
2099 sourceCode, sourceTimeStamp, &diagnostics);
2105 qWarning() <<
url <<
':' <<
m.loc.startLine <<
':' <<
m.loc.startColumn
2106 <<
": warning: " <<
m.message;
2116 return m_compilationUnits.value(
url);
2120 QQmlRefPointer<CompiledData::CompilationUnit> &&unit)
2122 const QUrl url = unit->finalUrl();
2123 auto [
begin,
end] = std::as_const(m_compilationUnits).equal_range(
url);
2126 if ((*it)->baseCompilationUnit() == unit)
2130 auto executableUnit = m_compilationUnits.insert(
2131 url, ExecutableCompilationUnit::create(std::move(unit),
this));
2133 Q_ASSERT(!(*executableUnit)->runtimeStrings);
2134 return *executableUnit;
2139 auto executableUnit = ExecutableCompilationUnit::create(std::move(unit),
this);
2144 executableUnit->markObjects(ms);
2146 return *m_compilationUnits.insert(std::move(
url), std::move(executableUnit));
2151 for (
auto it = m_compilationUnits.begin();
it != m_compilationUnits.end();) {
2152 if ((*it)->count() == 1)
2153 it = m_compilationUnits.erase(
it);
2162 const auto nativeModule = nativeModules.find(
url);
2163 if (nativeModule != nativeModules.end())
2164 return Module {
nullptr, *nativeModule };
2166 const QUrl resolved = referrer
2169 auto existingModule = m_compilationUnits.find(resolved);
2170 if (existingModule == m_compilationUnits.end())
2171 return Module {
nullptr,
nullptr };
2172 return Module { *existingModule,
nullptr };
2177 const auto nativeModule = nativeModules.constFind(
url);
2178 if (nativeModule != nativeModules.cend())
2179 return Module {
nullptr, *nativeModule };
2181 const QUrl resolved = referrer
2184 auto existingModule = m_compilationUnits.constFind(resolved);
2185 if (existingModule != m_compilationUnits.cend())
2186 return Module { *existingModule,
nullptr };
2189 Q_ASSERT(!newModule || m_compilationUnits.contains(resolved, newModule));
2191 return Module { newModule,
nullptr };
2196 const auto existingModule = nativeModules.constFind(
url);
2197 if (existingModule != nativeModules.cend())
2201 *val =
module.asReturnedValue();
2202 nativeModules.insert(
url, val);
2216 return DiskCache::Enabled;
2218 ExecutionEngine::DiskCacheOptions
result = DiskCache::Disabled;
2219 const QList<QByteArray> options =
QByteArray(
v).split(
',');
2221 if (
option ==
"aot-bytecode")
2222 result |= DiskCache::AotByteCode;
2223 else if (
option ==
"aot-native")
2224 result |= DiskCache::AotNative;
2225 else if (
option ==
"aot")
2226 result |= DiskCache::Aot;
2227 else if (
option ==
"qmlc-read")
2228 result |= DiskCache::QmlcRead;
2229 else if (
option ==
"qmlc-write")
2230 result |= DiskCache::QmlcWrite;
2231 else if (
option ==
"qmlc")
2232 result |= DiskCache::Qmlc;
2234 qWarning() <<
"Ignoring unknown option to QML_DISK_CACHE:" <<
option;
2242 if (forceDiskCache())
2244 if (disableDiskCache() ||
debugger())
2257 void *dummyArgs[] = {
nullptr };
2258 QMetaType dummyTypes[] = { QMetaType::fromType<void>() };
2259 function->call(self, dummyArgs, dummyTypes, argc, context);
2264 function->call(self,
args,
types, argc, context);
2274 return function->call(jsSelf, argv, argc, context);
2289#if QT_CONFIG(qml_locale)
2295#if QT_CONFIG(qml_xml_http_request)
2306 m_illegalNames.
insert(
id.toQString());
2323 scope, qtObjectWrapper->getPrototypeOf());
2325 qtNamespaceWrapper->setPrototypeOf(qtObjectProtoWrapper);
2326 qtObjectWrapper->setPrototypeOf(qtNamespaceWrapper);
2333 return m_illegalNames;
2352 bool instanceOfObject =
false;
2356 instanceOfObject =
true;
2359 p =
p->getPrototypeOf();
2361 if (!instanceOfObject)
2365 object->setInternalClass(frozen);
2369 if (!frozen->
nameMap.at(
i).isStringOrSymbol())
2371 o = *
object->propertyData(
i);
2391 std::vector<Heap::Object *> stack {
object->d() };
2400 const auto writableBegin = std::begin(writableMembers);
2401 const auto writableEnd = std::end(writableMembers);
2403 while (!stack.empty()) {
2404 object = stack.back();
2410 Scoped<InternalClass> locked(scope,
object->internalClass()->locked());
2415 const SharedInternalClassData<PropertyKey> nameMap = locked->d()->nameMap;
2419 if (!
key.isStringOrSymbol())
2422 stack.push_back(member->d());
2423 if (std::find(writableBegin, writableEnd,
key) == writableEnd) {
2427 locked = locked->changeMember(
key, attributes);
2432 object->setInternalClass(locked->d());
2440 m_startedTimers[timerName] = m_time.
elapsed();
2445 if (!m_startedTimers.
contains(timerName)) {
2446 *wasRunning =
false;
2450 qint64 startedAt = m_startedTimers.
take(timerName);
2451 return m_time.
elapsed() - startedAt;
2465 if (m_extensionData.size() <=
index)
2466 m_extensionData.resize(
index + 1);
2468 if (m_extensionData.at(
index))
2469 delete m_extensionData.at(
index);
2474template<
typename Source>
2478 if (!
QMetaType::view(metaType,
data, QMetaType::fromType<QSequentialIterable>(), &iterable))
2481 const QMetaType elementMetaType = iterable.valueMetaType();
2501 switch (metaType.
id()) {
2502 case QMetaType::Bool:
2503 *
reinterpret_cast<bool*
>(
data) =
value.toBoolean();
2505 case QMetaType::Int:
2506 *
reinterpret_cast<int*
>(
data) =
value.toInt32();
2508 case QMetaType::UInt:
2511 case QMetaType::Long:
2512 *
reinterpret_cast<long*
>(
data) =
long(
value.toInteger());
2514 case QMetaType::ULong:
2517 case QMetaType::LongLong:
2520 case QMetaType::ULongLong:
2523 case QMetaType::Double:
2524 *
reinterpret_cast<double*
>(
data) =
value.toNumber();
2526 case QMetaType::QString:
2527 if (
value.isUndefined())
2529 else if (
value.isNull())
2534 case QMetaType::QByteArray:
2554 case QMetaType::Float:
2555 *
reinterpret_cast<float*
>(
data) =
value.toNumber();
2557 case QMetaType::Short:
2558 *
reinterpret_cast<short*
>(
data) =
short(
value.toInt32());
2560 case QMetaType::UShort:
2561 *
reinterpret_cast<unsigned short*
>(
data) =
value.toUInt16();
2563 case QMetaType::Char:
2564 *
reinterpret_cast<char*
>(
data) =
char(
value.toInt32());
2566 case QMetaType::UChar:
2567 *
reinterpret_cast<unsigned char*
>(
data) = (
unsigned char)(
value.toInt32());
2569 case QMetaType::SChar:
2570 *
reinterpret_cast<signed char*
>(
data) = (
signed char)(
value.toInt32());
2572 case QMetaType::QChar:
2580 case QMetaType::QDateTime:
2585 case QMetaType::QDate:
2590 case QMetaType::QTime:
2592 *
reinterpret_cast<QTime *
>(
data) =
d->toQDateTime().time();
2595 case QMetaType::QUrl:
2600 *
reinterpret_cast<QUrl *
>(
data) =
d->toQUrl();
2611#if QT_CONFIG(regularexpression)
2612 case QMetaType::QRegularExpression:
2618 case QMetaType::QObjectStar: {
2619 if (
value.isNull()) {
2629 case QMetaType::QStringList: {
2637 case QMetaType::QVariantList: {
2647 case QMetaType::QVariantMap: {
2659 }
else if (
value.isNull()) {
2661 }
else if (
value.isUndefined()) {
2663 }
else if (
value.isBoolean()) {
2665 }
else if (
value.isInteger()) {
2667 }
else if (
value.isDouble()) {
2671 case QMetaType::QJsonValue:
2674 case QMetaType::QJsonObject: {
2678 case QMetaType::QJsonArray: {
2691 *
reinterpret_cast<int *
>(
data) =
value.toInt32();
2696 if (metaType == QMetaType::fromType<QQmlListReference>()) {
2701 const auto wrapperPrivate =
wrapper->d();
2702 if (wrapperPrivate->propertyType() == metaType) {
2703 *
reinterpret_cast<QQmlListProperty<QObject> *
>(
data) = *wrapperPrivate->
property();
2709 const QMetaType valueType = vtw->type();
2710 if (valueType == metaType)
2711 return vtw->toGadget(
data);
2713 Heap::QQmlValueTypeWrapper *
d = vtw->d();
2714 if (
d->isReference())
2717 if (
void *gadgetPtr =
d->gadgetPtr()) {
2738 if (variantObject) {
2756 *
reinterpret_cast<const void **
>(
data) =
var.
data();
2763 bool canCast =
false;
2766 canCast = (metaType ==
v.metaType());
2772 canCast =
metaObject->cast(qobject) !=
nullptr;
2774 canCast = qobject->qt_metacast(pointedToTypeName);
2780 *
reinterpret_cast<const void **
>(
data)
2781 = *
reinterpret_cast<void *
const *
>(
var.
data());
2783 *
reinterpret_cast<const void **
>(
data) =
var.
data();
2794 }
else if (
value.isNull() && isPointer) {
2795 *
reinterpret_cast<void* *
>(
data) =
nullptr;
2797 }
else if (metaType == QMetaType::fromType<QJSValue>()) {
2800 }
else if (metaType == QMetaType::fromType<QJSPrimitiveValue>()) {
2803 }
else if (!isPointer) {
2810 if (
result.metaType() == metaType) {
2835 if (
QObject *instance = targetMetaObject->cast(qobject)) {
2845 const int start = targetTypeName.startsWith(
"const ") ? 6 : 0;
2847 if (
void *instance = qobject->qt_metacast(
className)) {
2857 if (!
value.isObject())
2866 if (
type == QMetaType::QObjectStar)
2875 return typeWrapper->object();
2891 return ®istrationData()->mutex;
2896 return registrationData()->extensionCount++;
2899#if QT_CONFIG(qml_network)
2902 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
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(const 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()
static void registerStringLocaleCompare(QV4::ExecutionEngine *engine)
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]