tc39 / Function-prototype-toString-revision

:fishing_pole_and_fish: ECMA-262 proposal to update Function.prototype.toString
https://tc39.github.io/Function-prototype-toString-revision
26 stars 10 forks source link

fixes #19: remove line terminator normalisation #22

Closed michaelficarra closed 7 years ago

michaelficarra commented 7 years ago

Fixes #19. Implementors have made it clear that they do not plan to implement Function.prototype.toString line terminator normalisation due to either performance costs or extreme difficulty in preserving performance. Line terminator normalisation is a feature of Function.prototype.toString that never existed in reality. It was added mostly for consistency with templates and to avoid accidentally observing file encodings. But we are not trying to design a nice API. We are trying to document a legacy feature of JavaScript that would be more appropriate in Annex B. Because of this, we will make it easy for implementors to follow the spec with as few changes to their implementation as possible. The goal of this proposal is to simply further specify the Function.prototype.toString behaviour and align implementations where they deviate from each other.