From a508650fb6e2e850734efdcce154b83bdad4df67 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Mon, 4 Mar 2013 17:21:08 +0100 Subject: [PATCH] Replace deprecated V8 functions The External::Wrap and External::Unwrap functions became deprecated in the mainline V8. Replace them as it is officially proposed. Change-Id: Ieac1da53997da440a909939d86c98f17a124c068 Reviewed-by: Lars Knoll --- src/particles/qquickv8particledata.cpp | 2 +- src/qml/qml/qqmlxmlhttprequest.cpp | 56 ++++++++++++------------ src/qml/qml/v8/qv8engine.cpp | 6 +- src/qml/qml/v8/qv8engine_p.h | 6 +- src/qml/qml/v8/qv8qobjectwrapper.cpp | 6 +- src/quick/items/context2d/qquickcontext2d.cpp | 46 ++++++++++---------- 6 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/particles/qquickv8particledata.cpp b/src/particles/qquickv8particledata.cpp index a485e74..44f992c 100644 --- a/src/particles/qquickv8particledata.cpp +++ b/src/particles/qquickv8particledata.cpp @@ -386,7 +386,7 @@ static void particleData_set_ ## VARIABLE (v8::Local, v8::Localdatum-> SETTER ( value->NumberValue() );\ } -#define REGISTER_ACCESSOR(FT, ENGINE, VARIABLE, NAME) FT ->PrototypeTemplate()->SetAccessor( v8::String::New( #NAME ), particleData_get_ ## VARIABLE , particleData_set_ ## VARIABLE , v8::External::Wrap(ENGINE)) +#define REGISTER_ACCESSOR(FT, ENGINE, VARIABLE, NAME) FT ->PrototypeTemplate()->SetAccessor( v8::String::New( #NAME ), particleData_get_ ## VARIABLE , particleData_set_ ## VARIABLE , v8::External::New(ENGINE)) COLOR_GETTER_AND_SETTER(r, red) COLOR_GETTER_AND_SETTER(g, green) diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 9bd769f..80f5dec 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -496,25 +496,25 @@ v8::Handle Node::prototype(QV8Engine *engine) if (d->nodePrototype.IsEmpty()) { d->nodePrototype = qPersistentNew(v8::Object::New()); d->nodePrototype->SetAccessor(v8::String::New("nodeName"), nodeName, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("nodeValue"), nodeValue, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("nodeType"), nodeType, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("parentNode"), parentNode, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("childNodes"), childNodes, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("firstChild"), firstChild, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("lastChild"), lastChild, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("previousSibling"), previousSibling, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("nextSibling"), nextSibling, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->nodePrototype->SetAccessor(v8::String::New("attributes"), attributes, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); engine->freezeObject(d->nodePrototype); } return d->nodePrototype; @@ -564,7 +564,7 @@ v8::Handle Element::prototype(QV8Engine *engine) d->elementPrototype = qPersistentNew(v8::Object::New()); d->elementPrototype->SetPrototype(Node::prototype(engine)); d->elementPrototype->SetAccessor(v8::String::New("tagName"), nodeName, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); engine->freezeObject(d->elementPrototype); } return d->elementPrototype; @@ -577,11 +577,11 @@ v8::Handle Attr::prototype(QV8Engine *engine) d->attrPrototype = qPersistentNew(v8::Object::New()); d->attrPrototype->SetPrototype(Node::prototype(engine)); d->attrPrototype->SetAccessor(v8::String::New("name"), name, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->attrPrototype->SetAccessor(v8::String::New("value"), value, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->attrPrototype->SetAccessor(v8::String::New("ownerElement"), ownerElement, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); engine->freezeObject(d->attrPrototype); } return d->attrPrototype; @@ -630,9 +630,9 @@ v8::Handle CharacterData::prototype(QV8Engine *engine) d->characterDataPrototype = qPersistentNew(v8::Object::New()); d->characterDataPrototype->SetPrototype(Node::prototype(engine)); d->characterDataPrototype->SetAccessor(v8::String::New("data"), nodeValue, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->characterDataPrototype->SetAccessor(v8::String::New("length"), length, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); engine->freezeObject(d->characterDataPrototype); } return d->characterDataPrototype; @@ -663,9 +663,9 @@ v8::Handle Text::prototype(QV8Engine *engine) d->textPrototype = qPersistentNew(v8::Object::New()); d->textPrototype->SetPrototype(CharacterData::prototype(engine)); d->textPrototype->SetAccessor(v8::String::New("isElementContentWhitespace"), isElementContentWhitespace, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->textPrototype->SetAccessor(v8::String::New("wholeText"), wholeText, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); engine->freezeObject(d->textPrototype); } return d->textPrototype; @@ -689,13 +689,13 @@ v8::Handle Document::prototype(QV8Engine *engine) d->documentPrototype = qPersistentNew(v8::Object::New()); d->documentPrototype->SetPrototype(Node::prototype(engine)); d->documentPrototype->SetAccessor(v8::String::New("xmlVersion"), xmlVersion, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->documentPrototype->SetAccessor(v8::String::New("xmlEncoding"), xmlEncoding, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->documentPrototype->SetAccessor(v8::String::New("xmlStandalone"), xmlStandalone, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); d->documentPrototype->SetAccessor(v8::String::New("documentElement"), documentElement, - 0, v8::External::Wrap(engine)); + 0, v8::External::New(engine)); engine->freezeObject(d->documentPrototype); } return d->documentPrototype; @@ -854,9 +854,9 @@ v8::Handle NamedNodeMap::prototype(QV8Engine *engine) QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->namedNodeMapPrototype.IsEmpty()) { v8::Local ot = v8::ObjectTemplate::New(); - ot->SetAccessor(v8::String::New("length"), length, 0, v8::External::Wrap(engine)); - ot->SetIndexedPropertyHandler(indexed, 0, 0, 0, 0, v8::External::Wrap(engine)); - ot->SetFallbackPropertyHandler(named, 0, 0, 0, 0, v8::External::Wrap(engine)); + 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)); d->namedNodeMapPrototype = qPersistentNew(ot->NewInstance()); engine->freezeObject(d->namedNodeMapPrototype); } @@ -903,8 +903,8 @@ v8::Handle NodeList::prototype(QV8Engine *engine) QQmlXMLHttpRequestData *d = xhrdata(engine); if (d->nodeListPrototype.IsEmpty()) { v8::Local ot = v8::ObjectTemplate::New(); - ot->SetAccessor(v8::String::New("length"), length, 0, v8::External::Wrap(engine)); - ot->SetIndexedPropertyHandler(indexed, 0, 0, 0, 0, v8::External::Wrap(engine)); + 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()); engine->freezeObject(d->nodeListPrototype); } @@ -1790,7 +1790,7 @@ void *qt_add_qmlxmlhttprequest(QV8Engine *engine) // XMLHttpRequest v8::Local xmlhttprequest = v8::FunctionTemplate::New(qmlxmlhttprequest_new, - v8::External::Wrap(engine)); + v8::External::New(engine)); xmlhttprequest->InstanceTemplate()->SetHasExternalResource(true); // Methods diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 15611f3..2f14b62 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -1451,7 +1451,7 @@ int QV8Engine::consoleCountHelper(const QString &file, quint16 line, quint16 col v8::Handle QV8Engine::getPlatform(v8::Local, const v8::AccessorInfo &info) { - QV8Engine *engine = reinterpret_cast(v8::External::Unwrap(info.Data())); + QV8Engine *engine = reinterpret_cast(v8::External::Cast(*info.Data())->Value()); if (!engine->m_platform) { // Only allocate a platform object once engine->m_platform = new QQmlPlatform(engine->m_engine); @@ -1461,7 +1461,7 @@ v8::Handle QV8Engine::getPlatform(v8::Local, const v8::Ac v8::Handle QV8Engine::getApplication(v8::Local, const v8::AccessorInfo &info) { - QV8Engine *engine = reinterpret_cast(v8::External::Unwrap(info.Data())); + QV8Engine *engine = reinterpret_cast(v8::External::Cast(*info.Data())->Value()); if (!engine->m_application) { // Only allocate an application object once engine->m_application = QQml_guiProvider()->application(engine->m_engine); @@ -1472,7 +1472,7 @@ v8::Handle QV8Engine::getApplication(v8::Local, const v8: #ifndef QT_NO_IM v8::Handle QV8Engine::getInputMethod(v8::Local, const v8::AccessorInfo &info) { - QV8Engine *engine = reinterpret_cast(v8::External::Unwrap(info.Data())); + QV8Engine *engine = reinterpret_cast(v8::External::Cast(*info.Data())->Value()); return engine->newQObject(QQml_guiProvider()->inputMethod(), CppOwnership); } #endif diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h index 9c3eb22..090ffaa 100644 --- a/src/qml/qml/v8/qv8engine_p.h +++ b/src/qml/qml/v8/qv8engine_p.h @@ -102,8 +102,8 @@ QT_BEGIN_NAMESPACE // a handle, qFatal() is called. // #define QML_GLOBAL_HANDLE_DEBUGGING -#define V8ENGINE() ((QV8Engine *)v8::External::Unwrap(args.Data())) -#define V8FUNCTION(function, engine) v8::FunctionTemplate::New(function, v8::External::Wrap((QV8Engine*)engine))->GetFunction() +#define V8ENGINE() ((QV8Engine *)v8::External::Cast(*args.Data())->Value()) +#define V8FUNCTION(function, engine) v8::FunctionTemplate::New(function, v8::External::New((QV8Engine*)engine))->GetFunction() #define V8THROW_ERROR(string) { \ v8::ThrowException(v8::Exception::Error(v8::String::New(string))); \ return v8::Handle(); \ @@ -112,7 +112,7 @@ QT_BEGIN_NAMESPACE v8::ThrowException(v8::Exception::TypeError(v8::String::New(string))); \ return v8::Handle(); \ } -#define V8ENGINE_ACCESSOR() ((QV8Engine *)v8::External::Unwrap(info.Data())); +#define V8ENGINE_ACCESSOR() ((QV8Engine *)v8::External::Cast(*info.Data())->Value()); #define V8THROW_ERROR_SETTER(string) { \ v8::ThrowException(v8::Exception::Error(v8::String::New(string))); \ return; \ diff --git a/src/qml/qml/v8/qv8qobjectwrapper.cpp b/src/qml/qml/v8/qv8qobjectwrapper.cpp index 4539401..0982f17 100644 --- a/src/qml/qml/v8/qv8qobjectwrapper.cpp +++ b/src/qml/qml/v8/qv8qobjectwrapper.cpp @@ -277,7 +277,7 @@ static v8::Handle GenericValueGetter(v8::Local, const v8: if (QQmlData::wasDeleted(object)) return v8::Undefined(); QQmlPropertyData *property = - (QQmlPropertyData *)v8::External::Unwrap(info.Data()); + (QQmlPropertyData *)v8::External::Cast(*info.Data())->Value(); QQmlEngine *engine = resource->engine->engine(); QQmlEnginePrivate *ep = engine?QQmlEnginePrivate::get(engine):0; @@ -894,7 +894,7 @@ static void FastValueSetter(v8::Local, v8::Local value, QObject *object = resource->object; QQmlPropertyData *property = - (QQmlPropertyData *)v8::External::Unwrap(info.Data()); + (QQmlPropertyData *)v8::External::Cast(*info.Data())->Value(); int index = property->coreIndex; @@ -1029,7 +1029,7 @@ v8::Local QQmlPropertyCache::newQObject(QObject *object, QV8Engine * // this type and the property accessor checks if the object is 0 (deleted) before // dereferencing the pointer. ft->InstanceTemplate()->SetAccessor(engine->toString(iter.key()), fastgetter, fastsetter, - v8::External::Wrap(property)); + v8::External::New(property)); } } diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 9c73c7d..995d951 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -3479,7 +3479,7 @@ QQuickContext2DEngineData::QQuickContext2DEngineData(QV8Engine *engine) v8::Local ft = v8::FunctionTemplate::New(); ft->InstanceTemplate()->SetHasExternalResource(true); - ft->PrototypeTemplate()->SetAccessor(v8::String::New("canvas"), ctx2d_canvas, 0, v8::External::Wrap(engine)); + ft->PrototypeTemplate()->SetAccessor(v8::String::New("canvas"), ctx2d_canvas, 0, v8::External::New(engine)); ft->PrototypeTemplate()->Set(v8::String::New("restore"), V8FUNCTION(ctx2d_restore, engine)); ft->PrototypeTemplate()->Set(v8::String::New("reset"), V8FUNCTION(ctx2d_reset, engine)); ft->PrototypeTemplate()->Set(v8::String::New("save"), V8FUNCTION(ctx2d_save, engine)); @@ -3490,24 +3490,24 @@ QQuickContext2DEngineData::QQuickContext2DEngineData(QV8Engine *engine) ft->PrototypeTemplate()->Set(v8::String::New("transform"), V8FUNCTION(ctx2d_transform, engine)); ft->PrototypeTemplate()->Set(v8::String::New("translate"), V8FUNCTION(ctx2d_translate, engine)); ft->PrototypeTemplate()->Set(v8::String::New("shear"), V8FUNCTION(ctx2d_shear, engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("globalAlpha"), ctx2d_globalAlpha, ctx2d_globalAlpha_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("globalCompositeOperation"), ctx2d_globalCompositeOperation, ctx2d_globalCompositeOperation_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("fillRule"), ctx2d_fillRule, ctx2d_fillRule_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("fillStyle"), ctx2d_fillStyle, ctx2d_fillStyle_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("strokeStyle"), ctx2d_strokeStyle, ctx2d_strokeStyle_set, v8::External::Wrap(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("globalAlpha"), ctx2d_globalAlpha, ctx2d_globalAlpha_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("globalCompositeOperation"), ctx2d_globalCompositeOperation, ctx2d_globalCompositeOperation_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("fillRule"), ctx2d_fillRule, ctx2d_fillRule_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("fillStyle"), ctx2d_fillStyle, ctx2d_fillStyle_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("strokeStyle"), ctx2d_strokeStyle, ctx2d_strokeStyle_set, v8::External::New(engine)); ft->PrototypeTemplate()->Set(v8::String::New("createLinearGradient"), V8FUNCTION(ctx2d_createLinearGradient, engine)); ft->PrototypeTemplate()->Set(v8::String::New("createRadialGradient"), V8FUNCTION(ctx2d_createRadialGradient, engine)); ft->PrototypeTemplate()->Set(v8::String::New("createConicalGradient"), V8FUNCTION(ctx2d_createConicalGradient, engine)); ft->PrototypeTemplate()->Set(v8::String::New("createPattern"), V8FUNCTION(ctx2d_createPattern, engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("lineCap"), ctx2d_lineCap, ctx2d_lineCap_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("lineJoin"), ctx2d_lineJoin, ctx2d_lineJoin_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("lineWidth"), ctx2d_lineWidth, ctx2d_lineWidth_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("miterLimit"), ctx2d_miterLimit, ctx2d_miterLimit_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("shadowBlur"), ctx2d_shadowBlur, ctx2d_shadowBlur_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("shadowColor"), ctx2d_shadowColor, ctx2d_shadowColor_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("shadowOffsetX"), ctx2d_shadowOffsetX, ctx2d_shadowOffsetX_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("shadowOffsetY"), ctx2d_shadowOffsetY, ctx2d_shadowOffsetY_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("path"), ctx2d_path, ctx2d_path_set, v8::External::Wrap(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("lineCap"), ctx2d_lineCap, ctx2d_lineCap_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("lineJoin"), ctx2d_lineJoin, ctx2d_lineJoin_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("lineWidth"), ctx2d_lineWidth, ctx2d_lineWidth_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("miterLimit"), ctx2d_miterLimit, ctx2d_miterLimit_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("shadowBlur"), ctx2d_shadowBlur, ctx2d_shadowBlur_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("shadowColor"), ctx2d_shadowColor, ctx2d_shadowColor_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("shadowOffsetX"), ctx2d_shadowOffsetX, ctx2d_shadowOffsetX_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("shadowOffsetY"), ctx2d_shadowOffsetY, ctx2d_shadowOffsetY_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("path"), ctx2d_path, ctx2d_path_set, v8::External::New(engine)); ft->PrototypeTemplate()->Set(v8::String::New("clearRect"), V8FUNCTION(ctx2d_clearRect, engine)); ft->PrototypeTemplate()->Set(v8::String::New("fillRect"), V8FUNCTION(ctx2d_fillRect, engine)); ft->PrototypeTemplate()->Set(v8::String::New("strokeRect"), V8FUNCTION(ctx2d_strokeRect, engine)); @@ -3530,9 +3530,9 @@ QQuickContext2DEngineData::QQuickContext2DEngineData(QV8Engine *engine) ft->PrototypeTemplate()->Set(v8::String::New("drawFocusRing"), V8FUNCTION(ctx2d_drawFocusRing, engine)); ft->PrototypeTemplate()->Set(v8::String::New("caretBlinkRate"), V8FUNCTION(ctx2d_caretBlinkRate, engine)); ft->PrototypeTemplate()->Set(v8::String::New("setCaretSelectionRect"), V8FUNCTION(ctx2d_setCaretSelectionRect, engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("font"), ctx2d_font, ctx2d_font_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("textAlign"), ctx2d_textAlign, ctx2d_textAlign_set, v8::External::Wrap(engine)); - ft->InstanceTemplate()->SetAccessor(v8::String::New("textBaseline"), ctx2d_textBaseline, ctx2d_textBaseline_set, v8::External::Wrap(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("font"), ctx2d_font, ctx2d_font_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("textAlign"), ctx2d_textAlign, ctx2d_textAlign_set, v8::External::New(engine)); + ft->InstanceTemplate()->SetAccessor(v8::String::New("textBaseline"), ctx2d_textBaseline, ctx2d_textBaseline_set, v8::External::New(engine)); ft->PrototypeTemplate()->Set(v8::String::New("fillText"), V8FUNCTION(ctx2d_fillText, engine)); ft->PrototypeTemplate()->Set(v8::String::New("measureText"), V8FUNCTION(ctx2d_measureText, engine)); ft->PrototypeTemplate()->Set(v8::String::New("strokeText"), V8FUNCTION(ctx2d_strokeText, engine)); @@ -3554,14 +3554,14 @@ QQuickContext2DEngineData::QQuickContext2DEngineData(QV8Engine *engine) v8::Local ftPixelArray = v8::FunctionTemplate::New(); ftPixelArray->InstanceTemplate()->SetHasExternalResource(true); - ftPixelArray->InstanceTemplate()->SetAccessor(v8::String::New("length"), ctx2d_pixelArray_length, 0, v8::External::Wrap(engine)); - ftPixelArray->InstanceTemplate()->SetIndexedPropertyHandler(ctx2d_pixelArray_indexed, ctx2d_pixelArray_indexed_set, 0, 0, 0, v8::External::Wrap(engine)); + ftPixelArray->InstanceTemplate()->SetAccessor(v8::String::New("length"), ctx2d_pixelArray_length, 0, v8::External::New(engine)); + ftPixelArray->InstanceTemplate()->SetIndexedPropertyHandler(ctx2d_pixelArray_indexed, ctx2d_pixelArray_indexed_set, 0, 0, 0, v8::External::New(engine)); constructorPixelArray = qPersistentNew(ftPixelArray->GetFunction()); v8::Local ftImageData = v8::FunctionTemplate::New(); - ftImageData->InstanceTemplate()->SetAccessor(v8::String::New("width"), ctx2d_imageData_width, 0, v8::External::Wrap(engine)); - ftImageData->InstanceTemplate()->SetAccessor(v8::String::New("height"), ctx2d_imageData_height, 0, v8::External::Wrap(engine)); - ftImageData->InstanceTemplate()->SetAccessor(v8::String::New("data"), ctx2d_imageData_data, 0, v8::External::Wrap(engine)); + ftImageData->InstanceTemplate()->SetAccessor(v8::String::New("width"), ctx2d_imageData_width, 0, v8::External::New(engine)); + ftImageData->InstanceTemplate()->SetAccessor(v8::String::New("height"), ctx2d_imageData_height, 0, v8::External::New(engine)); + ftImageData->InstanceTemplate()->SetAccessor(v8::String::New("data"), ctx2d_imageData_data, 0, v8::External::New(engine)); ftImageData->InstanceTemplate()->SetInternalFieldCount(1); constructorImageData = qPersistentNew(ftImageData->GetFunction()); } -- 1.7.2.5