Created attachment 440923 [details] screenshots from debugging Since Safari 15.1 we are experiencing a strange behaviour when using for-in-loops on objects with are themselves inherited from Object which have no own properties but only inherited ones. In this case the for-in-loop does not iterate on any properties - which it correctly does on Safari until version 15.0 and other browsers (e.g. latest Chrome). Unfortunately I can't reproduce this behaviour with a plain JS snippet, but it occurs in our app, so it might have some relation to certain scope scenarios. The attached screenshot shows an example of the different behaviour on latest Safari 15.0 (MacOS) compared to latest Safari Technology Preview 15.4 (MacOS) (the bug also occurs on Safari 15.1 with iOS beta 3). Above: On the left side you can see the related code snippet and on the right the watched variables on 15.0 (left) and 15.4 (right). The variable "obj" holds an object which itself has no properties, but inherits the properties "reader" and "type". The for-in-loop then concats the keys and values of the properites into "debugString". On 15.0 you can see that it results in "type > memory reader > array". On 15.4 it does not enter the for-in-loop, so "debugString" stays empty. Below: Now when adding a local property to "obj", we suddenly can iterate over all properties (even the not before considered "type" and "reader") as you can see from the content of "debugString2".
<rdar://problem/84150852>
Could you please provide a test case that reproduces the issue? It doesn't have to be very reduced, although that helps of course.
Probably, it is fixed in bug 231202, but it is helpful if we can get a test case :)
Duping it to bug 231202, described issue was fixed in that bug. *** This bug has been marked as a duplicate of bug 231202 ***