From 1596112e146b28541bcee412ed159cdea7e692d0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 19 Jun 2018 13:28:26 +0200 Subject: Add Proxy support for prototype handling Cleanup get/setPrototypeOf and fix some smaller incompatibilities in the default implementation for Object. Add the methods to the vtable and reimplement them according to spec for ProxyObjects. Clean up the Object.prototype.get/setPrototypeOf/__proto__ methods and fix a smaller bug in the Reflect API for those methods. Change-Id: I6e438753332ec4db963d6cdcf86f340ff212777a Reviewed-by: Simon Hausmann --- src/quick/items/context2d/qquickcontext2d.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/quick/items/context2d/qquickcontext2d.cpp') diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 07d5f6d39b..314b7904b4 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -956,7 +956,7 @@ static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV4::ExecutionE QQuickContext2DEngineData *ed = engineData(scope.engine); QV4::Scoped pixelData(scope, scope.engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->pixelArrayProto.value()); - pixelData->setPrototype(p); + pixelData->setPrototypeOf(p); if (image.isNull()) { *pixelData->d()->image = QImage(w, h, QImage::Format_ARGB32); @@ -1584,7 +1584,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createLinearGradient(const QV4::Scoped gradient(scope, scope.engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p); + gradient->setPrototypeOf(p); *gradient->d()->brush = QLinearGradient(x0, y0, x1, y1); RETURN_RESULT(*gradient); } @@ -1636,7 +1636,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient(const QV4::Scoped gradient(scope, scope.engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p); + gradient->setPrototypeOf(p); *gradient->d()->brush = QRadialGradient(QPointF(x1, y1), r1, QPointF(x0, y0), r0); RETURN_RESULT(*gradient); } @@ -1680,7 +1680,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createConicalGradient(cons QV4::Scoped gradient(scope, scope.engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p); + gradient->setPrototypeOf(p); *gradient->d()->brush = QConicalGradient(x, y, angle); RETURN_RESULT(*gradient); } @@ -4401,7 +4401,7 @@ void QQuickContext2D::setV4Engine(QV4::ExecutionEngine *engine) QV4::Scope scope(engine); QV4::Scoped wrapper(scope, engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->contextPrototype.value()); - wrapper->setPrototype(p); + wrapper->setPrototypeOf(p); wrapper->d()->context = this; m_v4value = wrapper; } -- cgit v1.2.3