tc39 / proposal-function-implementation-hiding

JavaScript language proposal: function implementation hiding
https://ci.tc39.es/preview/tc39/ecma262/pull/1739
MIT License
98 stars 7 forks source link

high-fidelity polyfill use case seems to impact error stack traces #38

Closed misterdjules closed 4 years ago

misterdjules commented 4 years ago

When using the "hide source" directive to allow for high-fidelity polyfills, the impact would also be that those functions would appear only as anonymous in error stack traces. However it seems that native functions (e.g. Array.prototype.forEach) show up as ${some function name} anonymous.

Thus it seems that using the "hide source" directive could conflate two different use cases that are not necessarily both desirable at the same time for developers: allowing for implementing high fidelity polyfills, and hiding function names from error stack traces.

Is that intended, and if yes, why is that not an issue?

michaelficarra commented 4 years ago

Sorry, this was unintended. Thank you for bringing it to my attention. I've updated the example from the README: https://github.com/tc39/proposal-function-implementation-hiding/commit/9c8d1d4236736bdb17e771f99579fdf32da5c7da. Are there any other places that need updating? The spec text in https://github.com/tc39/ecma262/pull/1739 should already have been correct.

misterdjules commented 4 years ago

Are there any other places that need updating?

I don't think so, thanks for doing this 🙏