Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Namespacing techniques and the {} wrapper

  • Namespacing techniques and the {} wrapper

    Posted by Immanuel Morales on February 2, 2014 at 7:41 pm

    I’ve noticed that ExtendScript experts seem to agree that the best way to keep the namespace clean in extendscript is to wrap everything in curly braces { //expression; }. This doesn’t make sense to me though, because in Javascript, local variable scope only happens within a function object. So shouldn’t the wrapper instead be (function(){ //expression; }())? I’ve actually tried the curly braces technique and it hasn’t worked for me so I’m just wondering if there’s something I’m missing or if I should be announcing to the world to stop using curly braces wrappers and to start wrapping with a self invoking function as mentioned above.

    Dan Ebberts
    replied 12 years, 3 months ago
    2 Members · 3 Replies
  • 3 Replies

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy