Open Bug 1990075 Opened 2 months ago Updated 2 months ago

Add some more Thenable telemetry to support TC39

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

People

(Reporter: mgaudet, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

... we have thenable instrumentation already; -- the basic gist here being that -when- we look for "then" we track where the thenable came from; was it an own property, on a standard prototype, or on object.proto. Notably we don't report for Promise.prototype.then

From Matthieu Hoffman:

I believe this is necessary but not sufficient. The case we're concerned about is when the resolution is a native promise. So basically we need the existing GetThenValue instrumentation, but also add a check after .then is found whether IsPromise(resolution) is true. Only on those native promises, we're concerned with .then found that comes from an unexpected place.

Blocks: sm-telemetry
Severity: -- → N/A
Priority: -- → P3

Hey Mathieu,

Just want to make sure we get an agreement on what we want here.

Flags: needinfo?(mathieu.hofman.dev+mozilla)

I am actually trying to refine what kind of telemetry would be useful for promise adoption. We realized that simply counting whether the .then is the intrinsic %Promise.prototype.then% for native promises would likely give out too many false positives. See https://github.com/mhofman/proposal-native-promise-adoption/issues/1

It might be a case that there simply isn't any telemetry that we actually can implement to get a clear signal. Short of somehow manually reviewing all user code doing Promise.prototype.then overrides I'm not sure what to do at this point.

You need to log in before you can comment on or make changes to this bug.