drufball / layered-apis

A new standards effort for collaborating on high-level features.
275 stars 12 forks source link

Missing platform ability: Function.prototype.toString() censorship #7

Open domenic opened 6 years ago

domenic commented 6 years ago

The current async local storage spec requires censoring the toString() output of all functions it produces. This ensures that multiple implementations of the spec can cooexist without being observably different.

However, this is not an ability available to web developers today, and thus this requirement violates the rule of layered APIs that they must not use any magic.

I think the solution to this is to advance https://github.com/domenic/proposal-function-prototype-tostring-censorship, either the in-source-file pragma version, or some per-source-file header version, and thus give this ability to web developers as well.