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)

task

Tracking

()

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.

Component: DOM: Core & HTML → DOM: Bindings (WebIDL)

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)

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)

Sounds great, thank you!

See Also: → 2002346
You need to log in before you can comment on or make changes to this bug.