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

Static class methods receive the prototype as the target and not the class #23

Open
cneuwirt opened this issue Aug 11, 2020 · 0 comments

Comments

@cneuwirt
Copy link

I have a class that looks like

class CustomInstance {
static uniqueEmail(email, @type(Database) database) {
if (email != null && database.hasEmail(email)) {
return ${email} is already taken;
}
}
}

function type(target, propertyKey, parameterIndex) {
...
}

The first argument (target) passed to the type decorator for static method uniqueEmail receives the CustomerInstance.prototype and not the CustomerInstance class itself. This breaks managing the metadata

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

1 participant