Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting a _dec is not a function error #55

Closed
cowchimp opened this issue Jan 2, 2017 · 1 comment
Closed

getting a _dec is not a function error #55

cowchimp opened this issue Jan 2, 2017 · 1 comment

Comments

@cowchimp
Copy link

cowchimp commented Jan 2, 2017

Hi.

Trying to use this plugin. I'm probably doing something wrong.

I created a gist with a simplified test case
https://gist.github.com/cowchimp/fd1f2d19ba55997d371e861d09ddd76f
When I try to use a class decorator I get a _dec is not a function error.
When I comment out the line with the use of the decorator foo everything works.

Can you please let me know what I'm doing wrong?

Thanks.

@loganfsmyth
Copy link
Owner

loganfsmyth commented Jan 2, 2017

That is expected behavior. When you do

@foo('.')
class Foo {}

it is the same as doing

var fn = foo('.');

@fn
class Foo {}

meaning you are calling your dec function, but it is not returning a decorator function, when it should. In this case fn === undefined because your foo function logs the argument, but returns nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants