But notice that throughout this, no one advancing a proposal advocated
freezing by default. JS developers use function objects as mutable
objects. Not just to set .prototype, also to decorate with ad-hoc and
meta-data properties. Freezing is not wanted by default.
Another example: when defining parser combinators, I've re-defined
.toString, to make it easier to identify the parser combination in question
during debugging.
This would be less of an issue if core JS operations weren't biased
towards mutation. If it was easy to create modified function objects
without in-place mutation, freezing functions would be more acceptable.
Claus
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss