aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4proxy.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-09-08 22:38:27 +0200
committerLars Knoll <lars.knoll@qt.io>2018-09-09 15:52:06 +0000
commit166fc4d84729fee683a9ea6b2c27cf51dc5f1c9d (patch)
tree2549e6c05b1ba5a1935ada96b4d9e5756fd26204 /src/qml/jsruntime/qv4proxy.cpp
parent009a125d07448428a00abec70a894febe759adec (diff)
Proxy.revokable creates an object with an anonymous revoke function
Change-Id: Iaed36da1284e6545a88eaa17d23fa2862fc611be Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4proxy.cpp')
-rw-r--r--src/qml/jsruntime/qv4proxy.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp
index a1138c2515..71c238135c 100644
--- a/src/qml/jsruntime/qv4proxy.cpp
+++ b/src/qml/jsruntime/qv4proxy.cpp
@@ -758,7 +758,8 @@ ReturnedValue Proxy::method_revocable(const FunctionObject *f, const Value *, co
Q_ASSERT(proxy);
ScopedString revoke(scope, scope.engine->newString(QStringLiteral("revoke")));
- ScopedFunctionObject revoker(scope, createBuiltinFunction(scope.engine, revoke, method_revoke, 0));
+ ScopedFunctionObject revoker(scope, scope.engine->memoryManager->allocate<FunctionObject>(scope.engine->rootContext(), nullptr, method_revoke));
+ revoker->defineReadonlyConfigurableProperty(scope.engine->id_length(), Primitive::fromInt32(0));
revoker->defineDefaultProperty(scope.engine->symbol_revokableProxy(), proxy);
ScopedObject o(scope, scope.engine->newObject());