Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.1
-
None
Description
Run this snippet in qmlscene:
import QtQuick 2.0 Item { Component.onCompleted: { var obj = {foo: 1, bar: 2, asdf: 3, blub: 4}; console.log("before: ", JSON.stringify(obj)); for (var prop in obj) { delete obj[prop]; } console.log("after: ", JSON.stringify(obj)); } }
expected output:
qml: before:
qml: after: {}
actual output:
qml: before:
qml: after:
{"bar":2,"foo":1}When you run the snippet above (i.e. the contents of Component.onCompleted) in a browser environment (WebKit, Chromium, ...), the expected output will be shown.
Attachments
For Gerrit Dashboard: QTBUG-40021 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
228999,2 | Add test case for delete inside a for-in loop | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |