diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-22 15:34:57 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-02 19:29:25 +0000 |
commit | 98263a01373f5b225d64da216537165ae27d7ff1 (patch) | |
tree | 60980c16c6cc6f6658355bcd428245819b4b732a /src/qml/jsapi/qjsvalue.cpp | |
parent | d21ef386ece52490d428daacb8f7f4658e9f78e5 (diff) |
Unify put and putIndexed
Pass an Identifier through those virtual methods to unify
the string and integer based versions.
Also add the receiver that's required in ES7
Change-Id: I4e7f01b4c97cc80bcb3c485f6343f28213dc9e6b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index aa88530fe4..73e6243520 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -1209,10 +1209,8 @@ void QJSValue::setProperty(quint32 arrayIndex, const QJSValue& value) } QV4::ScopedValue v(scope, QJSValuePrivate::convertedToValue(engine, value)); - if (arrayIndex != UINT_MAX) - o->putIndexed(arrayIndex, v); - else - o->put(engine->id_uintMax(), v); + Identifier id = arrayIndex != UINT_MAX ? Identifier::fromArrayIndex(arrayIndex) : engine->id_uintMax()->identifier(); + o->put(id, v); if (engine->hasException) engine->catchException(); } |