4#include <private/qqmlscriptdata_p.h>
5#include <private/qqmlcontext_p.h>
6#include <private/qqmlengine_p.h>
7#include <private/qqmlscriptblob_p.h>
8#include <private/qv4engine_p.h>
9#include <private/qv4scopedvalue_p.h>
10#include <private/qv4object_p.h>
11#include <private/qv4qmlcontext_p.h>
12#include <private/qv4module_p.h>
16QQmlScriptData::QQmlScriptData()
24 Q_ASSERT(parentQmlContextData && parentQmlContextData->engine());
26 if (!m_precompiledScript || m_precompiledScript->
isESModule())
33 qmlContextData->setInternal(
true);
34 qmlContextData->setJSContext(
true);
36 qmlContextData->setPragmaLibraryContext(
true);
38 qmlContextData->setPragmaLibraryContext(parentQmlContextData->isPragmaLibraryContext());
39 qmlContextData->setBaseUrl(
url);
40 qmlContextData->setBaseUrlString(
urlString);
47 qmlContextData->setImports(parentQmlContextData->imports());
48 qmlContextData->setImportedScripts(parentQmlContextData->importedScripts());
52 qmlContextData->setEngine(parentQmlContextData->engine());
57 if (qmlContextData->importedScripts().isNullOrUndefined()) {
59 qmlContextData->setImportedScripts(
62 scriptsArray = qmlContextData->importedScripts().valueRef();
65 for (
int ii = 0; ii <
scripts.size(); ++ii) {
66 v =
scripts.at(ii)->scriptData()->scriptValueForContext(qmlContextData);
67 scriptsArray->put(ii,
v);
70 return qmlContextData;
77 return m_value.
value();
79 Q_ASSERT(parentQmlContextData && parentQmlContextData->engine());
84 if (
auto qmlContextData = qmlContextDataForContext(parentQmlContextData)) {
91 if (qmlExecutionContext) {
92 module->d()->scope->outer.set(v4, qmlExecutionContext->d());
93 qmlExecutionContext->d()->qml()->module.set(v4, module->d());
106 if (qmlExecutionContext)
107 value = qmlExecutionContext->d()->qml();
116 return value->asReturnedValue();
static QQmlRefPointer< QQmlContextData > createRefCounted(const QQmlRefPointer< QQmlContextData > &parent)
void warning(const QQmlError &)
static QQmlEnginePrivate * get(QQmlEngine *e)
The QQmlError class encapsulates a QML error.
QVector< QQmlRefPointer< QQmlScriptBlob > > scripts
QV4::ReturnedValue scriptValueForContext(const QQmlRefPointer< QQmlContextData > &parentCtxt)
QQmlRefPointer< QQmlTypeNameCache > typeNameCache
bool isSharedLibrary() const
Heap::Module * instantiate(ExecutionEngine *engine)
ReturnedValue value() const
void set(ExecutionEngine *engine, const Value &value)
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
ExecutionContext * rootContext() const
QQmlError catchExceptionAsQmlError()
Heap::ArrayObject * newArrayObject(int count=0)
static Heap::QmlContext * create(QV4::ExecutionContext *parent, QQmlRefPointer< QQmlContextData > context, QObject *scopeObject)