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

Should allow use of ES6 getters and setters. #3

Closed
scottwrobinson opened this issue Jun 25, 2015 · 0 comments
Closed

Should allow use of ES6 getters and setters. #3

scottwrobinson opened this issue Jun 25, 2015 · 0 comments

Comments

@scottwrobinson
Copy link
Owner

When using get and set methods in a Document, the Proxy correctly intercepts the call, but then any gets/sets done within the intercepted get/set is not intercepted by the Proxy.

Example:

class User extends Document {
    constructor() {
        super('user');
        this.firstName = String;
        this.lastName = String;
    }

    get fullName() {
        return this.firstName + ' ' + this.lastName;
    }
}

Calling user.fullName returns the string representation of the String object, which is the schema definition, and not the actual values of firstName and lastName.

scottwrobinson added a commit that referenced this issue Jun 26, 2015
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