diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-05-24 13:26:38 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-24 13:58:56 +0200 |
commit | 0de6e8bb1bf0ca6e4d7992be15ed31f87514e48a (patch) | |
tree | 29e0e58b32607a5edb6c309dd53645d5af4b8ee9 /src/qml/qml/v8/qv8qobjectwrapper.cpp | |
parent | 74632fa02a5bd8653c02a4d84a1bcb6b1d5a88f5 (diff) |
Get rid of Get/SetHiddenValue in the v8 API
It was only used to mark an object as something to be used as a binding.
Simply use one of the free bits in QV4::Managed for that.
Also changed a bit more code over from v8 to v4.
Change-Id: I6e787e611041e058fe109df1d7a13598655f8eba
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qv8qobjectwrapper.cpp')
-rw-r--r-- | src/qml/qml/v8/qv8qobjectwrapper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/qml/v8/qv8qobjectwrapper.cpp b/src/qml/qml/v8/qv8qobjectwrapper.cpp index 173c71acd0..36d4b1c528 100644 --- a/src/qml/qml/v8/qv8qobjectwrapper.cpp +++ b/src/qml/qml/v8/qv8qobjectwrapper.cpp @@ -727,7 +727,8 @@ static inline void StoreProperty(QV8Engine *engine, QObject *object, QQmlPropert { QQmlBinding *newBinding = 0; if (value->IsFunction()) { - if (value->ToObject()->GetHiddenValue(v8::Value::fromV4Value(engine->bindingFlagKey())).IsEmpty()) { + QV4::FunctionObject *f = value->v4Value().asFunctionObject(); + if (!f->bindingKeyFlag) { if (!property->isVarProperty() && property->propType != qMetaTypeId<QJSValue>()) { // assigning a JS function to a non var or QJSValue property or is not allowed. QString error = QLatin1String("Cannot assign JavaScript function to "); @@ -746,7 +747,7 @@ static inline void StoreProperty(QV8Engine *engine, QObject *object, QQmlPropert QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); QV4::ExecutionEngine::StackFrame frame = v4->currentStackFrame(); - newBinding = new QQmlBinding(&function, object, context, frame.source.url(), + newBinding = new QQmlBinding(function->v4Value(), object, context, frame.source.url(), qmlSourceCoordinate(frame.line), qmlSourceCoordinate(frame.column)); newBinding->setTarget(object, *property, context); newBinding->setEvaluateFlags(newBinding->evaluateFlags() | |