Catch Decorators? How about this??


#1

So this guy is all like…

And I’m all like, why not…

Right?!?

I guess I was the only one that thought it was funny :pensive:


#2

I actually have no idea what I’m looking at here. Maybe…just maybe…I should probably know more about decorators haha.


#3

:wink:

The short version is that decorators are functions that get called to wrap definitions and return new definitions. So something like this:

@MyDecorator
myMethod() {
    // ...
}

is basically the same as this

myMethod = MyDecorator(function myMethod () {
    // ...
})

This guy is making a decorator to create try…catch handlers for functions, apparently at the expense of losing all scope and context for riding the decorator train. My joke was, why stop at ripping try…catch out of the function? Why not put the whole function in a decorator? :stuck_out_tongue: