Open
Bug 1976515
Opened 5 months ago
Updated 1 month ago
Allow adding use counters for unimplemented dictionary fields
Categories
(Core :: DOM: Bindings (WebIDL), task)
Core
DOM: Bindings (WebIDL)
Tracking
()
NEW
People
(Reporter: saschanaz, Unassigned)
References
(Blocks 1 open bug)
Details
This should be possible without making it web-visible, with some Object.hasOwn-equivalent check while doing the dictionary initialization via JS value.
| Reporter | ||
Updated•5 months ago
|
Component: DOM: Core & HTML → DOM: Bindings (WebIDL)
| Reporter | ||
Comment 1•5 months ago
•
|
||
Hmm, proxies can still catch hasOwn via getOwnPropertyDescriptor...
o = new Proxy({}, { getOwnPropertyDescriptor(target, prop) { console.log(target, prop)} })
Object.hasOwn(o, "foo") // triggers the callback
But perhaps we have some internal native function to not trigger that. Matt, do you know? 👀
Edit: Maybe js::NativeLookupOwnProperty.
Flags: needinfo?(mgaudet)
Comment 2•5 months ago
|
||
Whay you're looking for is the Pure family of functions -- now we may need to export them as js/friend functions, but the gist is that they will try to look up a property, but will decline to trigger getters or GC.
This is perfect for telemetry.
So what you want is LookupPropertyPure
Flags: needinfo?(mgaudet)
| Reporter | ||
Comment 3•5 months ago
|
||
Sounds great, thank you!
You need to log in
before you can comment on or make changes to this bug.
Description
•