From 8b5fbb56299851896fbcf136bdcfdcd4487484b5 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 6 May 2013 15:57:06 +0200 Subject: Get rid of v8::Local The class was doing exactly the same thing as v8::Handle in our implementation. Removing it cleans up quite a bit of code. Change-Id: I37a3dcdef062fc388751e9ef0a158b5926ba2efb Reviewed-by: Simon Hausmann --- src/qml/qml/ftw/qhashedstring_p.h | 2 +- src/qml/qml/qqmlbinding.cpp | 4 +- src/qml/qml/qqmlcomponent.cpp | 40 ++-- src/qml/qml/qqmlexpression.cpp | 4 +- src/qml/qml/qqmlexpression_p.h | 2 +- src/qml/qml/qqmljavascriptexpression.cpp | 36 ++-- src/qml/qml/qqmljavascriptexpression_p.h | 4 +- src/qml/qml/qqmllocale.cpp | 28 +-- src/qml/qml/qqmlpropertycache_p.h | 2 +- src/qml/qml/qqmlvme.cpp | 6 +- src/qml/qml/qqmlvmemetaobject.cpp | 6 +- src/qml/qml/qqmlxmlhttprequest.cpp | 144 +++++++------- src/qml/qml/v4/qv4v8.cpp | 318 +++++++++++++++---------------- src/qml/qml/v4/qv4v8_p.h | 226 +++++++++------------- src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 26 +-- src/qml/qml/v8/qv4domerrors_p.h | 2 +- src/qml/qml/v8/qv8bindings.cpp | 10 +- src/qml/qml/v8/qv8contextwrapper.cpp | 30 +-- src/qml/qml/v8/qv8contextwrapper_p.h | 16 +- src/qml/qml/v8/qv8engine.cpp | 30 +-- src/qml/qml/v8/qv8engine_p.h | 16 +- src/qml/qml/v8/qv8include.cpp | 16 +- src/qml/qml/v8/qv8include_p.h | 2 +- src/qml/qml/v8/qv8listwrapper.cpp | 16 +- src/qml/qml/v8/qv8listwrapper_p.h | 8 +- src/qml/qml/v8/qv8qobjectwrapper.cpp | 80 ++++---- src/qml/qml/v8/qv8qobjectwrapper_p.h | 10 +- src/qml/qml/v8/qv8sequencewrapper.cpp | 34 ++-- src/qml/qml/v8/qv8sequencewrapper_p.h | 20 +- src/qml/qml/v8/qv8sequencewrapper_p_p.h | 6 +- src/qml/qml/v8/qv8typewrapper.cpp | 16 +- src/qml/qml/v8/qv8typewrapper_p.h | 10 +- src/qml/qml/v8/qv8valuetypewrapper.cpp | 22 +-- src/qml/qml/v8/qv8valuetypewrapper_p.h | 12 +- src/qml/qml/v8/qv8variantwrapper.cpp | 22 +-- src/qml/qml/v8/qv8variantwrapper_p.h | 16 +- src/qml/qml/v8/qv8worker.cpp | 18 +- 37 files changed, 607 insertions(+), 653 deletions(-) (limited to 'src/qml/qml') diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h index 990fbc516f..cce49709a7 100644 --- a/src/qml/qml/ftw/qhashedstring_p.h +++ b/src/qml/qml/ftw/qhashedstring_p.h @@ -263,7 +263,7 @@ public: inline uint16_t *utf16Data() const { return (uint16_t *)strData->data(); } inline bool equals(v8::Handle string) const { - v8::Local data = isQString() ? v8::String::New(utf16Data(), length) + v8::Handle data = isQString() ? v8::String::New(utf16Data(), length) : v8::String::New(cStrData(), length); return string->Equals(data); } diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 284a0afdcc..4aebec4d60 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -278,7 +278,7 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) bool isUndefined = false; - v8::Local result = + v8::Handle result = QQmlJavaScriptExpression::evaluate(context(), **v4function, &isUndefined); trace.event("writing binding result"); @@ -319,7 +319,7 @@ QVariant QQmlBinding::evaluate() bool isUndefined = false; - v8::Local result = + v8::Handle result = QQmlJavaScriptExpression::evaluate(context(), **v4function, &isUndefined); ep->dereferenceScarceResources(); diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index cdca8049ed..75da534bc7 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1086,17 +1086,17 @@ V8_RESOURCE_TYPE(IncubatorType) public: QV8IncubatorResource(QV8Engine *engine, IncubationMode = Asynchronous); - static v8::Handle StatusChangedGetter(v8::Local, + static v8::Handle StatusChangedGetter(v8::Handle, const v8::AccessorInfo& info); - static v8::Handle StatusGetter(v8::Local, + static v8::Handle StatusGetter(v8::Handle, const v8::AccessorInfo& info); - static v8::Handle ObjectGetter(v8::Local, + static v8::Handle ObjectGetter(v8::Handle, const v8::AccessorInfo& info); - static v8::Handle ForceCompletionGetter(v8::Local, + static v8::Handle ForceCompletionGetter(v8::Handle, const v8::AccessorInfo& info); static v8::Handle ForceCompletion(const v8::Arguments &args); - static void StatusChangedSetter(v8::Local, v8::Local value, + static void StatusChangedSetter(v8::Handle, v8::Handle value, const v8::AccessorInfo& info); void dispose(); @@ -1184,19 +1184,19 @@ void QQmlComponent::createObject(QQmlV8Function *args) Q_ASSERT(args); QObject *parent = 0; - v8::Local valuemap; + v8::Handle valuemap; if (args->Length() >= 1) parent = args->engine()->toQObject((*args)[0]->v4Value()); if (args->Length() >= 2) { - v8::Local v = (*args)[1]; + v8::Handle v = (*args)[1]; if (!v->IsObject() || v->IsArray()) { qmlInfo(this) << tr("createObject: value is not an object"); args->returnValue(v8::Null()); return; } - valuemap = v8::Local::Cast(v); + valuemap = v8::Handle::Cast(v); } QV8Engine *v8engine = args->engine(); @@ -1304,21 +1304,21 @@ void QQmlComponent::incubateObject(QQmlV8Function *args) Q_ASSERT(args); QObject *parent = 0; - v8::Local valuemap; + v8::Handle valuemap; QQmlIncubator::IncubationMode mode = QQmlIncubator::Asynchronous; if (args->Length() >= 1) parent = args->engine()->toQObject((*args)[0]->v4Value()); if (args->Length() >= 2) { - v8::Local v = (*args)[1]; + v8::Handle v = (*args)[1]; if (v->IsNull()) { } else if (!v->IsObject() || v->IsArray()) { qmlInfo(this) << tr("createObject: value is not an object"); args->returnValue(v8::Null()); return; } else { - valuemap = v8::Local::Cast(v); + valuemap = v8::Handle::Cast(v); } } @@ -1333,7 +1333,7 @@ void QQmlComponent::incubateObject(QQmlV8Function *args) QQmlComponentExtension *e = componentExtension(args->engine()); QV8IncubatorResource *r = new QV8IncubatorResource(args->engine(), mode); - v8::Local o = e->incubationConstructor->NewInstance(); + v8::Handle o = e->incubationConstructor->NewInstance(); o->SetExternalResource(r); if (!valuemap.IsEmpty()) { @@ -1378,7 +1378,7 @@ QQmlComponentExtension::QQmlComponentExtension(QV8Engine *engine) forceCompletion = qPersistentNew(V8FUNCTION(QV8IncubatorResource::ForceCompletion, engine)); { - v8::Local ft = v8::FunctionTemplate::New(); + v8::Handle ft = v8::FunctionTemplate::New(); ft->InstanceTemplate()->SetHasExternalResource(true); ft->InstanceTemplate()->SetInternalFieldCount(1); ft->InstanceTemplate()->SetAccessor(v8::String::New("onStatusChanged"), @@ -1394,14 +1394,14 @@ QQmlComponentExtension::QQmlComponentExtension(QV8Engine *engine) } } -v8::Handle QV8IncubatorResource::ObjectGetter(v8::Local, +v8::Handle QV8IncubatorResource::ObjectGetter(v8::Handle, const v8::AccessorInfo& info) { QV8IncubatorResource *r = v8_resource_check(info.This()); return r->engine->newQObject(r->object()); } -v8::Handle QV8IncubatorResource::ForceCompletionGetter(v8::Local, +v8::Handle QV8IncubatorResource::ForceCompletionGetter(v8::Handle, const v8::AccessorInfo& info) { QV8IncubatorResource *r = v8_resource_check(info.This()); @@ -1419,20 +1419,20 @@ v8::Handle QV8IncubatorResource::ForceCompletion(const v8::Arguments return v8::Undefined(); } -v8::Handle QV8IncubatorResource::StatusGetter(v8::Local, +v8::Handle QV8IncubatorResource::StatusGetter(v8::Handle, const v8::AccessorInfo& info) { QV8IncubatorResource *r = v8_resource_check(info.This()); return v8::Integer::NewFromUnsigned(r->status()); } -v8::Handle QV8IncubatorResource::StatusChangedGetter(v8::Local, +v8::Handle QV8IncubatorResource::StatusChangedGetter(v8::Handle, const v8::AccessorInfo& info) { return info.This()->GetInternalField(0); } -void QV8IncubatorResource::StatusChangedSetter(v8::Local, v8::Local value, +void QV8IncubatorResource::StatusChangedSetter(v8::Handle, v8::Handle value, const v8::AccessorInfo& info) { info.This()->SetInternalField(0, value); @@ -1481,12 +1481,12 @@ void QV8IncubatorResource::statusChanged(Status s) } if (!me.IsEmpty()) { // Will be false in synchronous mode - v8::Local callback = me->GetInternalField(0); + v8::Handle callback = me->GetInternalField(0); if (!callback.IsEmpty() && !callback->IsUndefined()) { if (callback->IsFunction()) { - v8::Local f = v8::Local::Cast(callback); + v8::Handle f = v8::Handle::Cast(callback); v8::Handle args[] = { v8::Integer::NewFromUnsigned(s) }; v8::TryCatch tc; f->Call(me, 1, args); diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 5a51cd10da..29f53f3372 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -340,7 +340,7 @@ void QQmlExpression::setExpression(const QString &expression) } // Must be called with a valid handle scope -v8::Local QQmlExpressionPrivate::v8value(bool *isUndefined) +v8::Handle QQmlExpressionPrivate::v8value(bool *isUndefined) { if (!expressionFunctionValid) { bool ok = true; @@ -376,7 +376,7 @@ QVariant QQmlExpressionPrivate::value(bool *isUndefined) ep->referenceScarceResources(); // "hold" scarce resources in memory during evaluation. { - v8::Local result = v8value(isUndefined); + v8::Handle result = v8value(isUndefined); rv = ep->v8engine()->toVariant(result->v4Value(), -1); } diff --git a/src/qml/qml/qqmlexpression_p.h b/src/qml/qml/qqmlexpression_p.h index 5efb21b9ff..e31d189d6d 100644 --- a/src/qml/qml/qqmlexpression_p.h +++ b/src/qml/qml/qqmlexpression_p.h @@ -84,7 +84,7 @@ public: QVariant value(bool *isUndefined = 0); - v8::Local v8value(bool *isUndefined = 0); + v8::Handle v8value(bool *isUndefined = 0); static inline QQmlExpressionPrivate *get(QQmlExpression *expr); static inline QQmlExpression *get(QQmlExpressionPrivate *expr); diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 031a20b8a7..05c6c242ba 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -119,14 +119,14 @@ void QQmlJavaScriptExpression::resetNotifyOnValueChanged() clearGuards(); } -v8::Local +v8::Handle QQmlJavaScriptExpression::evaluate(QQmlContextData *context, v8::Handle function, bool *isUndefined) { return evaluate(context, function, 0, 0, isUndefined); } -v8::Local +v8::Handle QQmlJavaScriptExpression::evaluate(QQmlContextData *context, v8::Handle function, int argc, v8::Handle args[], @@ -136,7 +136,7 @@ QQmlJavaScriptExpression::evaluate(QQmlContextData *context, if (function.IsEmpty() || function->IsUndefined()) { if (isUndefined) *isUndefined = true; - return v8::Local(); + return v8::Handle(); } QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context->engine); @@ -167,7 +167,7 @@ QQmlJavaScriptExpression::evaluate(QQmlContextData *context, ep->sharedScope = scopeObject(); } - v8::Local result; + v8::Handle result; { v8::TryCatch try_catch; v8::Handle This = v8::Value::fromV4Value(ep->v8engine()->global()); @@ -183,7 +183,7 @@ QQmlJavaScriptExpression::evaluate(QQmlContextData *context, if (watcher.wasDeleted()) { } else if (try_catch.HasCaught()) { - v8::Local message = try_catch.Message(); + v8::Handle message = try_catch.Message(); if (!message.IsEmpty()) { delayedError()->setMessage(message); } else { @@ -309,7 +309,7 @@ void QQmlJavaScriptExpression::exceptionToError(v8::Handle message, v8::Handle description = message->Get(); int lineNumber = message->GetLineNumber(); - v8::Local file = name->IsString()?name->ToString():v8::Local(); + v8::Handle file = name->IsString()?name->ToString():v8::Handle(); if (file.IsEmpty() || file->Length() == 0) error.setUrl(QUrl()); else @@ -336,33 +336,33 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scope, QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); v8::TryCatch tc; - v8::Local scopeobject = ep->v8engine()->qmlScope(ctxt, scope); - v8::Local script = ep->v8engine()->qmlModeCompile(code, codeLength, filename, line); + v8::Handle scopeobject = ep->v8engine()->qmlScope(ctxt, scope); + v8::Handle script = ep->v8engine()->qmlModeCompile(code, codeLength, filename, line); if (tc.HasCaught()) { QQmlError error; error.setDescription(QLatin1String("Exception occurred during function compilation")); error.setLine(line); error.setUrl(QUrl::fromLocalFile(filename)); - v8::Local message = tc.Message(); + v8::Handle message = tc.Message(); if (!message.IsEmpty()) QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); return v8::Persistent(); } - v8::Local result = script->Run(scopeobject); + v8::Handle result = script->Run(scopeobject); if (tc.HasCaught()) { QQmlError error; error.setDescription(QLatin1String("Exception occurred during function evaluation")); error.setLine(line); error.setUrl(QUrl::fromLocalFile(filename)); - v8::Local message = tc.Message(); + v8::Handle message = tc.Message(); if (!message.IsEmpty()) QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); return v8::Persistent(); } if (qmlscope) *qmlscope = qPersistentNew(scopeobject); - return qPersistentNew(v8::Local::Cast(result)); + return qPersistentNew(v8::Handle::Cast(result)); } // Callee owns the persistent handle @@ -375,33 +375,33 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scope, QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); v8::TryCatch tc; - v8::Local scopeobject = ep->v8engine()->qmlScope(ctxt, scope); - v8::Local script = ep->v8engine()->qmlModeCompile(code, filename, line); + v8::Handle scopeobject = ep->v8engine()->qmlScope(ctxt, scope); + v8::Handle script = ep->v8engine()->qmlModeCompile(code, filename, line); if (tc.HasCaught()) { QQmlError error; error.setDescription(QLatin1String("Exception occurred during function compilation")); error.setLine(line); error.setUrl(QUrl::fromLocalFile(filename)); - v8::Local message = tc.Message(); + v8::Handle message = tc.Message(); if (!message.IsEmpty()) QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); return v8::Persistent(); } - v8::Local result = script->Run(scopeobject); + v8::Handle result = script->Run(scopeobject); if (tc.HasCaught()) { QQmlError error; error.setDescription(QLatin1String("Exception occurred during function evaluation")); error.setLine(line); error.setUrl(QUrl::fromLocalFile(filename)); - v8::Local message = tc.Message(); + v8::Handle message = tc.Message(); if (!message.IsEmpty()) QQmlExpressionPrivate::exceptionToError(message, error); ep->warning(error); return v8::Persistent(); } if (qmlscope) *qmlscope = qPersistentNew(scopeobject); - return qPersistentNew(v8::Local::Cast(result)); + return qPersistentNew(v8::Handle::Cast(result)); } void QQmlJavaScriptExpression::clearGuards() diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h index c48972e6a1..c1d3d1395f 100644 --- a/src/qml/qml/qqmljavascriptexpression_p.h +++ b/src/qml/qml/qqmljavascriptexpression_p.h @@ -110,9 +110,9 @@ public: QQmlJavaScriptExpression(VTable *vtable); - v8::Local evaluate(QQmlContextData *, v8::Handle, + v8::Handle evaluate(QQmlContextData *, v8::Handle, bool *isUndefined); - v8::Local evaluate(QQmlContextData *, v8::Handle, + v8::Handle evaluate(QQmlContextData *, v8::Handle, int argc, v8::Handle args[], bool *isUndefined); diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index 3cc811c8a6..0d50977fae 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -142,12 +142,12 @@ static const char dateTimeZoneUpdatedFunction[] = static void registerFunction(QV8Engine *engine, const char *script, v8::InvocationCallback func) { - v8::Local registerScript = v8::Script::New(v8::String::New(script), 0, 0, v8::Handle(), v8::Script::NativeMode); - v8::Local result = registerScript->Run(); + v8::Handle registerScript = v8::Script::New(v8::String::New(script), 0, 0, v8::Handle(), v8::Script::NativeMode); + v8::Handle result = registerScript->Run(); Q_ASSERT(result->IsFunction()); - v8::Local registerFunc = v8::Local::Cast(result); + v8::Handle registerFunc = v8::Handle::Cast(result); v8::Handle args = V8FUNCTION(func, engine); - registerFunc->Call(v8::Local::Cast(registerFunc), 1, &args); + registerFunc->Call(v8::Handle::Cast(registerFunc), 1, &args); } void QQmlDateExtension::registerExtension(QV8Engine *engine) @@ -469,7 +469,7 @@ v8::Handle QQmlNumberExtension::toLocaleString(const v8::Arguments& a if (args.Length() > 1) { if (!args[1]->IsString()) V8THROW_ERROR("Locale: Number.toLocaleString(): Invalid arguments"); - v8::Local fs = args[1]->ToString(); + v8::Handle fs = args[1]->ToString(); if (!fs.IsEmpty() && fs->Length()) { v8::String::Value value(fs); Q_ASSERT(*value != NULL); @@ -532,7 +532,7 @@ v8::Handle QQmlNumberExtension::fromLocaleString(const v8::Arguments& numberIdx = 1; } - v8::Local ns = args[numberIdx]->ToString(); + v8::Handle ns = args[numberIdx]->ToString(); if (ns.IsEmpty() || ns->Length() == 0) return v8::Number::New(Q_QNAN); @@ -548,7 +548,7 @@ v8::Handle QQmlNumberExtension::fromLocaleString(const v8::Arguments& //-------------- // Locale object -static v8::Handle locale_get_firstDayOfWeek(v8::Local, const v8::AccessorInfo &info) +static v8::Handle locale_get_firstDayOfWeek(v8::Handle, const v8::AccessorInfo &info) { GET_LOCALE_DATA_RESOURCE(info.This()); int fdow = int(r->locale.firstDayOfWeek()); @@ -557,19 +557,19 @@ static v8::Handle locale_get_firstDayOfWeek(v8::Local, co return v8::Integer::New(fdow); } -static v8::Handle locale_get_measurementSystem(v8::Local, const v8::AccessorInfo &info) +static v8::Handle locale_get_measurementSystem(v8::Handle, const v8::AccessorInfo &info) { GET_LOCALE_DATA_RESOURCE(info.This()); return v8::Integer::New(r->locale.measurementSystem()); } -static v8::Handle locale_get_textDirection(v8::Local, const v8::AccessorInfo &info) +static v8::Handle locale_get_textDirection(v8::Handle, const v8::AccessorInfo &info) { GET_LOCALE_DATA_RESOURCE(info.This()); return v8::Integer::New(r->locale.textDirection()); } -static v8::Handle locale_get_weekDays(v8::Local, const v8::AccessorInfo &info) +static v8::Handle locale_get_weekDays(v8::Handle, const v8::AccessorInfo &info) { GET_LOCALE_DATA_RESOURCE(info.This()); @@ -586,7 +586,7 @@ static v8::Handle locale_get_weekDays(v8::Local, const v8 return result; } -static v8::Handle locale_get_uiLanguages(v8::Local, const v8::AccessorInfo &info) +static v8::Handle locale_get_uiLanguages(v8::Handle, const v8::AccessorInfo &info) { GET_LOCALE_DATA_RESOURCE(info.This()); @@ -692,7 +692,7 @@ LOCALE_FORMATTED_MONTHNAME(standaloneMonthName) LOCALE_FORMATTED_DAYNAME(dayName) LOCALE_FORMATTED_DAYNAME(standaloneDayName) -#define LOCALE_STRING_PROPERTY(VARIABLE) static v8::Handle locale_get_ ## VARIABLE (v8::Local, const v8::AccessorInfo &info) \ +#define LOCALE_STRING_PROPERTY(VARIABLE) static v8::Handle locale_get_ ## VARIABLE (v8::Handle, const v8::AccessorInfo &info) \ { \ GET_LOCALE_DATA_RESOURCE(info.This()); \ return r->engine->toString(r->locale. VARIABLE());\ @@ -726,7 +726,7 @@ public: QV8LocaleDataDeletable::QV8LocaleDataDeletable(QV8Engine *engine) { - v8::Local ft = v8::FunctionTemplate::New(); + v8::Handle ft = v8::FunctionTemplate::New(); ft->InstanceTemplate()->SetHasExternalResource(true); LOCALE_REGISTER_STRING_ACCESSOR(ft, name); @@ -874,7 +874,7 @@ QQmlLocale::~QQmlLocale() v8::Handle QQmlLocale::locale(QV8Engine *v8engine, const QString &locale) { QV8LocaleDataDeletable *d = localeV8Data(v8engine); - v8::Local v8Value = d->constructor->NewInstance(); + v8::Handle v8Value = d->constructor->NewInstance(); QV8LocaleDataResource *r = new QV8LocaleDataResource(v8engine); if (locale.isEmpty()) r->locale = QLocale(); diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index c1c7cc236f..4f608e1d56 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -348,7 +348,7 @@ private: QQmlPropertyData::Flag signalFlags = QQmlPropertyData::NoFlags); // Implemented in v8/qv8qobjectwrapper.cpp - v8::Local newQObject(QObject *, QV8Engine *); + v8::Handle newQObject(QObject *, QV8Engine *); QQmlPropertyCacheMethodArguments *createArgumentsObject(int count, const QList &names = QList()); diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp index 4c24547a7f..8b8237614d 100644 --- a/src/qml/qml/qqmlvme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -1168,7 +1168,7 @@ void QQmlScriptData::initialize(QQmlEngine *engine) QV8Engine *v8engine = ep->v8engine(); // If compilation throws an error, a surrounding v8::TryCatch will record it. - v8::Local program = v8engine->qmlModeCompile(m_programSource.constData(), + v8::Handle program = v8engine->qmlModeCompile(m_programSource.constData(), m_programSource.length(), urlString, 1); if (program.IsEmpty()) return; @@ -1243,7 +1243,7 @@ v8::Persistent QQmlVME::run(QQmlContextData *parentCtxt, QQmlScriptD if (!script->isInitialized()) script->initialize(parentCtxt->engine); - v8::Local qmlglobal = v8engine->qmlScope(ctxt, 0); + v8::Handle qmlglobal = v8engine->qmlScope(ctxt, 0); v8engine->contextWrapper()->takeContextOwnership(qmlglobal); if (!script->m_program.IsEmpty()) { @@ -1254,7 +1254,7 @@ v8::Persistent QQmlVME::run(QQmlContextData *parentCtxt, QQmlScriptD } if (try_catch.HasCaught()) { - v8::Local message = try_catch.Message(); + v8::Handle message = try_catch.Message(); if (!message.IsEmpty()) { QQmlError error; QQmlExpressionPrivate::exceptionToError(message, error); diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index db742830ce..1f5d88e9b5 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -940,7 +940,7 @@ int QQmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) v8::TryCatch try_catch; - v8::Local result = function->Call(v8::Value::fromV4Value(ep->v8engine()->global()), data->parameterCount, args); + v8::Handle result = function->Call(v8::Value::fromV4Value(ep->v8engine()->global()), data->parameterCount, args); QVariant rv; if (try_catch.HasCaught()) { @@ -1026,7 +1026,7 @@ void QQmlVMEMetaObject::writeVarProperty(int id, v8::Handle value) // Importantly, if the current value is a scarce resource, we need to ensure that it // gets automatically released by the engine if no other references to it exist. - v8::Local oldv = varProperties->Get(id - firstVarPropertyIndex); + v8::Handle oldv = varProperties->Get(id - firstVarPropertyIndex); if (oldv->IsObject()) { QV8VariantResource *r = v8_resource_cast(v8::Handle::Cast(oldv)); if (r) { @@ -1071,7 +1071,7 @@ void QQmlVMEMetaObject::writeProperty(int id, const QVariant &value) // Importantly, if the current value is a scarce resource, we need to ensure that it // gets automatically released by the engine if no other references to it exist. - v8::Local oldv = varProperties->Get(id - firstVarPropertyIndex); + v8::Handle oldv = varProperties->Get(id - firstVarPropertyIndex); if (oldv->IsObject()) { QV8VariantResource *r = v8_resource_cast(v8::Handle::Cast(oldv)); if (r) { diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index f23d066341..ac5783320f 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -90,7 +90,7 @@ struct QQmlXMLHttpRequestData { v8::Persistent cdataPrototype; v8::Persistent documentPrototype; - v8::Local newNode(); + v8::Handle newNode(); }; static inline QQmlXMLHttpRequestData *xhrdata(QV8Engine *engine) @@ -98,9 +98,9 @@ static inline QQmlXMLHttpRequestData *xhrdata(QV8Engine *engine) return (QQmlXMLHttpRequestData *)engine->xmlHttpRequestData(); } -static v8::Local constructMeObject(v8::Handle thisObj, QV8Engine *e) +static v8::Handle constructMeObject(v8::Handle thisObj, QV8Engine *e) { - v8::Local meObj = v8::Object::New(); + v8::Handle meObj = v8::Object::New(); meObj->Set(v8::String::New("ThisObject"), thisObj); meObj->Set(v8::String::New("ActivationObject"), e->qmlScope(e->callingContext(), 0)); return meObj; @@ -124,10 +124,10 @@ QQmlXMLHttpRequestData::~QQmlXMLHttpRequestData() qPersistentDispose(documentPrototype); } -v8::Local QQmlXMLHttpRequestData::newNode() +v8::Handle QQmlXMLHttpRequestData::newNode() { if (nodeFunction.IsEmpty()) { - v8::Local ft = v8::FunctionTemplate::New(); + v8::Handle ft = v8::FunctionTemplate::New(); ft->InstanceTemplate()->SetHasExternalResource(true); nodeFunction = qPersistentNew(ft->GetFunction()); } @@ -203,9 +203,9 @@ class NamedNodeMap { public: // JS API - static v8::Handle length(v8::Local, const v8::AccessorInfo& args); + static v8::Handle length(v8::Handle, const v8::AccessorInfo& args); static v8::Handle indexed(uint32_t index, const v8::AccessorInfo& info); - static v8::Handle named(v8::Local property, const v8::AccessorInfo& args); + static v8::Handle named(v8::Handle property, const v8::AccessorInfo& args); // C++ API static v8::Handle prototype(QV8Engine *); @@ -216,7 +216,7 @@ class NodeList { public: // JS API - static v8::Handle length(v8::Local, const v8::AccessorInfo& args); + static v8::Handle length(v8::Handle, const v8::AccessorInfo& args); static v8::Handle indexed(uint32_t index, const v8::AccessorInfo& info); // C++ API @@ -228,17 +228,17 @@ class Node { public: // JS API - static v8::Handle nodeName(v8::Local, const v8::AccessorInfo& args); - static v8::Handle nodeValue(v8::Local, const v8::AccessorInfo& args); - static v8::Handle nodeType(v8::Local, const v8::AccessorInfo& args); - - static v8::Handle parentNode(v8::Local, const v8::AccessorInfo& args); - static v8::Handle childNodes(v8::Local, const v8::AccessorInfo& args); - static v8::Handle firstChild(v8::Local, const v8::AccessorInfo& args); - static v8::Handle lastChild(v8::Local, const v8::AccessorInfo& args); - static v8::Handle previousSibling(v8::Local, const v8::AccessorInfo& args); - static v8::Handle nextSibling(v8::Local, const v8::AccessorInfo& args); - static v8::Handle attributes(v8::Local, const v8::AccessorInfo& args); + static v8::Handle nodeName(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle nodeValue(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle nodeType(v8::Handle, const v8::AccessorInfo& args); + + static v8::Handle parentNode(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle childNodes(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle firstChild(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle lastChild(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle previousSibling(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle nextSibling(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle attributes(v8::Handle, const v8::AccessorInfo& args); //static v8::Handle ownerDocument(v8::Local, const v8::AccessorInfo& args); //static v8::Handle namespaceURI(v8::Local, const v8::AccessorInfo& args); @@ -273,12 +273,12 @@ class Attr : public Node { public: // JS API - static v8::Handle name(v8::Local, const v8::AccessorInfo& args); - static v8::Handle specified(v8::Local, const v8::AccessorInfo& args); - static v8::Handle value(v8::Local, const v8::AccessorInfo& args); - static v8::Handle ownerElement(v8::Local, const v8::AccessorInfo& args); - static v8::Handle schemaTypeInfo(v8::Local, const v8::AccessorInfo& args); - static v8::Handle isId(v8::Local, const v8::AccessorInfo& args); + static v8::Handle name(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle specified(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle value(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle ownerElement(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle schemaTypeInfo(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle isId(v8::Handle, const v8::AccessorInfo& args); // C++ API static v8::Handle prototype(QV8Engine *); @@ -288,7 +288,7 @@ class CharacterData : public Node { public: // JS API - static v8::Handle length(v8::Local, const v8::AccessorInfo& args); + static v8::Handle length(v8::Handle, const v8::AccessorInfo& args); // C++ API static v8::Handle prototype(QV8Engine *); @@ -298,8 +298,8 @@ class Text : public CharacterData { public: // JS API - static v8::Handle isElementContentWhitespace(v8::Local, const v8::AccessorInfo& args); - static v8::Handle wholeText(v8::Local, const v8::AccessorInfo& args); + static v8::Handle isElementContentWhitespace(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle wholeText(v8::Handle, const v8::AccessorInfo& args); // C++ API static v8::Handle prototype(QV8Engine *); @@ -316,10 +316,10 @@ class Document : public Node { public: // JS API - static v8::Handle xmlVersion(v8::Local, const v8::AccessorInfo& args); - static v8::Handle xmlEncoding(v8::Local, const v8::AccessorInfo& args); - static v8::Handle xmlStandalone(v8::Local, const v8::AccessorInfo& args); - static v8::Handle documentElement(v8::Local, const v8::AccessorInfo& args); + static v8::Handle xmlVersion(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle xmlEncoding(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle xmlStandalone(v8::Handle, const v8::AccessorInfo& args); + static v8::Handle documentElement(v8::Handle, const v8::AccessorInfo& args); // C++ API static v8::Handle prototype(QV8Engine *); @@ -360,7 +360,7 @@ void NodeImpl::release() D(document); } -v8::Handle Node::nodeName(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::nodeName(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -378,7 +378,7 @@ v8::Handle Node::nodeName(v8::Local, const v8::AccessorIn } } -v8::Handle Node::nodeValue(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::nodeValue(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -396,14 +396,14 @@ v8::Handle Node::nodeValue(v8::Local, const v8::AccessorI return engine->toString(r->d->data); } -v8::Handle Node::nodeType(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::nodeType(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); return v8::Integer::New(r->d->type); } -v8::Handle Node::parentNode(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::parentNode(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -413,7 +413,7 @@ v8::Handle Node::parentNode(v8::Local, const v8::Accessor else return v8::Null(); } -v8::Handle Node::childNodes(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::childNodes(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -422,7 +422,7 @@ v8::Handle Node::childNodes(v8::Local, const v8::Accessor return NodeList::create(engine, r->d); } -v8::Handle Node::firstChild(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::firstChild(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -432,7 +432,7 @@ v8::Handle Node::firstChild(v8::Local, const v8::Accessor else return Node::create(engine, r->d->children.first()); } -v8::Handle Node::lastChild(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::lastChild(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -442,7 +442,7 @@ v8::Handle Node::lastChild(v8::Local, const v8::AccessorI else return Node::create(engine, r->d->children.last()); } -v8::Handle Node::previousSibling(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::previousSibling(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -460,7 +460,7 @@ v8::Handle Node::previousSibling(v8::Local, const v8::Acc return v8::Null(); } -v8::Handle Node::nextSibling(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::nextSibling(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -478,7 +478,7 @@ v8::Handle Node::nextSibling(v8::Local, const v8::Accesso return v8::Null(); } -v8::Handle Node::attributes(v8::Local, const v8::AccessorInfo &args) +v8::Handle Node::attributes(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -523,7 +523,7 @@ v8::Handle Node::prototype(QV8Engine *engine) v8::Handle Node::create(QV8Engine *engine, NodeImpl *data) { QQmlXMLHttpRequestData *d = xhrdata(engine); - v8::Local instance = d->newNode(); + v8::Handle instance = d->newNode(); switch (data->type) { case NodeImpl::Attr: @@ -587,7 +587,7 @@ v8::Handle Attr::prototype(QV8Engine *engine) return d->attrPrototype; } -v8::Handle Attr::name(v8::Local, const v8::AccessorInfo &args) +v8::Handle Attr::name(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -596,7 +596,7 @@ v8::Handle Attr::name(v8::Local, const v8::AccessorInfo & return engine->toString(r->d->name); } -v8::Handle Attr::value(v8::Local, const v8::AccessorInfo &args) +v8::Handle Attr::value(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -605,7 +605,7 @@ v8::Handle Attr::value(v8::Local, const v8::AccessorInfo return engine->toString(r->d->data); } -v8::Handle Attr::ownerElement(v8::Local, const v8::AccessorInfo &args) +v8::Handle Attr::ownerElement(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -614,7 +614,7 @@ v8::Handle Attr::ownerElement(v8::Local, const v8::Access return Node::create(engine, r->d->parent); } -v8::Handle CharacterData::length(v8::Local, const v8::AccessorInfo &args) +v8::Handle CharacterData::length(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -638,7 +638,7 @@ v8::Handle CharacterData::prototype(QV8Engine *engine) return d->characterDataPrototype; } -v8::Handle Text::isElementContentWhitespace(v8::Local, const v8::AccessorInfo &args) +v8::Handle Text::isElementContentWhitespace(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -647,7 +647,7 @@ v8::Handle Text::isElementContentWhitespace(v8::Local, co return v8::Boolean::New(r->d->data.trimmed().isEmpty()); } -v8::Handle Text::wholeText(v8::Local, const v8::AccessorInfo &args) +v8::Handle Text::wholeText(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -782,7 +782,7 @@ v8::Handle Document::load(QV8Engine *engine, const QByteArray &data) return v8::Null(); } - v8::Local instance = xhrdata(engine)->newNode(); + v8::Handle instance = xhrdata(engine)->newNode(); QQmlDOMNodeResource *r = new QQmlDOMNodeResource(engine); r->d = document; instance->SetExternalResource(r); @@ -811,7 +811,7 @@ bool Node::isNull() const return d == 0; } -v8::Handle NamedNodeMap::length(v8::Local, const v8::AccessorInfo &args) +v8::Handle NamedNodeMap::length(v8::Handle, const v8::AccessorInfo &args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -833,7 +833,7 @@ v8::Handle NamedNodeMap::indexed(uint32_t index, const v8::AccessorIn } } -v8::Handle NamedNodeMap::named(v8::Local property, const v8::AccessorInfo& args) +v8::Handle NamedNodeMap::named(v8::Handle property, const v8::AccessorInfo& args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r || !r->list) return v8::Undefined(); @@ -853,7 +853,7 @@ v8::Handle NamedNodeMap::prototype(QV8Engine *engine) { QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->namedNodeMapPrototype.IsEmpty()) { - v8::Local ot = v8::ObjectTemplate::New(); + v8::Handle ot = v8::ObjectTemplate::New(); ot->SetAccessor(v8::String::New("length"), length, 0, v8::External::New(engine)); ot->SetIndexedPropertyHandler(indexed, 0, 0, 0, 0, v8::External::New(engine)); ot->SetFallbackPropertyHandler(named, 0, 0, 0, 0, v8::External::New(engine)); @@ -866,7 +866,7 @@ v8::Handle NamedNodeMap::prototype(QV8Engine *engine) v8::Handle NamedNodeMap::create(QV8Engine *engine, NodeImpl *data, QList *list) { QQmlXMLHttpRequestData *d = xhrdata(engine); - v8::Local instance = d->newNode(); + v8::Handle instance = d->newNode(); instance->SetPrototype(NamedNodeMap::prototype(engine)); QQmlDOMNodeResource *r = new QQmlDOMNodeResource(engine); r->d = data; @@ -889,7 +889,7 @@ v8::Handle NodeList::indexed(uint32_t index, const v8::AccessorInfo& } } -v8::Handle NodeList::length(v8::Local, const v8::AccessorInfo& args) +v8::Handle NodeList::length(v8::Handle, const v8::AccessorInfo& args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r) return v8::Undefined(); @@ -902,7 +902,7 @@ v8::Handle NodeList::prototype(QV8Engine *engine) { QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->nodeListPrototype.IsEmpty()) { - v8::Local ot = v8::ObjectTemplate::New(); + v8::Handle ot = v8::ObjectTemplate::New(); ot->SetAccessor(v8::String::New("length"), length, 0, v8::External::New(engine)); ot->SetIndexedPropertyHandler(indexed, 0, 0, 0, 0, v8::External::New(engine)); d->nodeListPrototype = qPersistentNew(ot->NewInstance()); @@ -914,7 +914,7 @@ v8::Handle NodeList::prototype(QV8Engine *engine) v8::Handle NodeList::create(QV8Engine *engine, NodeImpl *data) { QQmlXMLHttpRequestData *d = xhrdata(engine); - v8::Local instance = d->newNode(); + v8::Handle instance = d->newNode(); instance->SetPrototype(NodeList::prototype(engine)); QQmlDOMNodeResource *r = new QQmlDOMNodeResource(engine); r->d = data; @@ -923,7 +923,7 @@ v8::Handle NodeList::create(QV8Engine *engine, NodeImpl *data) return instance; } -v8::Handle Document::documentElement(v8::Local, const v8::AccessorInfo& args) +v8::Handle Document::documentElement(v8::Handle, const v8::AccessorInfo& args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); @@ -932,7 +932,7 @@ v8::Handle Document::documentElement(v8::Local, const v8: return Node::create(engine, static_cast(r->d)->root); } -v8::Handle Document::xmlStandalone(v8::Local, const v8::AccessorInfo& args) +v8::Handle Document::xmlStandalone(v8::Handle, const v8::AccessorInfo& args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); @@ -941,7 +941,7 @@ v8::Handle Document::xmlStandalone(v8::Local, const v8::A return v8::Boolean::New(static_cast(r->d)->isStandalone); } -v8::Handle Document::xmlVersion(v8::Local, const v8::AccessorInfo& args) +v8::Handle Document::xmlVersion(v8::Handle, const v8::AccessorInfo& args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); @@ -950,7 +950,7 @@ v8::Handle Document::xmlVersion(v8::Local, const v8::Acce return engine->toString(static_cast(r->d)->version); } -v8::Handle Document::xmlEncoding(v8::Local, const v8::AccessorInfo& args) +v8::Handle Document::xmlEncoding(v8::Handle, const v8::AccessorInfo& args) { QQmlDOMNodeResource *r = v8_resource_cast(args.This()); if (!r || r->d->type != NodeImpl::Document) return v8::Undefined(); @@ -1468,8 +1468,8 @@ void QQmlXMLHttpRequest::dispatchCallback(v8::Handle me) return; } - v8::Local thisObj = me->Get(v8::String::New("ThisObject"))->ToObject(); - v8::Local callback = thisObj->Get(v8::String::New("onreadystatechange")); + v8::Handle thisObj = me->Get(v8::String::New("ThisObject"))->ToObject(); + v8::Handle callback = thisObj->Get(v8::String::New("onreadystatechange")); if (!callback->IsFunction()) { // not an error, but no onreadystatechange function to call. return; @@ -1480,10 +1480,10 @@ void QQmlXMLHttpRequest::dispatchCallback(v8::Handle me) return; } - v8::Local activationObject = me->Get(v8::String::New("ActivationObject"))->ToObject(); + v8::Handle activationObject = me->Get(v8::String::New("ActivationObject"))->ToObject(); QQmlContextData *callingContext = engine->contextWrapper()->context(activationObject); if (callingContext) { - v8::Local f = v8::Local::Cast(callback); + v8::Handle f = v8::Handle::Cast(callback); f->Call(activationObject, 0, 0); // valid activation object. } @@ -1672,7 +1672,7 @@ static v8::Handle qmlxmlhttprequest_getAllResponseHeaders(const v8::A } // XMLHttpRequest properties -static v8::Handle qmlxmlhttprequest_readyState(v8::Local /* property */, +static v8::Handle qmlxmlhttprequest_readyState(v8::Handle /* property */, const v8::AccessorInfo& info) { QQmlXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1682,7 +1682,7 @@ static v8::Handle qmlxmlhttprequest_readyState(v8::Local return v8::Integer::NewFromUnsigned(r->readyState()); } -static v8::Handle qmlxmlhttprequest_status(v8::Local /* property */, +static v8::Handle qmlxmlhttprequest_status(v8::Handle /* property */, const v8::AccessorInfo& info) { QQmlXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1699,7 +1699,7 @@ static v8::Handle qmlxmlhttprequest_status(v8::Local /* p return v8::Integer::New(r->replyStatus()); } -static v8::Handle qmlxmlhttprequest_statusText(v8::Local /* property */, +static v8::Handle qmlxmlhttprequest_statusText(v8::Handle /* property */, const v8::AccessorInfo& info) { QQmlXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1718,7 +1718,7 @@ static v8::Handle qmlxmlhttprequest_statusText(v8::Local return engine->toString(r->replyStatusText()); } -static v8::Handle qmlxmlhttprequest_responseText(v8::Local /* property */, +static v8::Handle qmlxmlhttprequest_responseText(v8::Handle /* property */, const v8::AccessorInfo& info) { QQmlXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1734,7 +1734,7 @@ static v8::Handle qmlxmlhttprequest_responseText(v8::LocaltoString(r->responseBody()); } -static v8::Handle qmlxmlhttprequest_responseXML(v8::Local /* property */, +static v8::Handle qmlxmlhttprequest_responseXML(v8::Handle /* property */, const v8::AccessorInfo& info) { QQmlXMLHttpRequest *r = v8_resource_cast(info.This()); @@ -1778,7 +1778,7 @@ void *qt_add_qmlxmlhttprequest(QV8Engine *engine) v8::PropertyAttribute attributes = (v8::PropertyAttribute)(v8::ReadOnly | v8::DontEnum | v8::DontDelete); // XMLHttpRequest - v8::Local xmlhttprequest = v8::FunctionTemplate::New(qmlxmlhttprequest_new, + v8::Handle xmlhttprequest = v8::FunctionTemplate::New(qmlxmlhttprequest_new, v8::External::New(engine)); xmlhttprequest->InstanceTemplate()->SetHasExternalResource(true); @@ -1810,7 +1810,7 @@ void *qt_add_qmlxmlhttprequest(QV8Engine *engine) xmlhttprequest->Set(v8::String::New("HEADERS_RECEIVED"), v8::Integer::New(2), attributes); xmlhttprequest->Set(v8::String::New("LOADING"), v8::Integer::New(3), attributes); xmlhttprequest->Set(v8::String::New("DONE"), v8::Integer::New(4), attributes); - v8::Local::New(v8::Value::fromV4Value(engine->global()))->Set(v8::String::New("XMLHttpRequest"), xmlhttprequest->GetFunction()); + v8::Handle(engine->global())->Set(v8::String::New("XMLHttpRequest"), xmlhttprequest->GetFunction()); QQmlXMLHttpRequestData *data = new QQmlXMLHttpRequestData; return data; diff --git a/src/qml/qml/v4/qv4v8.cpp b/src/qml/qml/v4/qv4v8.cpp index 4d15adc28f..16121826da 100644 --- a/src/qml/qml/v4/qv4v8.cpp +++ b/src/qml/qml/v4/qv4v8.cpp @@ -121,7 +121,7 @@ struct V8AccessorGetter: FunctionObject { AccessorInfo info(thisObject, getter->data); QV4::Value result = QV4::Value::undefinedValue(); try { - result = getter->getter(Local::New(getter->name), info)->v4Value(); + result = getter->getter(getter->name, info)->v4Value(); } catch (QV4::Exception &e) { Isolate::GetCurrent()->setException(e.value()); e.accept(context); @@ -158,7 +158,7 @@ struct V8AccessorSetter: FunctionObject { V8AccessorSetter *setter = static_cast(that); AccessorInfo info(thisObject, setter->data); try { - setter->setter(Local::New(setter->name), Local::New(Value::fromV4Value(args[0])), info); + setter->setter(setter->name, args[0], info); } catch (QV4::Exception &e) { Isolate::GetCurrent()->setException(e.value()); e.accept(context); @@ -195,7 +195,7 @@ Handle ScriptOrigin::ResourceColumnOffset() const } -Local