Console completion of a proxy's properties

0 views
Skip to first unread message

Stephan Bergmann

unread,
1:41 PM (3 hours ago) 1:41 PM
to Chrome DevTools
In the console, when `p` is a `Proxy` object (with a handler that provides an `ownKeys` function), typing `p.` will only provide as completion suggestions the properties of the proxied target object.  It appears to not call the proxy's `ownKeys` handler.

(From looking at the code, I think what's relevant is the
```
while (object.type === 'object' && object.subtype === 'proxy')
```
loop getting at `[[Target]]` in `completePropertiesInner` in `front_end/ui/components/text_editor/javascript.ts` in the <https://github.com/ChromeDevTools/devtools-frontend> repo.)

I wonder what the rationale is for that, and whether there would be some way the proxy could provide its own completion suggestions dynamically?
Reply all
Reply to author
Forward
0 new messages