8#include <private/qv4script_p.h>
9#include <private/qv4string_p.h>
10#include <private/qv4objectiterator_p.h>
11#include <private/qv4identifierhash_p.h>
12#include <private/qv4runtime_p.h>
13#include <private/qv4identifiertable_p.h>
15#include <private/qqmlcontext_p.h>
16#include <private/qqmlengine_p.h>
18#include <QtCore/qjsonarray.h>
19#include <QtCore/qjsonobject.h>
37 return f ?
f->context()->d() :
nullptr;
42 for (; scope > 0 &&
ctx; --scope)
50 QVector<QV4::Heap::ExecutionContext::ContextType>
types;
55 types.append(QV4::Heap::ExecutionContext::ContextType(
it->type));
63 case QV4::Heap::ExecutionContext::Type_GlobalContext:
65 case QV4::Heap::ExecutionContext::Type_WithContext:
67 case QV4::Heap::ExecutionContext::Type_CallContext:
69 case QV4::Heap::ExecutionContext::Type_QmlContext:
71 case QV4::Heap::ExecutionContext::Type_BlockContext:
93 dict.insert(
QStringLiteral(
"type"), typeString->toQStringNoThrow());
96 switch (
value->type()) {
98 Q_ASSERT(!
"empty Value encountered");
107 dict.insert(valueKey,
value->booleanValue());
111 dict.insert(valueKey,
s->toQString());
115 dict.insert(valueKey,
qint64(
a->getLength()));
118 int numProperties = 0;
124 if (!
name->isValid())
128 dict.
insert(valueKey, numProperties);
135 dict.insert(valueKey,
value->integerValue());
138 const double val =
value->doubleValue();
140 dict.insert(valueKey,
val);
162 dict.insert(
QStringLiteral(
"properties"), collectProperties(
object));
183 if (ctxt->d()->type == QV4::Heap::ExecutionContext::Type_CallContext ||
184 ctxt->d()->type == QV4::Heap::ExecutionContext::Type_BlockContext) {
193 names.append(propName->toQString());
194 v = ctxt->getProperty(propName);
200 for (
int i = 0, ei = collectedRefs.size();
i != ei; ++
i) {
202 scopeObject->
put(propName, (
v = getValue(collectedRefs.at(
i))));
225 if (stackFrame.column >= 0)
233 if (cCtxt->d()->activation)
236 ctxt = ctxt->d()->outer;
245 QVector<QV4::Heap::ExecutionContext::ContextType> scopeTypes =
getScopeTypes(frameNr);
246 for (
int i = 0, ei = scopeTypes.size();
i != ei; ++
i) {
254 scopes.push_back(scope);
269 class ExceptionStateSaver
276 : hasExceptionLoc(&
engine->hasException)
277 , hadException(
false)
278 { std::swap(*hasExceptionLoc, hadException); }
280 ~ExceptionStateSaver()
281 { std::swap(*hasExceptionLoc, hadException); }
285 ExceptionStateSaver resetExceptionState(
engine());
322 if (m_engine && m_capture) {
346 name =
it.nextPropertyNameAsString(&
v);
362 if (
value->isManaged() && !
value->isString()) {
CapturePreventer(QV4::ExecutionEngine *engine)
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
iterator insert(const QString &key, const QJsonValue &value)
Inserts a new item with the key key and a value of value.
QQmlPropertyCapture * propertyCapture
static QQmlEnginePrivate * get(QQmlEngine *e)
The QQmlEngine class provides an environment for instantiating QML components.
iterator insert(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & append(QChar c)
bool collectScope(QJsonObject *dict, int frameNr, int scopeNr)
bool isValidRef(Ref ref) const
Ref addValueRef(const QV4::ScopedValue &value)
static QV4::Heap::ExecutionContext * findScope(QV4::Heap::ExecutionContext *ctxt, int scope)
static int encodeScopeType(QV4::Heap::ExecutionContext::ContextType scopeType)
QJsonObject lookupRef(Ref ref)
QV4::CppStackFrame * findFrame(int frame)
QV4DataCollector(QV4::ExecutionEngine *engine)
QV4::ExecutionEngine * engine() const
QVector< QV4::Heap::ExecutionContext::ContextType > getScopeTypes(int frame)
QV4::Heap::ExecutionContext * findContext(int frame)
QJsonObject buildFrame(const QV4::StackFrame &stackFrame, int frameNr)
ReturnedValue value() const
void set(ExecutionEngine *engine, const Value &value)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
Scoped< String > ScopedString
Scoped< ExecutionContext > ScopedContext
static struct AttrInfo attrs[]
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qIsFinite(qfloat16 f) noexcept
bool qIsNaN(qfloat16 f) noexcept
constexpr T qAbs(const T &t)
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLsizei GLenum GLenum * types
QLatin1StringView QLatin1String
#define QStringLiteral(str)
QJsonObject toRef(QV4DataCollector::Ref ref)
const QV4::Object * collectProperty(const QV4::ScopedValue &value, QV4::ExecutionEngine *engine, QJsonObject &dict)
ExecutionContext * context() const
CppStackFrame * currentStackFrame
Heap::String * newString(char16_t c)
Heap::ArrayObject * newArrayObject(int count=0)
Q_QML_EXPORT ReturnedValue keyAt(uint index) const
bool put(StringOrSymbol *name, const Value &v, Value *receiver=nullptr)
static ReturnedValue call(ExecutionEngine *, const Value &)