-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.0, 5.12.1
-
-
7e32be87c0f53ce2e5d3c1e351a559d6c600f1bf (qt/qtdeclarative/5.12)
The following code crashes:
function test() {
var obj = { 1: null, 2: null, 4096: null }
for (var t in obj)
if (t == 2)
delete obj[t]
}
For it to crash, the object must have all numeric property names, at least one must be larger than 4095, and a for-in loop must delete one of the properties other than the last. It crashes when it tries to do the next iteration of the loop. It doesn't seem to happen on a Mac.
The only workaround I've found is to include a non-numeric property, and explicitly skip over it in my for-in loop.
This may be related to https://bugreports.qt.io/browse/QTBUG-61356.