diff options
Diffstat (limited to 'src/qml/jsruntime/qv4argumentsobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4argumentsobject.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp index c2a50a49ec..7a914a9c13 100644 --- a/src/qml/jsruntime/qv4argumentsobject.cpp +++ b/src/qml/jsruntime/qv4argumentsobject.cpp @@ -169,20 +169,18 @@ bool ArgumentsObject::defineOwnProperty(Managed *m, Identifier id, const Propert return result; } -ReturnedValue ArgumentsObject::getIndexed(const Managed *m, uint index, bool *hasProperty) +ReturnedValue ArgumentsObject::get(const Managed *m, Identifier id, const Value *receiver, bool *hasProperty) { const ArgumentsObject *args = static_cast<const ArgumentsObject *>(m); - if (args->fullyCreated()) - return Object::getIndexed(m, index, hasProperty); - - if (index < static_cast<uint>(args->context()->argc())) { - if (hasProperty) - *hasProperty = true; - return args->context()->args()[index].asReturnedValue(); + if (id.isArrayIndex() && !args->fullyCreated()) { + uint index = id.asArrayIndex(); + if (index < static_cast<uint>(args->context()->argc())) { + if (hasProperty) + *hasProperty = true; + return args->context()->args()[index].asReturnedValue(); + } } - if (hasProperty) - *hasProperty = false; - return Encode::undefined(); + return Object::get(m, id, receiver, hasProperty); } bool ArgumentsObject::put(Managed *m, Identifier id, const Value &value, Value *receiver) |