diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-19 13:28:26 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-06-25 07:36:48 +0000 |
commit | 1596112e146b28541bcee412ed159cdea7e692d0 (patch) | |
tree | 29e858041496256c9c9c700fca4fb7220d78d46e /src/qml/jsapi/qjsvalue.cpp | |
parent | 3823e9b94f849f8344b81250fac708ac2eaccd16 (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<QV4::Object>()); 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"); } |