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/qml/jsapi/qjsvalue.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/jsapi') diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index aaac4e0a9a..01ec44e250 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -852,7 +852,7 @@ QJSValue QJSValue::prototype() const ScopedObject o(scope, QJSValuePrivate::getValue(this)->as()); if (!o) return QJSValue(); - ScopedObject p(scope, o->prototype()); + ScopedObject p(scope, o->getPrototypeOf()); if (!p) return QJSValue(NullValue); return QJSValue(o->internalClass()->engine, p.asReturnedValue()); @@ -884,7 +884,7 @@ void QJSValue::setPrototype(const QJSValue& prototype) if (!val) return; if (val->isNull()) { - o->setPrototype(nullptr); + o->setPrototypeOf(nullptr); return; } @@ -895,7 +895,7 @@ void QJSValue::setPrototype(const QJSValue& prototype) qWarning("QJSValue::setPrototype() failed: cannot set a prototype created in a different engine"); return; } - if (!o->setPrototype(p)) + if (!o->setPrototypeOf(p)) qWarning("QJSValue::setPrototype() failed: cyclic prototype value"); } -- cgit v1.2.3