Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86323

Iterating over Properties of a Proxied Object does not work

    XMLWordPrintable

Details

    • dd740d6b3469448dc1fd31c1742781e923e9f274 (qt/qtdeclarative/dev) 90307d688e8485c143ba291685aa847fb571f6fb (qt/qtdeclarative/6.0) 5a7aa7881fa2c7abffb3d34a6b642fe4efcadbf4 (qt/qtdeclarative/5.15)

    Description

      I have the need to wrap an object in a JS proxy. The proxy handler must be implemented in C++. The target "object" is empty and acts just as a dummy. More important is the functionality of the proxy to intercept property accesses and to re-route them to own logic.

      When wrapping an arbitrary object in a Javascript proxy, it is not possible to iterate over the proxied properties. I see that ownKeys() is called on the handler, but no further action is taken.

      Iterating over the object with a for..of loop requests Symbol.iterator which I have no idea of how to produce that in C++.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              fabiankosmale Fabian Kosmale
              rweickelt Richard Weickelt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes