From 166fc4d84729fee683a9ea6b2c27cf51dc5f1c9d Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 8 Sep 2018 22:38:27 +0200 Subject: Proxy.revokable creates an object with an anonymous revoke function Change-Id: Iaed36da1284e6545a88eaa17d23fa2862fc611be Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4proxy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qml') 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(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()); -- cgit v1.2.3