On 11/20/2017 10:01 AM, Mark Banner wrote:
Now that we don't have legacy add-ons outside of our control, I would like to propose that we stop using Object.freeze/Object.seal on most of our objects.
I would personally recommend to every JavaScript developer that they should use these functions, in web pages, in JavaScript libraries, …
I believe that Object.freeze and Object.seal are sanity functions, part of defensive programming, used to guarantee that no other part of the code is doing something which is not intended.
While you might think that the other parts of the code are exclusively addons. I will suggest that the other parts of the code start no further than 20 lines below in the same file.
Also, I will note that Object.freeze and Object.seal have the potential of offering more room for optimization in a JIT compiler. Currently we are not doing it in SpiderMonkey, but we could definitely improve the generated code based on freeze & seal properties.
-- Nicolas B. Pierron _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform