diff options
-rw-r--r-- | src/qml/jsruntime/qv4context.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 7 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4object_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper.cpp | 2 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 22dd0b17b9..403beacf39 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -372,7 +372,7 @@ void ExecutionContext::setProperty(String *name, const Value &value) if (activation) { uint member = activation->internalClass()->find(name); if (member < UINT_MAX) { - activation->putValue(activation->propertyAt(member), activation->internalClass()->propertyData[member], value); + activation->putValue(member, value); return; } } diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 2cdc8bd1ee..d121b547ef 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -100,11 +100,14 @@ ReturnedValue Object::getValue(const Value &thisObject, const Property *p, Prope return getter->call(callData); } -void Object::putValue(Property *pd, PropertyAttributes attrs, const Value &value) +void Object::putValue(uint memberIndex, const Value &value) { if (internalClass()->engine->hasException) return; + Property *pd = propertyAt(memberIndex); + PropertyAttributes attrs = internalClass()->propertyData[memberIndex]; + if (attrs.isAccessor()) { if (Heap::FunctionObject *set = pd->setter()) { Scope scope(set->internalClass->engine); @@ -483,7 +486,7 @@ void Object::setLookup(Managed *m, Lookup *l, const Value &value) } if (idx != UINT_MAX) { - o->putValue(o->propertyAt(idx), o->internalClass()->propertyData[idx], value); + o->putValue(idx, value); return; } } diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index b748f2e113..2d82213ec0 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -177,7 +177,7 @@ struct Q_QML_EXPORT Object: Managed { return getValue(t, p, attrs); } - void putValue(Property *pd, PropertyAttributes attrs, const Value &value); + void putValue(uint memberIndex, const Value &value); /* The spec default: Writable: true, Enumerable: false, Configurable: true */ void defineDefaultProperty(String *name, const Value &value) { diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index ce51c39d88..997bc1be4d 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -240,7 +240,7 @@ void QmlContextWrapper::put(Managed *m, String *name, const Value &value) uint member = wrapper->internalClass()->find(name); if (member < UINT_MAX) { - wrapper->putValue(wrapper->propertyAt(member), wrapper->internalClass()->propertyData[member], value); + wrapper->putValue(member, value); return; } |