Commit d410ad36 authored by Simon Hausmann's avatar Simon Hausmann Committed by Qt by Nokia

Merge the QJSEngine and QJSValue development branch into master.

This replaces the dependency to QtScript with two new builtin classes
QJSValue and QJSEngine.

This is still work in progress, development continues now in the master branch.

Change-Id: I7f5487feb45c972f25a22b10cc81b9218b9805de
Reviewed-on: http://codereview.qt.nokia.com/2299Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarSimon Hausmann <simon.hausmann@nokia.com>
parent 43b783d0
......@@ -11,7 +11,7 @@ QT.declarative.sources = $$QT_MODULE_BASE/src/declarative
QT.declarative.libs = $$QT_MODULE_LIB_BASE
QT.declarative.plugins = $$QT_MODULE_PLUGIN_BASE
QT.declarative.imports = $$QT_MODULE_IMPORT_BASE
QT.declarative.depends = gui script network opengl xmlpatterns
QT.declarative.depends = gui network opengl xmlpatterns
QT.declarative.DEFINES = QT_DECLARATIVE_LIB
QT_CONFIG += declarative
Subproject commit bec11b8b7f89d135e7d9a823ac4fe98c70d017cf
Subproject commit 472c04c9e7a64e8734c76d2cf97a7cc5b773b788
......@@ -39,12 +39,10 @@
**
****************************************************************************/
#include <QtScript/QScriptEngine>
#include "private/qdeclarativedebughelper_p.h"
#include <QtCore/QAbstractAnimation>
#include <QtScript/QScriptEngine>
#include <QtDeclarative/QJSEngine>
#include <private/qdeclarativeengine_p.h>
#include <private/qabstractanimation_p.h>
......
......@@ -53,11 +53,11 @@
// We mean it.
//
#include <QtScript/qscriptengineagent.h>
#include <QtCore/qset.h>
#include <QtDeclarative/qjsengine.h>
QT_BEGIN_NAMESPACE
class QScriptValue;
class QJSValue;
class QDeclarativeEngine;
QT_END_NAMESPACE
......@@ -136,16 +136,17 @@ inline uint qHash(const JSAgentBreakpointData &b)
}
class QJSDebuggerAgent : public QObject, public QScriptEngineAgent
class QJSDebuggerAgent : public QObject
{
Q_OBJECT
public:
QJSDebuggerAgent(QScriptEngine *engine, QObject *parent = 0);
QJSDebuggerAgent(QJSEngine *engine, QObject *parent = 0);
QJSDebuggerAgent(QDeclarativeEngine *engine, QObject *parent = 0);
~QJSDebuggerAgent();
bool isInitialized() const;
QJSEngine * engine() {return 0; }
void setBreakpoints(const JSAgentBreakpoints &);
void setWatchExpressions(const QStringList &);
......@@ -175,20 +176,16 @@ public:
void functionEntry(qint64 scriptId);
void functionExit(qint64 scriptId,
const QScriptValue &returnValue);
const QJSValue &returnValue);
void positionChange(qint64 scriptId,
int lineNumber, int columnNumber);
void exceptionThrow(qint64 scriptId,
const QScriptValue &exception,
const QJSValue &exception,
bool hasHandler);
void exceptionCatch(qint64 scriptId,
const QScriptValue &exception);
bool supportsExtension(Extension extension) const;
QVariant extension(Extension extension,
const QVariant &argument = QVariant());
const QJSValue &exception);
Q_SIGNALS:
void stopped(bool becauseOfException,
......
......@@ -6,7 +6,7 @@ QPRO_PWD = $$PWD
CONFIG += module
MODULE_PRI += ../../modules/qt_declarative.pri
QT = core-private gui-private script-private network script opengl-private
QT = core-private gui-private network opengl-private
contains(QT_CONFIG, svg): QT += svg
DEFINES += QT_BUILD_DECLARATIVE_LIB QT_NO_URL_CAST_FROM_STRING
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000
......
......@@ -3361,7 +3361,7 @@ void QSGContext2D::release()
}
}
void QSGContext2D::processCommands(const QScriptValue& commands)
void QSGContext2D::processCommands(const QJSValue& commands)
{
#ifdef QSGCANVASITEM_DEBUG
QElapsedTimer t;
......@@ -3369,7 +3369,7 @@ void QSGContext2D::processCommands(const QScriptValue& commands)
#endif
int ii = 0;
if (commands.isArray()) {
QScriptValue cmd = commands.property(ii);
QJSValue cmd = commands.property(ii);
while(cmd.isValid()) {
processCommand(cmd);
ii++;
......@@ -3460,7 +3460,7 @@ bool QSGContext2D::event(QEvent *e)
return QObject::event(e);
}
void QSGContext2D::processCommand(const QScriptValue& cmd)
void QSGContext2D::processCommand(const QJSValue& cmd)
{
int action = cmd.property(0).toInt32();
switch (action) {
......
......@@ -55,7 +55,7 @@
#include <QtCore/qmetatype.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qvariant.h>
#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qjsvalue.h>
#include <private/qv8engine_p.h>
#include <QMutex>
#include <QWaitCondition>
......@@ -323,7 +323,7 @@ public slots:
void paint(QPainter* painter);
void sync();
void processCommands(const QScriptValue& commands);
void processCommands(const QJSValue& commands);
signals:
void changed();
void painted();
......@@ -385,7 +385,7 @@ protected:
virtual bool event(QEvent *);
private:
void processCommand(const QScriptValue& command);
void processCommand(const QJSValue& command);
Q_DECLARE_PRIVATE(QSGContext2D)
};
......
......@@ -42,7 +42,7 @@
#include "qsgitem.h"
#include "qsgcanvas.h"
#include <QtScript/qscriptengine.h>
#include <QtDeclarative/qjsengine.h>
#include "qsgcanvas_p.h"
#include "qsgevent.h"
......
......@@ -395,8 +395,8 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
class QDeclarativeContext;
class QDeclarativeEngine;
class QScriptValue;
class QScriptEngine;
class QJSValue;
class QJSEngine;
Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *);
Q_DECLARATIVE_EXPORT QDeclarativeContext *qmlContext(const QObject *);
Q_DECLARATIVE_EXPORT QDeclarativeEngine *qmlEngine(const QObject *);
......@@ -454,7 +454,7 @@ Q_DECLARATIVE_EXPORT void qmlRegisterBaseTypes(const char *uri, int versionMajor
\endqml
*/
inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor,
QScriptValue (*callback)(QDeclarativeEngine *, QScriptEngine *))
QJSValue (*callback)(QDeclarativeEngine *, QJSEngine *))
{
QDeclarativePrivate::RegisterModuleApi api = {
0,
......@@ -537,7 +537,7 @@ inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMi
\endqml
*/
inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor,
QObject *(*callback)(QDeclarativeEngine *, QScriptEngine *))
QObject *(*callback)(QDeclarativeEngine *, QJSEngine *))
{
QDeclarativePrivate::RegisterModuleApi api = {
0,
......
......@@ -367,7 +367,7 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags)
bool isUndefined = false;
v8::HandleScope handle_scope;
v8::Context::Scope scope(ep->v8engine.context());
v8::Context::Scope scope(ep->v8engine()->context());
v8::Local<v8::Value> result = d->v8value(0, &isUndefined);
bool needsErrorData = false;
......
......@@ -126,7 +126,6 @@ QDeclarativeCompiledData::~QDeclarativeCompiledData()
if (rootPropertyCache)
rootPropertyCache->release();
qDeleteAll(cachedPrograms);
qDeleteAll(cachedClosures);
for (int ii = 0; ii < v8bindings.count(); ++ii)
......@@ -135,12 +134,9 @@ QDeclarativeCompiledData::~QDeclarativeCompiledData()
void QDeclarativeCompiledData::clear()
{
qDeleteAll(cachedPrograms);
qDeleteAll(cachedClosures);
for (int ii = 0; ii < cachedClosures.count(); ++ii)
cachedClosures[ii] = 0;
for (int ii = 0; ii < cachedPrograms.count(); ++ii)
cachedPrograms[ii] = 0;
}
const QMetaObject *QDeclarativeCompiledData::TypeReference::metaObject() const
......
......@@ -2371,7 +2371,7 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
if (propName.at(0).isUpper())
COMPILE_EXCEPTION(&prop, tr("Property names cannot begin with an upper case letter"));
if (enginePrivate->v8engine.illegalNames().contains(propName))
if (enginePrivate->v8engine()->illegalNames().contains(propName))
COMPILE_EXCEPTION(&prop, tr("Illegal property name"));
propNames.insert(prop.name);
......@@ -2384,7 +2384,7 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
QString nameStr = QString::fromUtf8(name);
if (nameStr.at(0).isUpper())
COMPILE_EXCEPTION(obj, tr("Signal names cannot begin with an upper case letter"));
if (enginePrivate->v8engine.illegalNames().contains(nameStr))
if (enginePrivate->v8engine()->illegalNames().contains(nameStr))
COMPILE_EXCEPTION(obj, tr("Illegal signal name"));
methodNames.insert(name);
}
......@@ -2395,7 +2395,7 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
QString nameStr = QString::fromUtf8(name);
if (nameStr.at(0).isUpper())
COMPILE_EXCEPTION(obj, tr("Method names cannot begin with an upper case letter"));
if (enginePrivate->v8engine.illegalNames().contains(nameStr))
if (enginePrivate->v8engine()->illegalNames().contains(nameStr))
COMPILE_EXCEPTION(obj, tr("Illegal method name"));
methodNames.insert(name);
}
......@@ -2689,7 +2689,7 @@ bool QDeclarativeCompiler::checkValidId(QDeclarativeParser::Value *v, const QStr
}
if (enginePrivate->v8engine.illegalNames().contains(val))
if (enginePrivate->v8engine()->illegalNames().contains(val))
COMPILE_EXCEPTION(v, tr( "ID illegally masks global JavaScript property"));
return true;
......
......@@ -76,7 +76,6 @@ class QDeclarativeComponent;
class QDeclarativeContext;
class QDeclarativeContextData;
class QScriptProgram;
class Q_AUTOTEST_EXPORT QDeclarativeCompiledData : public QDeclarativeRefCount, public QDeclarativeCleanup
{
public:
......@@ -112,8 +111,7 @@ public:
QList<QString> primitives;
QList<QByteArray> datas;
QByteArray bytecode;
QList<QScriptProgram *> cachedPrograms;
QList<QScriptValue *> cachedClosures;
QList<QJSValue *> cachedClosures;
QList<QDeclarativePropertyCache *> propertyCaches;
QList<QDeclarativeIntegerCache *> contextCaches;
QList<QDeclarativeScriptData *> scripts;
......
......@@ -54,7 +54,6 @@
#include "private/qdeclarativescriptparser_p.h"
#include "private/qdeclarativedebugtrace_p.h"
#include "private/qdeclarativeenginedebug_p.h"
#include <QtScript/qscriptvalueiterator.h>
#include <QStack>
#include <QStringList>
......@@ -672,7 +671,7 @@ void QDeclarativeComponent::createObject(QDeclarativeV8Function *args)
QDeclarativeEngine *engine = d->engine;
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
QV8Engine *v8engine = &ep->v8engine;
QV8Engine *v8engine = ep->v8engine();
QDeclarativeContext *ctxt = creationContext();
if (!ctxt) ctxt = engine->rootContext();
......
......@@ -47,7 +47,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qjsvalue.h>
QT_BEGIN_HEADER
......
......@@ -50,12 +50,10 @@
#include "private/qdeclarativev4bindings_p.h"
#include "private/qv8bindings_p.h"
#include <qscriptengine.h>
#include <qjsengine.h>
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qdebug.h>
#include <private/qscriptdeclarativeclass_p.h>
QT_BEGIN_NAMESPACE
QDeclarativeContextPrivate::QDeclarativeContextPrivate()
......
......@@ -44,7 +44,7 @@
#include <QtCore/qurl.h>
#include <QtCore/qobject.h>
#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qjsvalue.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qvariant.h>
......
......@@ -63,7 +63,7 @@
#include "private/qdeclarativeparser_p.h"
#include <QtCore/qhash.h>
#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qjsvalue.h>
#include <QtCore/qset.h>
#include <private/qobject_p.h>
......
......@@ -53,7 +53,7 @@
// We mean it.
//
#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qjsvalue.h>
#include <private/qobject_p.h>
#include <private/qv8_p.h>
......
......@@ -441,7 +441,7 @@ void QDeclarativeEnginePrivate::init()
Q_Q(QDeclarativeEngine);
qRegisterMetaType<QVariant>("QVariant");
qRegisterMetaType<QDeclarativeScriptString>("QDeclarativeScriptString");
qRegisterMetaType<QScriptValue>("QScriptValue");
qRegisterMetaType<QJSValue>("QJSValue");
qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeComponent::Status");
qRegisterMetaType<QList<QObject*> >("QList<QObject*>");
qRegisterMetaType<QList<int> >("QList<int>");
......@@ -449,8 +449,7 @@ void QDeclarativeEnginePrivate::init()
QDeclarativeData::init();
// Init V8 data
v8engine.init(q);
v8engine()->setEngine(q);
rootContext = new QDeclarativeContext(q,true);
......@@ -505,7 +504,7 @@ QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine
Create a new QDeclarativeEngine with the given \a parent.
*/
QDeclarativeEngine::QDeclarativeEngine(QObject *parent)
: QObject(*new QDeclarativeEnginePrivate(this), parent)
: QJSEngine(*new QDeclarativeEnginePrivate(this), parent)
{
Q_D(QDeclarativeEngine);
d->init();
......@@ -1386,13 +1385,13 @@ bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &ur
void QDeclarativeEngine::setOfflineStoragePath(const QString& dir)
{
Q_D(QDeclarativeEngine);
qt_qmlsqldatabase_setOfflineStoragePath(&d->v8engine, dir);
qt_qmlsqldatabase_setOfflineStoragePath(d->v8engine(), dir);
}
QString QDeclarativeEngine::offlineStoragePath() const
{
Q_D(const QDeclarativeEngine);
return qt_qmlsqldatabase_getOfflineStoragePath(&d->v8engine);
return qt_qmlsqldatabase_getOfflineStoragePath(d->v8engine());
}
static void voidptr_destructor(void *v)
......
......@@ -45,7 +45,8 @@
#include <QtCore/qurl.h>
#include <QtCore/qobject.h>
#include <QtCore/qmap.h>
#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qjsengine.h>
#include <QtDeclarative/qjsvalue.h>
#include <QtDeclarative/qdeclarativeerror.h>
QT_BEGIN_HEADER
......@@ -61,12 +62,12 @@ class QDeclarativeExpression;
class QDeclarativeContext;
class QDeclarativeType;
class QUrl;
class QScriptEngine;
class QJSEngine;
class QScriptContext;
class QDeclarativeImageProvider;
class QNetworkAccessManager;
class QDeclarativeNetworkAccessManagerFactory;
class Q_DECLARATIVE_EXPORT QDeclarativeEngine : public QObject
class Q_DECLARATIVE_EXPORT QDeclarativeEngine : public QJSEngine
{
Q_PROPERTY(QString offlineStoragePath READ offlineStoragePath WRITE setOfflineStoragePath)
Q_OBJECT
......
......@@ -139,8 +139,7 @@ public:
QDeclarativeDelayedError *erroredBindings;
int inProgressCreations;
// V8 Engine
QV8Engine v8engine;
QV8Engine *v8engine() const { return q_func()->handle(); }
QDeclarativeWorkerScriptEngine *getWorkerScriptEngine();
QDeclarativeWorkerScriptEngine *workerScriptEngine;
......@@ -256,7 +255,7 @@ public:
static void warning(QDeclarativeEnginePrivate *, const QDeclarativeError &);
static void warning(QDeclarativeEnginePrivate *, const QList<QDeclarativeError> &);
static QV8Engine *getV8Engine(QDeclarativeEngine *e) { return &e->d_func()->v8engine; }
static QV8Engine *getV8Engine(QDeclarativeEngine *e) { return e->d_func()->v8engine(); }
static QDeclarativeEnginePrivate *get(QDeclarativeEngine *e) { return e->d_func(); }
static QDeclarativeEnginePrivate *get(QDeclarativeContext *c) { return (c && c->engine()) ? QDeclarativeEnginePrivate::get(c->engine()) : 0; }
static QDeclarativeEnginePrivate *get(QDeclarativeContextData *c) { return (c && c->engine) ? QDeclarativeEnginePrivate::get(c->engine) : 0; }
......
......@@ -144,11 +144,11 @@ QDeclarativeExpressionPrivate::evalFunction(QDeclarativeContextData *ctxt, QObje
// XXX TODO: Implement script caching, like we used to do with QScriptProgram in the
// QtScript days
v8::HandleScope handle_scope;
v8::Context::Scope ctxtscope(ep->v8engine.context());
v8::Context::Scope ctxtscope(ep->v8engine()->context());
v8::TryCatch tc;
v8::Local<v8::Object> scopeobject = ep->v8engine.qmlScope(ctxt, scope);
v8::Local<v8::Script> script = ep->v8engine.qmlModeCompile(code, filename, line);
v8::Local<v8::Object> scopeobject = ep->v8engine()->qmlScope(ctxt, scope);
v8::Local<v8::Script> script = ep->v8engine()->qmlModeCompile(code, filename, line);
v8::Local<v8::Value> result = script->Run(scopeobject);
if (tc.HasCaught()) return v8::Persistent<v8::Function>();
if (qmlscope) *qmlscope = qPersistentNew<v8::Object>(scopeobject);
......@@ -485,9 +485,9 @@ v8::Local<v8::Value> QDeclarativeJavaScriptExpression::evaluate(v8::Handle<v8::F
v8::Local<v8::Value> result;
{
v8::TryCatch try_catch;
v8::Handle<v8::Object> This = ep->v8engine.global();
v8::Handle<v8::Object> This = ep->v8engine()->global();
if (scopeObject() && requiresThisObject()) {
v8::Handle<v8::Value> value = ep->v8engine.newQObject(scopeObject());
v8::Handle<v8::Value> value = ep->v8engine()->newQObject(scopeObject());
if (value->IsObject()) This = v8::Handle<v8::Object>::Cast(value);
}
......@@ -498,7 +498,7 @@ v8::Local<v8::Value> QDeclarativeJavaScriptExpression::evaluate(v8::Handle<v8::F
if (watcher.wasDeleted()) {
} else if (try_catch.HasCaught()) {
v8::Context::Scope scope(ep->v8engine.context());
v8::Context::Scope scope(ep->v8engine()->context());
v8::Local<v8::Message> message = try_catch.Message();
if (!message.IsEmpty()) {
QDeclarativeExpressionPrivate::exceptionToError(message, error);
......@@ -638,9 +638,9 @@ v8::Local<v8::Value> QDeclarativeExpressionPrivate::v8value(QObject *secondarySc
v8::Local<v8::Value> result;
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context()->engine);
QObject *restoreSecondaryScope = 0;
restoreSecondaryScope = ep->v8engine.contextWrapper()->setSecondaryScope(v8qmlscope, secondaryScope);
restoreSecondaryScope = ep->v8engine()->contextWrapper()->setSecondaryScope(v8qmlscope, secondaryScope);
result = evaluate(v8function, isUndefined);
ep->v8engine.contextWrapper()->setSecondaryScope(v8qmlscope, restoreSecondaryScope);
ep->v8engine()->contextWrapper()->setSecondaryScope(v8qmlscope, restoreSecondaryScope);
return result;
} else {
return evaluate(v8function, isUndefined);
......@@ -663,9 +663,9 @@ QVariant QDeclarativeExpressionPrivate::value(QObject *secondaryScope, bool *isU
{
v8::HandleScope handle_scope;
v8::Context::Scope context_scope(ep->v8engine.context());
v8::Context::Scope context_scope(ep->v8engine()->context());
v8::Local<v8::Value> result = v8value(secondaryScope, isUndefined);
rv = ep->v8engine.toVariant(result, qMetaTypeId<QList<QObject*> >());
rv = ep->v8engine()->toVariant(result, qMetaTypeId<QList<QObject*> >());
}
ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete.
......
......@@ -61,7 +61,7 @@
#include <qvector.h>
#include <qlocale.h>
#include <QtCore/qcryptographichash.h>
#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qjsvalue.h>
#include <ctype.h>
......@@ -1114,7 +1114,7 @@ QT_END_NAMESPACE
#include <QtGui/qquaternion.h>
#include <private/qv8engine_p.h>
Q_DECLARE_METATYPE(QScriptValue);
Q_DECLARE_METATYPE(QJSValue);
Q_DECLARE_METATYPE(QDeclarativeV8Handle);
QT_BEGIN_NAMESPACE
......@@ -1195,7 +1195,7 @@ bool QDeclarativeMetaType::canCopy(int type)
default:
if (type == qMetaTypeId<QVariant>() ||
type == qMetaTypeId<QScriptValue>() ||
type == qMetaTypeId<QJSValue>() ||
type == qMetaTypeId<QDeclarativeV8Handle>() ||
typeCategory(type) != Unknown) {
return true;
......@@ -1416,8 +1416,8 @@ bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
if (type == qMetaTypeId<QVariant>()) {
*static_cast<NS(QVariant) *>(data) = *static_cast<const NS(QVariant)*>(copy);
return true;
} else if (type == qMetaTypeId<QScriptValue>()) {
*static_cast<NS(QScriptValue) *>(data) = *static_cast<const NS(QScriptValue)*>(copy);
} else if (type == qMetaTypeId<QJSValue>()) {
*static_cast<NS(QJSValue) *>(data) = *static_cast<const NS(QJSValue)*>(copy);
return true;
} else if (type == qMetaTypeId<QDeclarativeV8Handle>()) {
*static_cast<NS(QDeclarativeV8Handle) *>(data) = *static_cast<const NS(QDeclarativeV8Handle)*>(copy);
......@@ -1626,8 +1626,8 @@ bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
if (type == qMetaTypeId<QVariant>()) {
*static_cast<NS(QVariant) *>(data) = NS(QVariant)();
return true;
} else if (type == qMetaTypeId<QScriptValue>()) {
*static_cast<NS(QScriptValue) *>(data) = NS(QScriptValue)();
} else if (type == qMetaTypeId<QJSValue>()) {
*static_cast<NS(QJSValue) *>(data) = NS(QJSValue)();
return true;
} else if (type == qMetaTypeId<QDeclarativeV8Handle>()) {
*static_cast<NS(QDeclarativeV8Handle) *>(data) = NS(QDeclarativeV8Handle)();
......
......@@ -59,7 +59,7 @@
#include <QtCore/qvariant.h>
#include <QtCore/qbitarray.h>
#include <private/qdeclarativeglobal_p.h>
#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qjsvalue.h>
QT_BEGIN_NAMESPACE
......@@ -113,9 +113,9 @@ public:
ModuleApiInstance()
: scriptCallback(0), qobjectCallback(0), qobjectApi(0) {}
QScriptValue (*scriptCallback)(QDeclarativeEngine *, QScriptEngine *);
QObject *(*qobjectCallback)(QDeclarativeEngine *, QScriptEngine *);
QScriptValue scriptApi;
QJSValue (*scriptCallback)(QDeclarativeEngine *, QJSEngine *);
QObject *(*qobjectCallback)(QDeclarativeEngine *, QJSEngine *);
QJSValue scriptApi;
QObject *qobjectApi;
};
struct ModuleApi {
......@@ -123,8 +123,8 @@ public:
inline bool operator==(const ModuleApi &) const;
int major;
int minor;
QScriptValue (*script)(QDeclarativeEngine *, QScriptEngine *);
QObject *(*qobject)(QDeclarativeEngine *, QScriptEngine *);
QJSValue (*script)(QDeclarativeEngine *, QJSEngine *);
QObject *(*qobject)(QDeclarativeEngine *, QJSEngine *);
};
static ModuleApi moduleApi(const QByteArray &, int, int);
};
......
......@@ -74,8 +74,8 @@ public:
};
class QScriptValue;
class QScriptEngine;
class QJSValue;
class QJSEngine;
class QDeclarativeEngine;
class QDeclarativeCustomParser;
namespace QDeclarativePrivate
......@@ -243,8 +243,8 @@ namespace QDeclarativePrivate
int versionMajor;
int versionMinor;
QScriptValue (*scriptApi)(QDeclarativeEngine *, QScriptEngine *);
QObject *(*qobjectApi)(QDeclarativeEngine *, QScriptEngine *);
QJSValue (*scriptApi)(QDeclarativeEngine *, QJSEngine *);
QObject *(*qobjectApi)(QDeclarativeEngine *, QJSEngine *);
};
enum RegistrationType {
......
......@@ -49,7 +49,7 @@
#include <QtCore/qdebug.h>
Q_DECLARE_METATYPE(QScriptValue)
Q_DECLARE_METATYPE(QJSValue)
Q_DECLARE_METATYPE(QDeclarativeV8Handle);
QT_BEGIN_NAMESPACE
......@@ -83,8 +83,8 @@ static QDeclarativePropertyCache::Data::Flags flagsForPropertyType(int propType,
if (propType < QMetaType::User && propType != QMetaType::QObjectStar && propType != QMetaType::QWidgetStar) {
} else if (propType == qMetaTypeId<QDeclarativeBinding *>()) {
flags |= QDeclarativePropertyCache::Data::IsQmlBinding;
} else if (propType == qMetaTypeId<QScriptValue>()) {
flags |= QDeclarativePropertyCache::Data::IsQScriptValue;
} else if (propType == qMetaTypeId<QJSValue>()) {
flags |= QDeclarativePropertyCache::Data::IsQJSValue;
} else if (propType == qMetaTypeId<QDeclarativeV8Handle>()) {
flags |= QDeclarativePropertyCache::Data::IsV8Handle;
} else {
......@@ -518,7 +518,7 @@ QDeclarativePropertyCache::property(QDeclarativeEngine *engine, QObject *obj,
rv = cache->property(name);
} else {
QString strname = QV8Engine::toStringStatic(name.string());
// QString strname = ep->v8engine.toString(name);
// QString strname = ep->v8engine()->toString(name);
local = QDeclarativePropertyCache::create(obj->metaObject(), strname);
if (local.isValid())
rv = &local;
......
......@@ -60,7 +60,6 @@
#include "private/qhashedstring_p.h"
#include <QtCore/qvector.h>
#include <QtScript/private/qscriptdeclarativeclass_p.h>
QT_BEGIN_NAMESPACE
class QDeclarativeEngine;
......@@ -96,7 +95,7 @@ public:
IsEnumType = 0x00000100, // Property type is an enum
IsQList = 0x00000200, // Property type is a QML list