On 22 October 2015 at 06:34, Jordan Harband <ljh...@gmail.com> wrote: > One thing that seems to be missing from this thread is acknowledgement that > decorators are not just simple function wrappers. They take a property > descriptor as an argument, and they can return a new property descriptor - > which allows an object or "class" to have its shape determined at creation > time, allowing for massive engine optimization,
Er. I don't know where this myth is coming from, but let me debunk it right there: Decorators do not enable optimisations. If anything, they _prevent_ optimisations. What enables optimisations is a more declarative semantics with more invariants, less mutation, less reflection, and less intercession. That was one significant advantage of class syntax over previous imperative JS patterns. Decorators pretty much revert that (hard-fought) progress, because despite their looks, they are all but declarative, and just as imperative as the old-style patterns. Or function wrappers. A class that uses decorators will very likely have to go through all the same (or even worse) runtime overhead. /Andreas _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss