Add some more Thenable telemetry to support TC39
Categories
(Core :: JavaScript Engine, task, P3)
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.
| Reporter | ||
Updated•2 months ago
|
| Reporter | ||
Comment 1•2 months ago
|
||
Hey Mathieu,
Just want to make sure we get an agreement on what we want here.
Comment 2•2 months ago
|
||
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.
Description
•